Change date format by output of Get-WmiObject

Hello guys,

 

is there a way to change date format by output of this script??


get-wmiobject win32_quickfixengineering |where-object {$_.Description} |select-object HotFixID, Description, InstalledOn | Format-table -auto

the output is as follows:

KB3185319 Security Update 9/14/2016 12:00:00 AM
KB3185911 Security Update 9/14/2016 12:00:00 AM
KB976902  Update          11/21/2010 12:00:00 AM
KB3185330 Security Update 10/12/2016 12:00:00 AM

I would need it in yyyy/MM/dd

Thanks

  • $HFixfmt = @{Expression={$_.HotFixID};
                            Label="HotFixID";Width=10},
                       @{Expression={$_.Description};
                            Label="Description"; Width=20},
                       @{Expression={'{0:yyyy}/{0:MM}/{0:dd} {00:hh}:{00:mm}:{00:ss} {0:tt}' -f $_.InstalledOn};
                            Label="Installed On";Width=25}


    get-wmiobject win32_quickfixengineering |
       where-object {$_.Description} |
       select-object HotFixID, Description, InstalledOn |
       Format-table -Property $HFixFmt

    HTH