Created
November 17, 2015 02:01
-
-
Save martin9700/d546f1d4a4ed9a4fb232 to your computer and use it in GitHub Desktop.
This file contains 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
# $Message was the variable where I stored the message information | |
ForEach ($Warning in ($Message | Where Number -eq 0)) | |
{ | |
If ($PrintToStdOut) | |
{ | |
Write-Output $Warning.Message | |
} | |
Else | |
{ | |
Write-Verbose $Warning.Message -Verbose | |
} | |
} | |
$Errors = @($Message | Where Number -ne 0) | |
If ($Errors.Count) | |
{ | |
ForEach ($MsgError in $Errors) | |
{ | |
Write-Error "Query Error $($MsgError.Number), Line $($MsgError.Line): $($MsgError.Message)" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment