Write-Information as second stage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# So we can "see" the Write-Information | |
$OldInformationPreference = $InformationPreference | |
$InformationPreference = "Continue" | |
Write-Information "Date: $(Get-Date)" | |
Write-Information "ScriptBlock: Write-Information" | |
Write-Information "DateDescription: $(if ((Get-Date).Second -lt 15) { | |
'1st Quarter' | |
} elseif ((Get-Date).Second -lt 30) { | |
'2nd Quarter' | |
} elseif ((Get-Date).Second -lt 45) { | |
'3rd Quarter' | |
} else { | |
'4th Quarter' | |
})" | |
#Reset back | |
$InformationPreference = $OldInformationPreference |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment