Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $global:mywarning
- $global:MyError
- $global:SuccessMSG
- $global:MyMSG
- function ClearMSG{.\clearmsg.ps1}
- IF ($MyMSG -NE $NULL)
- {
- function MyMSG{Write (Get-Date -format 'HH:mm:ss') $MyMSG|add-content $logfile; write-host $MyMSG -ForegroundColor Cyan}
- $x=MyMSG
- clear-variable -name MyMSG
- ClearMSG
- }
- IF ($MyError -NE $NULL)
- {
- function MyError{Write (Get-Date -format 'HH:mm:ss') $MyError|add-content $logfile; write-host $MyError -ForegroundColor Red}
- $x=MyError
- clear-variable -name MyError
- ClearMSG
- }
- IF ($SuccessMSG -NE $NULL)
- {
- function SuccessMSG{Write (Get-Date -format 'HH:mm:ss') $SuccessMSG|add-content $logfile; write-host $SuccessMSG -ForegroundColor Green}
- $x=SuccessMSG
- clear-variable -name SuccessMSG
- ClearMSG
- }
- IF ($MyWarning -NE $NULL)
- {
- function MyWarning{Write (Get-Date -format 'HH:mm:ss') $MyWarning|add-content $logfile; write-host $MyWarning -ForegroundColor Yellow}
- $x=MyWarning
- clear-variable -name MyWarning
- ClearMSG
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement