Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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