whorsfall
asked on
Powershell Format-List problem
Hi,
I am running the following powershell command:
get-alert | where {$_.ResolutionState -eq 0 } | Format-List MonitoringObjectDisplayNam e,Name,Res olutionSta te,RepeatC ount,TimeR aised
Which displays the following:
MonitoringObjectDisplayNam e : SQL1
Name : The SQL Server Service Broker or Database Mirroring
transport is disabled or not configured
ResolutionState : 0
RepeatCount : 1
TimeRaised : 20/11/2007 6:41:23 PM
The problem is the TimeRaised field is no in LocalTime, it is GMT time I suspect. I want to convert it
to my local time. (In my case GMT+10) if I try the following it does not work
get-alert | where {$_.ResolutionState -eq 0 } | Format-List MonitoringObjectDisplayNam e,Name,Res olutionSta te,RepeatC ount,TimeR aised.ToLo calTime()
MonitoringObjectDisplayNam e : SQL1
Name : The SQL Server Service Broker or Database Mirroring
transport is disabled or not configured
ResolutionState : 0
RepeatCount : 1
** No TimeRaised field **
Any suggestions on the syntax to make this work?
Thanks,
Ward
I am running the following powershell command:
get-alert | where {$_.ResolutionState -eq 0 } | Format-List MonitoringObjectDisplayNam
Which displays the following:
MonitoringObjectDisplayNam
Name : The SQL Server Service Broker or Database Mirroring
transport is disabled or not configured
ResolutionState : 0
RepeatCount : 1
TimeRaised : 20/11/2007 6:41:23 PM
The problem is the TimeRaised field is no in LocalTime, it is GMT time I suspect. I want to convert it
to my local time. (In my case GMT+10) if I try the following it does not work
get-alert | where {$_.ResolutionState -eq 0 } | Format-List MonitoringObjectDisplayNam
MonitoringObjectDisplayNam
Name : The SQL Server Service Broker or Database Mirroring
transport is disabled or not configured
ResolutionState : 0
RepeatCount : 1
** No TimeRaised field **
Any suggestions on the syntax to make this work?
Thanks,
Ward
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I just saw your post on NG :)
PS> get-help format-table -full