Created
April 14, 2021 10:16
-
-
Save kilasuit/16e33d9e893c2b312bcba10d48a64c6e to your computer and use it in GitHub Desktop.
Pester Test for script error checking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| It "Is valid Powershell (Has no script errors)" { | |
| $contents = Get-Content -Path $module.FullName -ErrorAction Stop | |
| $errors = $null | |
| $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) | |
| $errors.Count | Should Be 0 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment