Advertisement
Guest User

Untitled

a guest
Dec 6th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. $externals = Get-ChildItem "$ModulePath\functions\"
  2. $Rules = (Get-ScriptAnalyzerRule).Where{$_.RuleName -notin ('PSAvoidUsingPlainTextForPassword') }
  3. Describe -tags ('ScriptAnalysis')'Script Analyzer Tests' {
  4. ForEach ($ScriptFile in $externals)
  5. {
  6. Context "Testing $ScriptFile for Standard Processing" {
  7. foreach ($rule in $rules)
  8. {
  9. $i = $rules.IndexOf($rule)
  10. It "$ScriptFile passes the PSScriptAnalyzer Rule number $i - $rule " {
  11. (Invoke-ScriptAnalyzer -Path "$($ScriptFile.fullname)" -IncludeRule $rule.RuleName ).Count | Should Be 0
  12. }
  13. }
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement