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 November 15, 2024 11:14
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