Skip to content

Problem with language formatting #13

@mrbmf1

Description

@mrbmf1

Have a problem with the code line 39 ( Timestamp = [System.DateTime]$(Get-Date).DateTime)
I am guessing there is a issue with language mismatch on language formatting (nb-no).
Not a coder, so not sure how to get around it. Any pointers?

Error in ninja:

Action completed: Run Data Gathering Result: SUCCESS Output: Action: Run Data Gathering, Result: Success
Cannot convert value "torsdag 19. desember 2024 14:19:31" to type "System.DateTime". Error: "The string was not recogni
zed as a valid DateTime. There is an unknown word starting at index 0."
At C:\ProgramData\NinjaRMMAgent\scripting\customscript_gen_1734614367995_2.ps1:39 char:40
+         Timestamp = [System.DateTime]$(Get-Date).DateTime
+                                        ~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvalidCastParseTargetInvocationWithFormatProvider
 
Data Gathering Complete

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions