Skip to content

Instantly share code, notes, and snippets.

View WillemRB's full-sized avatar
💻
Working

Willem WillemRB

💻
Working
  • Gasunie
  • Netherlands
View GitHub Profile
@WillemRB
WillemRB / ProcessingAnimation
Last active December 15, 2023 01:28
PowerShell function to create a processing animation for long running scriptblocks.
function ProcessingAnimation($scriptBlock) {
$cursorTop = [Console]::CursorTop
try {
[Console]::CursorVisible = $false
$counter = 0
$frames = '|', '/', '-', '\'
$jobName = Start-Job -ScriptBlock $scriptBlock