Showing results for March 2013 - Page 8 of 13 - Scripting Blog [archived]

Mar 13, 2013
Post comments count0
Post likes count0

PowerTip: Display the Value of Pi to Three Decimal Places

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to display the value of Pi to three decimal places.  How can I display the value of Pi to three decimal places by using conditional formatting to avoid rounding numbers up or down?  Use the Fixed-Point (“F”) Format Specifier, and specify the number of desired decimal places. The following t...

Scripting Guy!Windows PowerShellPowerTip
Mar 13, 2013
Post comments count0
Post likes count0

Use PowerShell and Conditional Formatting to Format Numbers

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, shows how to use Windows PowerShell and conditional formatting to format numbers.  Hey, Scripting Guy! One of the big problems I have when it comes to using Windows PowerShell is figuring out how to properly format numbers. I mean, I can easily use [int] to get rid of hundreds of decimal places, but...

Scripting Guy!Windows PowerShellscripting techniques
Mar 12, 2013
Post comments count0
Post likes count0

PowerTip: Create a Sortable Date with PowerShell

Doctor Scripto
Doctor Scripto

Summary: Use Windows PowerShell to easily create a sortable date.  How can I use Windows PowerShell to create an ISO 8601 standard sortable date time-stamp for my logging solution?  Use the Sortable Format Specifier in the ToString method from Get-Date: PS C:\> (Get-Date).ToString("s") 2013-03-12T13:39:18 ...

Scripting Guy!Windows PowerShellPowerTip
Mar 12, 2013
Post comments count0
Post likes count0

Use PowerShell to Format Strings with Composite Formatting

Doctor Scripto
Doctor Scripto

Summary: Microsoft Scripting Guy, Ed Wilson, talks about using Windows PowerShell to specify composite formatting to format strings.  Hey, Scripting Guy! Often I need to create an output string that is the result of multiple computations. In the past, I have used multiple lines to create this sort of outputs, but now I would like to simplify t...

Scripting Guy!Windows PowerShellscripting techniques
Mar 11, 2013
Post comments count0
Post likes count0

PowerTip: Display the Date in Month, Day, Year Format

Doctor Scripto
Doctor Scripto

Summary: Learn how to use Windows PowerShell to display the date in a month, day, and two-digit year format.  How can I use Windows PowerShell to display the date in a month, day, and two-digit number format with a hyphen between each of the elements?  Use the ToString method from the Get-Date cmdlet and specify a patt...

Scripting Guy!Windows PowerShellPowerTip