From b76868255cbe4ea936b607d97ea63c6b3566bcf5 Mon Sep 17 00:00:00 2001 From: pavankadabala-png Date: Wed, 10 Jun 2026 16:30:42 -0400 Subject: [PATCH 1/4] Fix #684: pass DatabaseName through to SQL connection in Get-D365Database --- d365fo.tools/functions/get-d365database.ps1 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/d365fo.tools/functions/get-d365database.ps1 b/d365fo.tools/functions/get-d365database.ps1 index 8ab1c16b..c633752b 100644 --- a/d365fo.tools/functions/get-d365database.ps1 +++ b/d365fo.tools/functions/get-d365database.ps1 @@ -19,8 +19,11 @@ If Azure use the full address to the database server, e.g. server.database.windows.net .PARAMETER DatabaseName - The name of the database - + The name of the database that you want to connect to, to retrieve the list of databases from + + This is useful if the credentials that you are using only have access to a specific database, and not the default "master" database + + Default value is fetched from the current configuration on the machine .PARAMETER SqlUser The login name for the SQL Server instance @@ -37,7 +40,12 @@ This will show if the AXDB_ORIGINAL database exists on the default SQL Server / Azure SQL Database instance. - .NOTES + .EXAMPLE + PS C:\> Get-D365Database -DatabaseName AXDB + + This will show all databases on the default SQL Server / Azure SQL Database instance, by establishing the connection against the AXDB database instead of the default "master" database. + + .NOTES Tags: Database, DB, Servicing Author: Mötz Jensen (@Splaxi) @@ -61,7 +69,7 @@ function Get-D365Database { $UseTrustedConnection = Test-TrustedConnection $PSBoundParameters - $SqlParams = @{ DatabaseServer = $DatabaseServer; DatabaseName = "master"; + $SqlParams = @{ DatabaseServer = $DatabaseServer; DatabaseName = $DatabaseName; SqlUser = $SqlUser; SqlPwd = $SqlPwd } @@ -98,4 +106,4 @@ function Get-D365Database { $sqlCommand.Dispose() } -} \ No newline at end of file +} From 540635c4f8511bfeb3a31d1d9783500c080442ae Mon Sep 17 00:00:00 2001 From: pavankadabala-png Date: Wed, 10 Jun 2026 16:45:23 -0400 Subject: [PATCH 2/4] Fix CBH formatting: indentation and missing blank line --- d365fo.tools/functions/get-d365database.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/d365fo.tools/functions/get-d365database.ps1 b/d365fo.tools/functions/get-d365database.ps1 index c633752b..4e13db94 100644 --- a/d365fo.tools/functions/get-d365database.ps1 +++ b/d365fo.tools/functions/get-d365database.ps1 @@ -24,6 +24,7 @@ This is useful if the credentials that you are using only have access to a specific database, and not the default "master" database Default value is fetched from the current configuration on the machine + .PARAMETER SqlUser The login name for the SQL Server instance @@ -45,7 +46,7 @@ This will show all databases on the default SQL Server / Azure SQL Database instance, by establishing the connection against the AXDB database instead of the default "master" database. - .NOTES + .NOTES Tags: Database, DB, Servicing Author: Mötz Jensen (@Splaxi) @@ -69,7 +70,7 @@ function Get-D365Database { $UseTrustedConnection = Test-TrustedConnection $PSBoundParameters - $SqlParams = @{ DatabaseServer = $DatabaseServer; DatabaseName = $DatabaseName; + $SqlParams = @{ DatabaseServer = $DatabaseServer; DatabaseName = $DatabaseName; SqlUser = $SqlUser; SqlPwd = $SqlPwd } From 249e56eded00a9eb73543ff4f67713edf9254068 Mon Sep 17 00:00:00 2001 From: pavankadabala-png Date: Thu, 18 Jun 2026 11:18:29 -0400 Subject: [PATCH 3/4] Fix PSAvoidDefaultValueForMandatoryParameter in Invoke-D365SDPInstall --- d365fo.tools/functions/invoke-d365sdpinstall.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/d365fo.tools/functions/invoke-d365sdpinstall.ps1 b/d365fo.tools/functions/invoke-d365sdpinstall.ps1 index 82836660..52577335 100644 --- a/d365fo.tools/functions/invoke-d365sdpinstall.ps1 +++ b/d365fo.tools/functions/invoke-d365sdpinstall.ps1 @@ -9,7 +9,7 @@ https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/deployment/install-deployable-package .PARAMETER Path - Path to the update package that you want to install into the environment + Path to the update package that you want to install into the enhvironment The cmdlet supports a path to a zip-file or directory with the unpacked contents. @@ -38,7 +38,7 @@ Export VersionCheck - The default value is "SetTopology" + .PARAMETER Step The step number that you want to work against @@ -186,7 +186,7 @@ function Invoke-D365SDPInstall { [Parameter(Mandatory = $true, ParameterSetName = 'Manual', Position = 3 )] [ValidateSet('SetTopology', 'Generate', 'Import', 'Execute', 'RunAll', 'ReRunStep', 'SetStepComplete', 'Export', 'VersionCheck')] - [string] $Command = 'SetTopology', + [string] $Command, [Parameter(Mandatory = $false, Position = 4 )] [int] $Step, @@ -455,4 +455,4 @@ function Invoke-D365SDPInstall { Invoke-TimeSignal -End -} \ No newline at end of file +} From 5986ef27423479b659251e4808de80f44544b4d9 Mon Sep 17 00:00:00 2001 From: pavankadabala-png Date: Thu, 18 Jun 2026 11:19:58 -0400 Subject: [PATCH 4/4] Fix PSAvoidDefaultValueForMandatoryParameter in Remove-D365LcsAssetFile --- d365fo.tools/functions/remove-d365lcsassetfile.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d365fo.tools/functions/remove-d365lcsassetfile.ps1 b/d365fo.tools/functions/remove-d365lcsassetfile.ps1 index 5797aef8..eef52610 100644 --- a/d365fo.tools/functions/remove-d365lcsassetfile.ps1 +++ b/d365fo.tools/functions/remove-d365lcsassetfile.ps1 @@ -90,7 +90,7 @@ function Remove-D365LcsAssetFile { [int] $ProjectId = $Script:LcsApiProjectId, [Parameter(Mandatory = $true)] - [string] $AssetId = "", + [string] $AssetId, [Alias('Token')] [string] $BearerToken = $Script:LcsApiBearerToken, @@ -113,4 +113,4 @@ function Remove-D365LcsAssetFile { if (Test-PSFFunctionInterrupt) { return } Invoke-TimeSignal -End -} \ No newline at end of file +}