-
Notifications
You must be signed in to change notification settings - Fork 225
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
SqlServerDsc: Add Script Analyzer rule to help detect if resource do not load SMO #1684
SqlServerDsc: Add Script Analyzer rule to help detect if resource do not load SMO #1684
Conversation
- A new script analyzer rule to verify that `Import-SQLPSModule` is present in each *-TargetResource. If it is not needed then the analyzer rule should be overridden.
Codecov Report
@@ Coverage Diff @@
## main #1684 +/- ##
====================================
- Coverage 97% 97% -1%
====================================
Files 38 38
Lines 6261 6260 -1
====================================
- Hits 6104 6103 -1
Misses 157 157
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 49 of 49 files at r1.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @johlju)
Pull Request (PR) description
Import-SQLPSModule
orConnect-SQL
(that implicitly calls
Import-SQLPSModule
) is present in eachGet-
,Test-
,and
Set-TargetResource
function. If neither command is not needed then theanalyzer rule should be overridden (issue #1683).
in the source folder. The rules are defined by the Script Analyzer settings
file
.vscode\analyzersettings.psd1
(which also the Visual Studio CodePowerShell extension uses).
(issue #1310).
SqlServerDsc.AnalyzerRules\Measure-CommandsNeededToLoadSMO
for
Get-
,Test-
, andSet-TargetResource
functions in the resources.the configuration parameters
*FailoverCluster
was change to aforeach()
.This Pull Request (PR) fixes the following issues
Task list
file CHANGELOG.md. Entry should say what was changed and how that
affects users (if applicable), and reference the issue being resolved
(if applicable).
This change is