Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Nov 20, 2021

  • Removed Write-DEBUG..... why?
  • Added exception error management
  • Removed 'LogName' argument: repetitive
  • TimeStamp at the beginning and changed Timestamp format
  • Added LogState (Stopped/Started). LogPath argument now optional when caling Write-*
  • Remove mandatory order in arguments for flags
  • ToScreen: Remove 'ToScreen' argument: using 'Verbose' only
    CORRECT PIPING
  • ToScreen: The Output to screen uses Write-Warning / Write-Error instead of Write-Output
  • Added Aliases [Alias('f','file')] for LogPath and [Alias('t','time')] for timestamp

Start-Log -f 'C:\Temp\TestScript.log' -ScriptVersion '1.0'
Write-LogInfo 'This'
Write-LogWarning 'Is' -t -Verbose
Write-LogError 'less argument' -time
Write-LogInfo 'repetition'
Stop-Log

Send last session

Send-Log 'smtp.google.com' 'me' 'you' 'logs'
Send-Log 'smtp.google.com' 'me' 'you' 'more logs' 'c:\OtherLogs.txt'

 - Removed Write-DEBUG..... why?
 - Added exception error management
 - Removed 'LogName' argument: repetitive
 - TimeStamp at the beginning and changed Timestamp format
 - Added LogState (Stopped/Started). LogPath argument now optional when caling Write-*
 - Remove mandatory order in arguments for flags
 - ToScreen:  Remove 'ToScreen' argument: using 'Verbose' only
 CORRECT PIPING
 - ToScreen:  The Output to screen uses Write-Warning / Write-Error instead of Write-Output
 - Added Aliases [Alias('f','file')] for LogPath and [Alias('t','time')] for timestamp

 Start-Log -f 'C:\Temp\TestScript.log' -ScriptVersion '1.0'
 Write-LogInfo 'This'
 Write-LogWarning 'Is' -t -Verbose
 Write-LogError 'less argument' -time
 Write-LogInfo 'repetition'
 Stop-Log
 # Send last session
 Send-Log 'smtp.google.com' 'me' 'you' 'logs'
 Send-Log 'smtp.google.com' 'me' 'you' 'more logs' 'c:\OtherLogs.txt'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants