Showing tag results for PowerTip

Mar 15, 2013
Post comments count0
Post likes count0

PowerTip: Use PowerShell to Find the Number of Seconds in Three Days

Doctor Scripto

Summary: Use Windows PowerShell to easily find the number of seconds in three days.  How can I use Windows PowerShell to find how many seconds are in three days without diving into a bunch of multiplication or division?  Use the New-TimeSpan cmdlet to create a time span of three days, and select the TotalSeconds proper...

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

PowerTip: Use UNIX Date Formatting in PowerShell

Doctor Scripto

Summary:  Learn how to use UNIX date formatting in Windows PowerShell.  How can I use my prior knowledge of UNIX date formatting to specify dates in Windows PowerShell? Use the Get-Date cmdlet and the –Uformat parameter. For example, to display a date in standard format for your current locale, use the “x&r...

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

PowerTip: Display the Value of Pi to Three Decimal Places

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 12, 2013
Post comments count0
Post likes count0

PowerTip: Create a Sortable Date with PowerShell

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 11, 2013
Post comments count0
Post likes count0

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

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