Skip to content

Instantly share code, notes, and snippets.

@patelneel55
Last active December 7, 2019 09:52
Show Gist options
  • Save patelneel55/0f2a9ddd7bf8de9dfa099a5c5f94dbf3 to your computer and use it in GitHub Desktop.
Save patelneel55/0f2a9ddd7bf8de9dfa099a5c5f94dbf3 to your computer and use it in GitHub Desktop.
Simple PowerShell spinner
function spinner([string]$input_text = 'Press any key to continue... ')
{
$spin="/-\|"
Write-Host "$input_text" -nonewline
$i=0
while($true)
{
Write-Host "`b$($spin.Substring($i++%$spin.Length)[0])" -nonewline
bash -c "read -n 1 -t 0.25 $noop"
if($LastExitCode -eq 0){
break
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment