From 15c4edb718f07bb7209f7160da724a08eb89d473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=B6tz=20Jensen?= Date: Mon, 23 Oct 2023 12:54:36 +0200 Subject: [PATCH 1/3] Fix: #769 --- .../internal/functions/get-azureserviceobjective.ps1 | 7 +++++-- d365fo.tools/internal/functions/get-instancevalues.ps1 | 5 ++++- .../functions/invoke-clearazurespecificobjects.ps1 | 5 ++++- .../internal/functions/invoke-clearsqlspecificobjects.ps1 | 5 ++++- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/d365fo.tools/internal/functions/get-azureserviceobjective.ps1 b/d365fo.tools/internal/functions/get-azureserviceobjective.ps1 index 38e6b62a..6b2b3dcb 100644 --- a/d365fo.tools/internal/functions/get-azureserviceobjective.ps1 +++ b/d365fo.tools/internal/functions/get-azureserviceobjective.ps1 @@ -53,8 +53,11 @@ function Get-AzureServiceObjective { [switch] $EnableException ) - - $sqlCommand = Get-SqlCommand @PsBoundParameters -TrustedConnection $false + + $Params = Get-DeepClone $PSBoundParameters + if($Params.ContainsKey("EnableException")){$null = $Params.Remove("EnableException")} + + $sqlCommand = Get-SqlCommand @Params -TrustedConnection $false $commandText = (Get-Content "$script:ModuleRoot\internal\sql\get-azureserviceobjective.sql") -join [Environment]::NewLine diff --git a/d365fo.tools/internal/functions/get-instancevalues.ps1 b/d365fo.tools/internal/functions/get-instancevalues.ps1 index ec0cb5e4..9836a18e 100644 --- a/d365fo.tools/internal/functions/get-instancevalues.ps1 +++ b/d365fo.tools/internal/functions/get-instancevalues.ps1 @@ -62,7 +62,10 @@ function Get-InstanceValues { [switch] $EnableException ) - $sqlCommand = Get-SqlCommand @PsBoundParameters + $Params = Get-DeepClone $PSBoundParameters + if($Params.ContainsKey("EnableException")){$null = $Params.Remove("EnableException")} + + $sqlCommand = Get-SqlCommand @Params $commandText = (Get-Content "$script:ModuleRoot\internal\sql\get-instancevalues.sql") -join [Environment]::NewLine diff --git a/d365fo.tools/internal/functions/invoke-clearazurespecificobjects.ps1 b/d365fo.tools/internal/functions/invoke-clearazurespecificobjects.ps1 index 76692d5e..01c2e56e 100644 --- a/d365fo.tools/internal/functions/invoke-clearazurespecificobjects.ps1 +++ b/d365fo.tools/internal/functions/invoke-clearazurespecificobjects.ps1 @@ -57,7 +57,10 @@ Function Invoke-ClearAzureSpecificObjects { [switch] $EnableException ) - $sqlCommand = Get-SQLCommand @PsBoundParameters -TrustedConnection $false + $Params = Get-DeepClone $PSBoundParameters + if($Params.ContainsKey("EnableException")){$null = $Params.Remove("EnableException")} + + $sqlCommand = Get-SqlCommand @Params -TrustedConnection $false $commandText = (Get-Content "$script:ModuleRoot\internal\sql\clear-azurebacpacdatabase.sql") -join [Environment]::NewLine diff --git a/d365fo.tools/internal/functions/invoke-clearsqlspecificobjects.ps1 b/d365fo.tools/internal/functions/invoke-clearsqlspecificobjects.ps1 index 454be86e..ba30dec7 100644 --- a/d365fo.tools/internal/functions/invoke-clearsqlspecificobjects.ps1 +++ b/d365fo.tools/internal/functions/invoke-clearsqlspecificobjects.ps1 @@ -63,7 +63,10 @@ Function Invoke-ClearSqlSpecificObjects { [switch] $EnableException ) - $sqlCommand = Get-SQLCommand @PsBoundParameters + $Params = Get-DeepClone $PSBoundParameters + if($Params.ContainsKey("EnableException")){$null = $Params.Remove("EnableException")} + + $sqlCommand = Get-SqlCommand @Params $commandText = (Get-Content "$script:ModuleRoot\internal\sql\clear-sqlbacpacdatabase.sql") -join [Environment]::NewLine From a38ce4ca29cd09f9cb2c77ec9b16055e69d0c667 Mon Sep 17 00:00:00 2001 From: Florian Hopfner <33372796+FH-Inway@users.noreply.github.com> Date: Mon, 23 Oct 2023 18:43:46 +0200 Subject: [PATCH 2/3] update url of MS documentation page about sqlpackage downloads fixes #771 --- d365fo.tools/functions/invoke-d365installsqlpackage.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d365fo.tools/functions/invoke-d365installsqlpackage.ps1 b/d365fo.tools/functions/invoke-d365installsqlpackage.ps1 index b788726d..fb4dac4a 100644 --- a/d365fo.tools/functions/invoke-d365installsqlpackage.ps1 +++ b/d365fo.tools/functions/invoke-d365installsqlpackage.ps1 @@ -73,14 +73,14 @@ function Invoke-D365InstallSqlPackage { ) if (-not $SkipExtractFromPage) { - $content = (Invoke-WebRequest -Uri "https://docs.microsoft.com/en-us/sql/tools/sqlpackage-download" -UseBasicParsing).content + $content = (Invoke-WebRequest -Uri "https://learn.microsoft.com/en-us/sql/tools/sqlpackage-download" -UseBasicParsing).content $res = $content -match 'Windows .NET Core<.*/td>\s* Date: Tue, 24 Oct 2023 06:17:44 +0200 Subject: [PATCH 3/3] Version: 0.7.4 --- d365fo.tools/d365fo.tools.psd1 | 2 +- d365fo.tools/d365fo.tools.psm1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/d365fo.tools/d365fo.tools.psd1 b/d365fo.tools/d365fo.tools.psd1 index 09618838..f3c2aa53 100644 --- a/d365fo.tools/d365fo.tools.psd1 +++ b/d365fo.tools/d365fo.tools.psd1 @@ -3,7 +3,7 @@ RootModule = 'd365fo.tools.psm1' # Version number of this module. - ModuleVersion = '0.7.3' + ModuleVersion = '0.7.4' # ID used to uniquely identify this module GUID = '7c7b26d4-f764-4cb0-a692-459a0a689dbb' diff --git a/d365fo.tools/d365fo.tools.psm1 b/d365fo.tools/d365fo.tools.psm1 index e1517fc9..2e69eeb0 100644 --- a/d365fo.tools/d365fo.tools.psm1 +++ b/d365fo.tools/d365fo.tools.psm1 @@ -1,5 +1,5 @@ $script:ModuleRoot = $PSScriptRoot -$script:ModuleVersion = "0.7.3" +$script:ModuleVersion = "0.7.4" # Detect whether at some level dotsourcing was enforced $script:doDotSource = Get-PSFConfigValue -FullName d365fo.tools.Import.DoDotSource -Fallback $false