Scripting Blog

A place to learn about PowerShell and share stories of automation

Formatting PowerShell Decimal Places

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using strings to format the display of decimal places in Windows PowerShell.  Hey, Scripting Guy! One of the things I have a problem with is when I get numbers that have a lot of decimal places. I mean, how do I really get rid of them—at least properly? I have done things like...

Working with Fixed Number Sizes in PowerShell

Summary: Microsoft Scripting Guy, Ed Wilson, talks about working with fixed number sizes in Windows PowerShell.  Hey, Scripting Guy! I have a script that returns a specific type of number, so I added a type constraint on the variable that holds the number. The problem is that sometimes when I run the script, I get errors. I cannot figure ...

Understanding Numbers in PowerShell

Summary: Microsoft Scripting Guy, Ed Wilson, talks about numbers in Windows PowerShell.  Hey, Scripting Guy! One of the things that is frustrating to me with Windows PowerShell is the way that it handles numbers. For example, I want to know the percent of processor utilization for something, and it displays a number that is like fifty ...

Feedback usabilla icon