Closed johlju closed 1 year ago
When the command is called using the parameter set ByServerObject the parameter InstanceName is always set to the default value because $InstanceName is not changed according to the passed ServerObject.
ByServerObject
InstanceName
$InstanceName
ServerObject
https://github.com/dsccommunity/SqlServerDsc/blob/3e81805a4f76429822b1378d345084c73236173e/source/Public/Invoke-SqlDscQuery.ps1#L187-L188
Suggest adding the following in the begin-block.
begin
if ($PSCmdlet.ParameterSetName -eq 'ByServerObject') { $InstanceName = $ServerObject.InstanceName }
When the command is called using the parameter set
ByServerObject
the parameterInstanceName
is always set to the default value because$InstanceName
is not changed according to the passedServerObject
.https://github.com/dsccommunity/SqlServerDsc/blob/3e81805a4f76429822b1378d345084c73236173e/source/Public/Invoke-SqlDscQuery.ps1#L187-L188
Suggest adding the following in the
begin
-block.