Behind the PowerShell Pipeline logo

Behind the PowerShell Pipeline

Subscribe
Archives
February 20, 2024

Making Progress

In a recent article, I showed a sample function to illustrate a point. Part of the function used the `Write-Progress` cmdlet. This wasn't the point of the example so I didn't make much of it. However, I think this is an under-utilized command and one you should be using more often, especially in long-running scripts or functions. In the past, many of use, myself included, have used simple `Write-Host` commands to show progress.

Write-Host "Processing file 1 of 10" -ForeGroundColor yellow
> If you use `Write-Host` this way, I encourage you to use a foreground color to distinguish it from command output. It doesn't take much to implement `Write-Progress` and I think it makes your code look more professional. Let's take a look at the `Write-Progress` cmdlet and how you can use it in your scripts and functions.

Making Progress

In a recent article, I showed a sample function to illustrate a point. Part of the function used the Write-Progress cmdlet. This wasn't the point of the example so I didn't make much of it. However, I think this is an under-utilized command and one you should be using more often, especially in long-running scripts or functions. In the past, many of use, myself included, have used simple Write-Host commands to show progress.

Write-Host "Processing file 1 of 10" -ForegroundColor yellow
Want to read the full issue?
GitHub Bluesky LinkedIn About Jeff
Powered by Buttondown, the easiest way to start and grow your newsletter.