You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
226 B
PowerShell

function CountNseconds {
param (
$Time = 3,
$Msg = 'Exiting in'
)
$Time..0 | ForEach-Object {Start-Sleep -Seconds 1 ; "$Msg $_ seconds..."}
}
# Demo: CountNseconds -Time 5 -Msg 'This is closing in'