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

SqlRs: Replace Invoke-SqlCmd with Invoke-SqlDscQuery #1917

Closed
johlju opened this issue Apr 22, 2023 · 0 comments · Fixed by #1919
Closed

SqlRs: Replace Invoke-SqlCmd with Invoke-SqlDscQuery #1917

johlju opened this issue Apr 22, 2023 · 0 comments · Fixed by #1919
Labels
enhancement The issue is an enhancement request. 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

We should replace the command Invoke-SqlCmd in the resource SqlRS.

Invoke-SqlCmd @invokeSqlCmdParameters -Query $reportingServicesDatabaseScript.Script
Invoke-SqlCmd @invokeSqlCmdParameters -Query $reportingServicesDatabaseRightsScript.Script

Instead we should use the command Invoke-SqlDscQuery. Using the command Invoke-SqlDscQuery will help the resource not being dependent on SqlServer module, and only require the SMO assemblies to be available.

@johlju johlju changed the title SqlRs: Replace Invoke-SqlCmd with Invoke-SqlDscScript SqlRs: Replace Invoke-SqlCmd with Invoke-SqlDscQuery Apr 22, 2023
@johlju johlju added needs review The pull request needs a code review. enhancement The issue is an enhancement request. 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 and removed needs review The pull request needs a code review. 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
enhancement The issue is an enhancement request. 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