HotCakeX / Harden-Windows-Security

Harden Windows Safely, Securely using Official Supported Microsoft methods and proper explanation | Always up-to-date and works with the latest build of Windows | Provides tools and Guides for Personal, Enterprise, Government and Military security levels | Read The Rationale https://github.com/HotCakeX/Harden-Windows-Security/blob/main/Rationale.md
https://hotcakex.github.io
MIT License
1.84k stars 143 forks source link

[Bug]: Edit-WDACConfig: Exception: The date provided is not in a valid DateTime type. #325

Closed Kofl closed 3 months ago

Kofl commented 3 months ago

Tools category

WDACConfig Module

Does Your System Meet The Requirements?

Is your Windows Installation Genuine?

Did You Read The Frequently Asked Questions?

Please Explain The Bug

Running:

Edit-WDACConfig -AllowNewApps -SuppPolicyName 'TreeSize' -PolicyPath "C:\wdac\Base Policy Enforce Mode_2024-07-23_v10.0.3.6.xml"
Audit mode deployed, start installing/running your programs now
When you are finished, Press Enter, you will have the option to select directories to scan
Press Enter to continue...: (directory C:\Treesize selected)
Select directories to scan
Exception: The date provided is not in a valid DateTime type.

Thanks for any ideas.

Windows 11, 23H2, en-gb

Error Details

Exception             :
    Type                        : System.Management.Automation.RuntimeException
    ErrorRecord                 :
        Exception             :
            Type    : System.Management.Automation.ParentContainsErrorRecordException
            Message : The date provided is not in a valid DateTime type.
            HResult : -2146233087
        CategoryInfo          : NotSpecified: (:) [], ParentContainsErrorRecordException
        FullyQualifiedErrorId : RuntimeException
    WasThrownFromThrowStatement : True
    Message                     : The date provided is not in a valid DateTime type.
    HResult                     : -2146233087
TargetObject          : The date provided is not in a valid DateTime type.
CategoryInfo          : OperationStopped: (The date provided i…alid DateTime type.:String) [], RuntimeException
FullyQualifiedErrorId : The date provided is not in a valid DateTime type.
InvocationInfo        :
    ScriptLineNumber : 93
    OffsetInLine     : 17
    HistoryId        : 2
    ScriptName       : C:\Program Files\PowerShell\Modules\WDACConfig\0.4.3\Shared\Receive-CodeIntegrityLogs.psm1
    Line             : Throw 'The date provided is not in a valid DateTime type.'

    Statement        : Throw 'The date provided is not in a valid DateTime type.'
    PositionMessage  : At C:\Program
Files\PowerShell\Modules\WDACConfig\0.4.3\Shared\Receive-CodeIntegrityLogs.psm1:93 char:17
                       + …             Throw 'The date provided is not in a valid DateTime type. …
                       +               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    PSScriptRoot     : C:\Program Files\PowerShell\Modules\WDACConfig\0.4.3\Shared
    PSCommandPath    : C:\Program Files\PowerShell\Modules\WDACConfig\0.4.3\Shared\Receive-CodeIntegrityLogs.psm1
    CommandOrigin    : Internal
ScriptStackTrace      : at Receive-CodeIntegrityLogs<Begin>, C:\Program
Files\PowerShell\Modules\WDACConfig\0.4.3\Shared\Receive-CodeIntegrityLogs.psm1: line 93
                        at Edit-WDACConfig<Process>, C:\Program
Files\PowerShell\Modules\WDACConfig\0.4.3\Core\Edit-WDACConfig.psm1: line 352
                        at <ScriptBlock>, <No file>: line 1
has context menu
HotCakeX commented 3 months ago

Hi, thanks for reporting, it's a globalization issue, i'll fix it in the next update releasing today/tomorrow with other improvements.

HotCakeX commented 3 months ago

The issue has been fixed in WDACConfig version 0.4.4. Please run the command again, which will auto update the module to the latest version, and it will work correctly.