Changed PublishMode from string to enum.
Added PassThru switch for Write-Log.