dsccommunity / SqlServerDsc

This module contains DSC resources for deployment and configuration of Microsoft SQL Server.
MIT License
360 stars 225 forks source link

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

Closed johlju closed 1 year ago

johlju commented 1 year ago

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

https://github.com/dsccommunity/SqlServerDsc/blob/3e81805a4f76429822b1378d345084c73236173e/source/DSCResources/DSC_SqlRS/DSC_SqlRS.psm1#L490-L491

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.