Skip to content

Instantly share code, notes, and snippets.

View regg00's full-sized avatar

Régis Tremblay Lefrançois regg00

View GitHub Profile
@yoav-lavi
yoav-lavi / Load.ps1
Created April 30, 2018 08:38
A spinner for PowerShell
function Load {
param([scriptblock]$function,
[string]$Label)
$job = Start-Job -ScriptBlock $function
$symbols = @("⣾⣿", "⣽⣿", "⣻⣿", "⢿⣿", "⡿⣿", "⣟⣿", "⣯⣿", "⣷⣿",
"⣿⣾", "⣿⣽", "⣿⣻", "⣿⢿", "⣿⡿", "⣿⣟", "⣿⣯", "⣿⣷")
$i = 0;
while ($job.State -eq "Running") {
$symbol = $symbols[$i]