- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Lucd for your reply.
$lastLine.LastLine is giving the last entry of the vmkernel log like below:
2023-05-15T04:47:37.814Z cpu40:16672)WARNING: LinScsi: SCSILinuxAbortCommands:1816:Failed, Driver hpsa, for vmhba0
I have tried as you advised but getting the following error:
Cannot convert value "" to type "System.DateTime". Error: "String was not recognized as a valid DateTime."
At D:\PNF-Morning-Checks\VSAN-MorningCheck-Daily.ps1:761 char:6
+ ... $lastDateTime = [DateTime]($lastLine.LastLine.Split(' ')[ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvalidCastParseTargetInvocationWithFormatProvider