Skip to content

Instantly share code, notes, and snippets.

@martin9700
Created November 17, 2015 02:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save martin9700/d546f1d4a4ed9a4fb232 to your computer and use it in GitHub Desktop.
Save martin9700/d546f1d4a4ed9a4fb232 to your computer and use it in GitHub Desktop.
# $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