Summary: Use Windows PowerShell to display a percentage as a two place number.
How can I use Windows PowerShell to display a number as a percentage that has two decimal places?
Use the -f format specifier, and specify a pattern as “{0:p2}”. On the other side of the -f format specifier, perform your percentage calculation. Here is an ...
Summary: Use Windows PowerShell to multiply the value stored in a variable and store the results. How can I use Windows PowerShell to multiply the value of a variable and store the results in the same variable? Use the *= operator, for example:PS C:> $a = 2PS C:> $a *= 3PS C:> $a6...
Summary: Use Windows PowerShell to select two random numbers from twenty possible numbers.
How can I use Windows PowerShell to select two of twenty attendees at user group to receive prizes?
Create a range of input numbers with the Get-Random cmdlet, then use the –Count parameter to retrieve &...
Summary: Use Windows PowerShell to split arrays of numbers into contiguous ranges.
Microsoft Scripting Guy, Ed Wilson, is here. Today I have a cool post from guest blogger, Zachary Loeber. Here is a little bit about Zachary:
Zachary Loeber is a solution architect with PSC Group. Zachary is a seasoned network and systems architect and an ...
Summary: Use Windows PowerShell to round numbers to a specific decimal place.
How can I use Windows PowerShell to round a number to a specific number of decimal places, and continue to have a number instead of converting it to a string.
Use the Round static method from the System.Math class...