EvotecIT / PSWinDocumentation.O365HealthService

PSWinDocumentation.O365HealthService is a Powershell module that has a single goal of getting Office 365 Health Status
MIT License
23 stars 11 forks source link

Parse exception: String '10/23/2023 07:00:00' was not recognized as a valid DateTime (v1.0.4) #14

Open TyrrellStephen opened 1 year ago

TyrrellStephen commented 1 year ago

Input: $Obj = Get-Office365Health -ApplicationID "..." -ApplicationKey "..." -TenantDomain "..." -Verbose # Command 1 $Obj = Get-Office365Health -ApplicationID "..." -ApplicationKey "..." -TenantDomain "..." -ToLocalTime -Verbose # Command 2

Cmdlet result:

PS C:\Users\xyz> $?
True
PS C:\Users\xyz> $LASTEXITCODE
PS C:\Users\xyz> $LASTEXITCODE -eq $null
True

Tested: v1.0.4

Modules loaded:

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Manifest   7.0.0.0               Microsoft.PowerShell.Management     {Add-Content, Clear-Content, Clear-Item, Clear-ItemProperty…}
Manifest   7.0.0.0               Microsoft.PowerShell.Security       {ConvertFrom-SecureString, ConvertTo-SecureString, Get-Acl, Get-AuthenticodeSignature…}
Manifest   7.0.0.0               Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object…}
Manifest   7.0.0.0               Microsoft.WSMan.Management          {Connect-WSMan, Disable-WSManCredSSP, Disconnect-WSMan, Enable-WSManCredSSP…}
Script     2.2.6                 PSReadLine                          {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler…}
Script     1.0.4                 PSWinDocumentation.O365HealthServi… Get-Office365Health

Command-Output mapping: Command 1 => output1.txt Command 2 => output2.txt The ApplicationID shown in the files attached has been changed for anonymity.

PSM1 code file (renamed): PSWinDocumentation.O365HealthService.psm1.txt

Locale:

Get-WinSystemLocale | FL

Parent                         : en
LCID                           : 2057
KeyboardLayoutId               : 2057
Name                           : en-GB
IetfLanguageTag                : en-GB
DisplayName                    : English (United Kingdom)
NativeName                     : English (United Kingdom)
EnglishName                    : English (United Kingdom)
TwoLetterISOLanguageName       : en
ThreeLetterISOLanguageName     : eng
ThreeLetterWindowsLanguageName : ENG
CompareInfo                    : CompareInfo - en-GB
TextInfo                       : TextInfo - en-GB
IsNeutralCulture               : False
CultureTypes                   : SpecificCultures, InstalledWin32Cultures
NumberFormat                   : System.Globalization.NumberFormatInfo
DateTimeFormat                 : System.Globalization.DateTimeFormatInfo
Calendar                       : System.Globalization.GregorianCalendar
OptionalCalendars              : {System.Globalization.GregorianCalendar}
UseUserOverride                : True
IsReadOnly                     : False
PrzemyslawKlys commented 1 year ago

I am not sure it makes sense to try and fix it. This is all coming up because people in Microsoft fill this values manually and they just randomly enter text in it where we try to fix it.

Edit. well maybe the first one I guess is valid, but the 2nd one is just random.