Open deadlydog opened 4 years ago
I hunted for the announcement link in the README (which now 404s) on the Internet Archive and found an example of how to use it:
First, install it: Install-Module PowerShellLogging
Save the following code to a file (e.g. test.ps1
):
Import-Module PowerShellLogging
$LogFile = Enable-LogFile -Path $env:temp\test.log
$VerbosePreference = 'Continue' $DebugPreference = 'Continue'
Write-Host "Write-Host test."
"Out-Default test."
Write-Verbose "Write-Verbose test."
Write-Debug "Write-Debug test."
Write-Warning "Write-Warning test."
Write-Error "Write-Error test."
Write-Host "" # To display a blank line in the file and on screen.
Write-Host "Multir
nLiner
nr
nOutput" # To display behavior when strings have embedded newlines.
$LogFile | Disable-LogFile
3. Run the sample: `.\test.ps1`
* Original: http://gallery.technet.microsoft.com/scriptcenter/Enhanced-Script-Logging-27615f85
* Archive: https://web.archive.org/web/20200325171107/http://gallery.technet.microsoft.com/scriptcenter/Enhanced-Script-Logging-27615f85
Adding some examples to the ReadMe showing how to use it (not just install it) and what that looks like would be helpful. I (and I imagine others) don't even bother trying out modules/packages when there's no docs showing how to use it. Thanks!