Below is the singe line command I am trying to run from command prompt.
powershell -command "Get-Date (Get-WmiObject -Class win32_reliabilityRecords -filter \"sourcename = 'Microsoft-Windows-WindowsUpdateClient'\" -ErrorAction SilentlyContinue | select @{LABEL = 'date';EXPRESSION = {$_.ConvertToDateTime($_.timegenerated)}} | select -first 01).date -format yyyyMMdd | Out-File -FilePath C:\temp\winupdatelatest.txt"
Error : Get-Date : Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"." At line:1 char:10
- Get-Date (Get-WmiObject -Class win32_reliabilityRecords -filter "sour ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : WriteError: (:) [Get-Date], ParameterBindingException
- FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.GetDateCommand
Thank for your help