Skip to content

Instantly share code, notes, and snippets.

@ploegert
Created February 3, 2016 18:58
Show Gist options
  • Select an option

  • Save ploegert/1e7477793c2d0d8a2bf5 to your computer and use it in GitHub Desktop.

Select an option

Save ploegert/1e7477793c2d0d8a2bf5 to your computer and use it in GitHub Desktop.
write log for powershell
function Write-Log
{
param([Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)][AllowEmptyString()][string]$Message)
Write-Verbose -Verbose ("[{0:s}] {1}`r`n" -f (get-date), $Message)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment