Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke-SqlDscQuery: InstanceName always set to default value in should process messages #1918

Closed
johlju opened this issue Apr 22, 2023 · 0 comments · Fixed by #1919
Closed
Labels
bug The issue is a bug. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub

Comments

@johlju
Copy link
Member

johlju commented Apr 22, 2023

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.

$verboseDescriptionMessage = $script:localizedData.Query_Invoke_ShouldProcessVerboseDescription -f $InstanceName
$verboseWarningMessage = $script:localizedData.Query_Invoke_ShouldProcessVerboseWarning -f $InstanceName

Suggest adding the following in the begin-block.

if ($PSCmdlet.ParameterSetName -eq 'ByServerObject')
{
    $InstanceName = $ServerObject.InstanceName
}
@johlju johlju added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub labels Apr 22, 2023
johlju added a commit that referenced this issue Apr 23, 2023
- SqlServerDsc.Common
  - `Connect-SQL`.
    - Add new parameter `Encrypt`.
- `Connect-SqlDscDatabaseEngine`
  - Add new parameter `Encrypt`.
- `Invoke-SqlDscQuery`
  - Add new parameter `Encrypt`.
  - Now shows the correct instance name when called using a server object (issue #1918).
- SqlRS
  - Now uses the command `Invoke-SqlDscQuery` instead of `Invoke-SqlCmd` (issue #1917).
  - The parameter `Encrypt` has changed so that `Mandatory` or `Strict`
    will turn on encryption when connecting to the database instance.
@johlju johlju removed the help wanted The issue is up for grabs for anyone in the community. label Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant