An introduction and explanation for a post series on the cmdlets of PowerShell 1.0.
Repair a computer’s corrupted domain trust relationship with PowerShell, no restart required.
Learn the difference between a null, empty string, and white space value for a PowerShell variable and how to test for them.
PowerShell variables without “value”
More often than not, we create variables with the intent they will hold a value. We typically then choose to act upon that value. Therefore, if a variable doesn’t have value, this is something we would want to check against in our conditional logic flow.
Some cmdlets have a progress bar built-in. Here’s how to make your own Powershell progress bar with the Write-Progress cmdlet.
In my last post, I covered how to hide PowerShell progress bars you encounter with some built-in cmdlets. More often than not though, you probably want to keep these progress bars as they are typically there to give the script executor feedback that the script is indeed running, and how far along it is in step execution.
Microsoft has done a good job recognizing which cmdlets likely will have longer execution times (like Install-WindowsFeature), but what if you have a process that you know could take a while to complete? How can you give your user feedback that the script is actively working and to give an idea of how much work has been done, while also giving an impression of how much work is left to do?
PowerShell progress bars don’t hurt anything, but they don’t always add value. Here’s how to hide them.
Progress Bars: What are they good for?
We are a species that craves to know the current state of things, and if we can’t be told that, at least we wan’t to know SOMETHING is happening. And because of this fundamental truth, we have spinning circles, hour glasses of old, and progress bars.
My favorite progress bars are the ones that aren’t actually progress bars at all because they don’t actually tell you far how you have progressed through a process. They are more like animated gifs of a bar filling to let you know that SOMETHING is happening, much like the spinning wheel.
PowerShell progress bars are at least true progress bars; the increase in percentage and the bar itself is tied back to underlying execution logic. So if you feel compelled to watch, at least you are seeing an actual progress status.