As per the readme, the write-host is supposed to be redirected by default.
The problem seems to exist in this script file:
PSNLog/public/Enable-NLogLogging.ps1
if (-Not($DontRedirectMessages.IsPresent)) {
Set-MessageStreams -WriteVerbose -WriteWarning -WriteError
}
This needs to become
if (-Not($DontRedirectMessages.IsPresent)) {
Set-MessageStreams -WriteVerbose -WriteWarning -WriteError -WriteHost
}
so that the Set-MessageStreams will add the write-host alias in Set-MessageStreams.ps1
if ($WriteHost.IsPresent) {
if (-Not(Test-Path 'Alias:\Write-Host')) {
New-Alias -Name 'Write-Host' -Value 'Write-NLogHost' -Scope Global
}
}
As per the readme, the write-host is supposed to be redirected by default.
The problem seems to exist in this script file:
PSNLog/public/Enable-NLogLogging.ps1
This needs to become
so that the Set-MessageStreams will add the write-host alias in Set-MessageStreams.ps1