Skip to content

Instantly share code, notes, and snippets.

@torgro
Last active November 15, 2015 07:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torgro/1550a6b177935bddc391 to your computer and use it in GitHub Desktop.
Save torgro/1550a6b177935bddc391 to your computer and use it in GitHub Desktop.
function Write-Verbose
{
[cmdletbinding()]
Param(
[string]$Message
)
# Comment the next line to disable logging to file
[string]$LogFilePath = "c:\temp\customlog.txt"
if($LogFilePath)
{
Add-Content -Path "$LogFilePath" -Value "$Message$newLine"
}
Microsoft.PowerShell.Utility\Write-Verbose -Message $Message
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment