2014-04-01 12:50 AM
has anyone had any success parsing the dates returned from some DataOnTap cmdlets?
In particular, the LastOperationEnd date value returned from Get-NAVolSis which, annoyingly, returns a string value containing the Timezone info (e.g. CEST 2014) which .NET/Powerhsell doesn't handle at all well
edit: I notice some other cmdlets (get-NaSnapshot for example, return a proper datetime value). Why doesn't Get-NaSISVol do the same? This seems like a glaring inconsistency to me.
2014-04-01 05:12 AM
Interesting... you can always created a custom object and redo it if you want, but why would we do that :-)
What exactly do you need the system.datetime for in this cmdlet?
2014-04-01 05:20 AM
I'm writing a script to monitor certain things on our filers. One of the requirements is to check that the dedupe ran within the last 24 hours.
I've since found that I can use Get-NASis <volname> and that returns a DT formatted value (LastOperationEndTimestampDT). That's a proper datetime value which gives me what I want. It just seems strange that Get-NaSISVol (which, as far as I can tell does much the same thing as Get-NASis) returns a string value instead of datetime value.
2014-04-01 06:13 AM
Sure. It's a bit rough but it does the job
ForEach ($volume in $Volumes)
$ASISInfo=Get-NASIS "/vol/$Volumename" -erroraction silentlycontinue
If ($AsisInfo.LastOperationState -ne "success")
"ASIS last operation failed ($ASISError)"
If ($LastASISDate -lt (Get-Date).AddHours(-24))
"lastasisdate is bad"