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