Uh oh
$logins | Out-GridView -Title "PRTG Logins"
Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
At line:7 char:1
+ $prtgBaseDate = [datetime]::parseexact("30.12.1899 00:00:00", 'dd.MM. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : FormatException
43388.6520235648
You cannot call a method on a null-valued expression.
At line:16 char:4
+ [datetime]$lastLogin = $prtgBaseDate.AddDays($prtgUser.data.lastlo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
You cannot call a method on a null-valued expression.
At line:19 char:4
+ $logins += [pscustomobject] @{
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Add comment