Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

ToShortTimeString() vs .Converttodatetime( )

$
0
0

Hi All

I am doing a wmi query (Get-WmiObject -Class Win32_OperatingSystem) and im looking to format the LastBootUpTime

Select-Object CSName,@{ Name = "Last Restarted On" ; Expression = { $_.Converttodatetime( $_.LastBootUpTime ) } }

I am currently using the Converttodatetime( ) method, is there any way to use the ToShortTimeString() , im not opposed to builidng a hash table with that method either . im looking for just the Time no seconds .eg 11:00

thank you


Viewing all articles
Browse latest Browse all 13067

Trending Articles