Skip to content

Commit ec3ca53

Browse files
committed
proper whatif support
1 parent 9f9c0ba commit ec3ca53

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

internal/functions/Initialize-ExternalLibrary.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
function Initialize-ExternalLibrary {
22
#Load external libraries for a specific RDBMS
3+
[CmdletBinding(SupportsShouldProcess)]
4+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess", '')]
35
Param (
46
[Parameter(Mandatory)]
57
[DBOps.ConnectionType]$Type
@@ -39,7 +41,7 @@ function Initialize-ExternalLibrary {
3941
if (-Not (Test-DBOSupportedSystem -Type $Type)) {
4042
Write-PSFMessage -Level Warning -Message "Installing dependent libraries for $Type connections"
4143
# Install dependencies into the current user scope
42-
$null = Install-DBOSupportLibrary -Type $Type -Scope CurrentUser
44+
$null = Install-DBOSupportLibrary -Type $Type -Scope CurrentUser -WhatIf:$WhatIfPreference
4345
# test again
4446
if (-Not (Test-DBOSupportedSystem -Type $Type)) {
4547
Write-PSFMessage -Level Warning -Message "Dependent libraries for $Type were not found. Run Install-DBOSupportLibrary -Type $Type"

internal/functions/Install-NugetPackage.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function Install-NugetPackage {
9393
}
9494
$folder = New-Item -ItemType Directory -Path $path -Force
9595

96-
$baseAddressUrl = $indexObject.resources | Where-Object { $_.'@type' -eq 'PackageBaseAddress/3.0.0' } | Select-Object -First 1
96+
$baseAddressUrl = $index.resources | Where-Object { $_.'@type' -eq 'PackageBaseAddress/3.0.0' } | Select-Object -First 1
9797
$downloadUrl = "$($baseAddressUrl.'@id')$packageLowerName/$selectedVersion/$fileName"
9898
Invoke-WebRequest -Uri $downloadUrl -OutFile $packagePath -ErrorAction Stop
9999
Write-PSFMessage -Level Verbose -Message "Extracting $fileName to $folder"

0 commit comments

Comments
 (0)