Last active
November 18, 2018 22:01
-
-
Save darrenjrobinson/afd88b2ea1ab0fed26290aee0411f649 to your computer and use it in GitHub Desktop.
Powershell Progress Notification with psInlineProgress and Burnt Toast. Associated blog post is located here https://blog.darrenjrobinson.com/powershell-progress-notifications-that-work-in-visual-studio-code-on-window-10/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# $idnObjects is a collection of thousands of identities being processed. | |
# Progress for Burnt | |
[decimal] $progress = $i / $idnObjects.count | |
# Percentage for psInlineProgress | |
$percentComplete = $i / $idnObjects.count * 100 | |
# Round to 3 decimal places so we can update every percent of progress | |
$progressDisplay = [math]::Round($progress,3) | |
if ([math]::Floor($percentComplete) -gt $statusupdate) { | |
$statusupdate = [math]::Floor($percentComplete) | |
# display progress with psInlineProgress | |
Write-InlineProgress -Activity "Getting User Object $($obj.displayName)" -PercentComplete $percentComplete -ProgressCharacter '<' -ProgressFillCharacter '.' -ProgressFill '-' | |
# display progress with Burnt Toast | |
$ProgressBar = New-BTProgressBar -Status 'Getting User Objects' -Value $progressDisplay | |
New-BurntToastNotification –Text ‘IdentityNow Source Import’ -ProgressBar $ProgressBar -Silent –UniqueIdentifier 'Get Users' -AppLogo "C:\Users\DarrenJRobinson\Images\sailpoint.png" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment