test/14.file-ccm.ps1
<#
This example creates a log file with the SCCM log format. #> Write-Host "EXAMPLE 14" Import-Module ..\uLog.psd1 -Force -WarningAction SilentlyContinue Remove-Variable -Name uLOG -ErrorAction SilentlyContinue Remove-Variable -Name Log -ErrorAction SilentlyContinue $local = New-uLogFile -Name local $temp = New-uLogFile -Name temp -Path c:\temp\14.file-ccm.ps1.log -Formatter ([LogFormatter]::ccmtrace) $log = New-uLog -Handler $local, $temp Log-Info -Message '14 Hello' -Exclude $evt, $temp, ($log.Handlers | ? Name -EQ Console) Log-Warning -Message '14 Watch out' -Indent 3 -NoDisplayOnTerminal Log-Warn -Message '14 Watch out' Log-Info -Message '14 Hello' Log-Success '14 YES !' Log-Error '14 Problem' Log-Critical '14 Failure' Write-Log -Message '14 Youpi' -Level SUCCESS |