-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation related functions cause an exception when calling "Parse" on machines with date format dd/mm/yyyy. #44
Comments
Hello! I cannot reproduce this even if I change my date/time format. createdDateTime, lastModifiedDateTime and modifiedDateTime should be stored in the "2021-08-10T04:42:10.4104838Z" format. I cannot find any object that stores it in '02/15/2022 01:50:53' format as the error states. How does it look in the detail view? Can you attach the policy that you are trying to document? Cheers! |
I was able to replicate this in a Windows Sandbox using the following:
I was able to work around the issue with ([DateTime]::Parse(([datetime]$obj.createdDateTime).ToString((get-culture)))) Hope this helps replicate the issue. Thanks |
I cannot reproduce it no matter what I do. Can you try this file |
That is with the updated psm1. I did a try/catch statement and logged if it failed to parse. I still can understand why the date/time format is completely different from what I get from Graph. Unless something has changed or is different based on where the tenant is. I found this link where it suggests that it might be a bug somewhere. In .NET? |
Can you try this and let me know what it says in the log. Just some more logging Cheers! |
Where is the tenant? In the past I've seen different issues depending on where the tenant is. We're a bit different down under ;-) |
My tenant us in Australia. I live in Sydney and I do know things are a bit different here :). I used to live in Sweden so I know regional settings can be a big issue. Date conversations has been a problem for a long time. I still can"t figure out why it returns a different date format for you. I wonder where that happens. If use the same query in Graph Explorer, what do you get then? |
Hello! Looks like this is a PowerShell 6+ issue. Try starting the script with PowerShell 5 eg add -version 5 to the command line. |
Try the new version. It uses -version 5 in the cmd files. Which should force it back to version 5 behaviour. Let me know how it goes |
Closing this. This happens when using PowerShell 6+. Cmd files will always user PowerShell 5. Cheers! |
Documentation related functions cause an exception when calling "Parse" on machines with date format dd/mm/yyyy.
or month and day are swapped if day value 12 or below
Error:
Code: Documentation.psm1
The text was updated successfully, but these errors were encountered: