Skip to content

Powershell function that displays user friendly messages as well as optionally logging it to a file.

License

Notifications You must be signed in to change notification settings

paddycull/Write-Update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Write-Update

Powershell function that displays user friendly messages as well as optionally logging it to a file. When logging to a file, it timestamps the message as well. If the -Logfile parameter is not set, it only displays the message. See the examples below for more info.

Basic Usage

Write-Update "This is a sample message" -UpdateType Normal -Logfile $Logfile

Getting the message from the pipeline

"This is a success message" | Write-Update -UpdateType Success -Logfile $Logfile

Output Examples

Success message

Write-Update "This is a success message" -UpdateType Success -Logfile $Logfile
Output

alt text

Warning message

Write-Update "This is a warning message" -UpdateType Warning -Logfile $Logfile
Output

alt text

Error message

Write-Update "This is an error message" -UpdateType Error -Logfile $Logfile
Output

alt text

Header message

Write-Update "This is a header message" -UpdateType Header -Logfile $Logfile
Output

alt text

Example log

Finally, here is what the log looks like. Note the timestamps on each non-header message.

alt text

About

Powershell function that displays user friendly messages as well as optionally logging it to a file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published