Think PowerShell

PowerShell for IT Pros

  • About
    • Who I Am
    • Why I Blog
    • Privacy Policy
  • Resources
    • More PowerShell Sites
    • Post Series Index
  • Get Help

Hide PowerShell Progress Bars

October 18, 2017 by Aaron Rothstein Leave a Comment

PowerShell progress bar in action.

PowerShell progress bar in action.

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.

[Read more…]

Filed Under: General Tagged With: Beginner, Preference

PowerShell Splatting: What is it, Why Use It

October 17, 2017 by Aaron Rothstein 4 Comments

Splatting with a hash table.

Splatting with a hash table.

Make your PowerShell scripts easier to read with splatting.

No one likes horizontal scrolling

The format of PowerShell cmdlets make them universally easy to use. Enter the cmdlet name, then enter the various parameter switches and values for those parameters. For a lot of commands, everything can fit cleanly on one line and within either the standard 80 character width of a standard prompt or the full screen width of your favorite editor.

However, there are going to be times you want to specify a LOT of parameters, and some of those parameter values may be lengthy in nature. The last thing you want to do though is have to start scrolling sideways or trying to wrap your “one-liner” to read it.

[Read more…]

Filed Under: General Tagged With: Beginner, Script

Use Measure-Command to Test Script Performance

December 5, 2016 by Aaron Rothstein Leave a Comment

Use Measure-Command to time execution.

Using Measure-Command to measure cmdlet execution time.

Throw away your timestamp calculation snippets for testing script performance in favor of the native PowerShell cmdlet Measure-Command.

[Read more…]

Filed Under: General Tagged With: Beginner, Debugging

Get All PowerShell Object Properties

November 28, 2016 by Aaron Rothstein Leave a Comment

Use Get-Member to see object property definitions.

Use Get-Member to see object property definitions.

Learn how to discover allĀ of a PowerShell object’s properties and see their values.

[Read more…]

Filed Under: General Tagged With: Beginner

Use Get-ComputerInfo to Replace msinfo32

October 26, 2016 by Aaron Rothstein 4 Comments

Get-ComputerInfo in progress...

Get-ComputerInfo in progress…

The fifth post in my PowerShell Beginner series, “Daily Tasks, The PowerShell Way“. Use PowerShell’s Get-ComputerInfo to get the same information as you would from the msinfo32 System Summary. Replace multiple WMI queries with one cmdlet.

[Read more…]

Filed Under: General Tagged With: Beginner, Inventory

  • « Previous Page
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next Page »

Aaron

Follow

Get the Newsletter

Copyright © 2018 - Think PowerShell