Skip to content

Instantly share code, notes, and snippets.

@shaneis
Last active April 24, 2018 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shaneis/f7939e87b5e0138c7472b1981793fb74 to your computer and use it in GitHub Desktop.
Save shaneis/f7939e87b5e0138c7472b1981793fb74 to your computer and use it in GitHub Desktop.
Write-Information as second stage
# 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