Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $externals = Get-ChildItem "$ModulePath\functions\"
- $Rules = (Get-ScriptAnalyzerRule).Where{$_.RuleName -notin ('PSAvoidUsingPlainTextForPassword') }
- Describe -tags ('ScriptAnalysis')'Script Analyzer Tests' {
- ForEach ($ScriptFile in $externals)
- {
- Context "Testing $ScriptFile for Standard Processing" {
- foreach ($rule in $rules)
- {
- $i = $rules.IndexOf($rule)
- It "$ScriptFile passes the PSScriptAnalyzer Rule number $i - $rule " {
- (Invoke-ScriptAnalyzer -Path "$($ScriptFile.fullname)" -IncludeRule $rule.RuleName ).Count | Should Be 0
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement