Skip to content

Instantly share code, notes, and snippets.

@deangrant
Created October 3, 2015 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deangrant/9818c2ef6eec999fc680 to your computer and use it in GitHub Desktop.
Save deangrant/9818c2ef6eec999fc680 to your computer and use it in GitHub Desktop.
Switch condition snippet from Write-Log function
Switch ($Level)
{
'Info' {$Event = ("" + (Get-Date -Format s) + ": INFORMATION: " + $Message + ".")}
'Warning' {$Event = ("" + (Get-Date -Format s) + ": WARNING: " + $Message + ".")}
'Error' {$Event = ("" + (Get-Date -Format s) + ": ERROR: " + $Message + ".")}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment