From 7f14116514f2cfbe103d85d509ba0f74780fbe80 Mon Sep 17 00:00:00 2001 From: Johan Ljunggren Date: Sun, 17 May 2020 08:05:30 +0200 Subject: [PATCH] SqlServerDsc.Common: Fix comment-based help and remove debug code (#1549) --- CHANGELOG.md | 3 ++- .../Modules/SqlServerDsc.Common/SqlServerDsc.Common.psm1 | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c28d799e..c46247499 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,8 @@ in a future release. - Fixing a problem with the latest ModuleBuild 1.7.0 that breaks the CI pipeline. - SqlServerDsc.Common - - Added function `Import-Assembly`. + - Added function `Import-Assembly` that can help import an assembly + into the PowerShell session. - Prepared unit tests to support Pester 5 so a minimal conversation is only needed later. - Updated `Import-SQLPSModule` to better support unit tests. diff --git a/source/Modules/SqlServerDsc.Common/SqlServerDsc.Common.psm1 b/source/Modules/SqlServerDsc.Common/SqlServerDsc.Common.psm1 index ff0f07c42..108b12ddb 100644 --- a/source/Modules/SqlServerDsc.Common/SqlServerDsc.Common.psm1 +++ b/source/Modules/SqlServerDsc.Common/SqlServerDsc.Common.psm1 @@ -672,10 +672,11 @@ function Connect-SQLAnalysis <# .SYNOPSIS - Returns a reference to the ConnectionInfo assembly. + Imports the assembly into the session. .DESCRIPTION - Returns a reference to the ConnectionInfo assembly. + Imports the assembly into the session and returns a reference to the + assembly. .PARAMETER Name Specifies the name of the assembly to load. @@ -724,12 +725,10 @@ function Import-Assembly { if ($LoadWithPartialName.IsPresent) { - Write-Verbose -Message 'DEBUG1' -Verbose $assemblyInformation = [System.Reflection.Assembly]::LoadWithPartialName($Name) } else { - Write-Verbose -Message 'DEBUG2' -Verbose $assemblyInformation = [System.Reflection.Assembly]::Load($Name) } @@ -739,7 +738,6 @@ function Import-Assembly } catch { - Write-Verbose ($_ | Out-String) -Verbose $errorMessage = $script:localizedData.FailedToLoadAssembly -f $Name New-InvalidOperationException -Message $errorMessage -ErrorRecord $_