AshleyHow / WindowsOSBuild

Windows patch release information (Version, Build, Availability date, Hotpatch, Preview, Out-of-band, Servicing option, KB article, KB URL and Catalog URL) for Windows client and server versions. Useful for scripting and automation purposes. Supports Windows 10 and Windows Server 2016 onwards. Supports Hotpatch on Windows Server 2022 Azure Edition.
MIT License
50 stars 15 forks source link

Querying for Windows Server 2022 throws a lot of errors + the result #16

Closed xenadmin closed 2 years ago

xenadmin commented 2 years ago
PS U:\> Get-LatestOSBuild -OSVersion 21H2 -OSName Server2022 -ExcludePreview -ExcludeOutOfBand
Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:161 char:21
+ ...             $ConvertToDate = [Datetime]::ParseExact($GetDate, 'MMMM d ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FormatException

Get-Date : Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:163 char:40
+                 $FormatDate =  Get-Date($ConvertToDate) -Format 'yyyy ...
+                                        ~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Get-Date], ParameterBindingException
    + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.GetDateCommand

Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:161 char:21
+ ...             $ConvertToDate = [Datetime]::ParseExact($GetDate, 'MMMM d ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FormatException

Get-Date : Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:163 char:40
+                 $FormatDate =  Get-Date($ConvertToDate) -Format 'yyyy ...
+                                        ~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Get-Date], ParameterBindingException
    + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.GetDateCommand

Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:161 char:21
+ ...             $ConvertToDate = [Datetime]::ParseExact($GetDate, 'MMMM d ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FormatException

Get-Date : Cannot bind parameter 'Date' to the target. Exception setting "Date": "Cannot convert null to type "System.DateTime"."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:163 char:40
+                 $FormatDate =  Get-Date($ConvertToDate) -Format 'yyyy ...
+                                        ~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Get-Date], ParameterBindingException
    + FullyQualifiedErrorId : ParameterBindingFailed,Microsoft.PowerShell.Commands.GetDateCommand

Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:161 char:21
+ ...             $ConvertToDate = [Datetime]::ParseExact($GetDate, 'MMMM d ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FormatException

Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:161 char:21
+ ...             $ConvertToDate = [Datetime]::ParseExact($GetDate, 'MMMM d ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FormatException

Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:161 char:21
+ ...             $ConvertToDate = [Datetime]::ParseExact($GetDate, 'MMMM d ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FormatException

Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:161 char:21
+ ...             $ConvertToDate = [Datetime]::ParseExact($GetDate, 'MMMM d ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FormatException

Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:161 char:21
+ ...             $ConvertToDate = [Datetime]::ParseExact($GetDate, 'MMMM d ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FormatException

Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:161 char:21
+ ...             $ConvertToDate = [Datetime]::ParseExact($GetDate, 'MMMM d ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FormatException

Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:161 char:21
+ ...             $ConvertToDate = [Datetime]::ParseExact($GetDate, 'MMMM d ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FormatException

Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:161 char:21
+ ...             $ConvertToDate = [Datetime]::ParseExact($GetDate, 'MMMM d ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FormatException

Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:161 char:21
+ ...             $ConvertToDate = [Datetime]::ParseExact($GetDate, 'MMMM d ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FormatException

Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:161 char:21
+ ...             $ConvertToDate = [Datetime]::ParseExact($GetDate, 'MMMM d ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FormatException

Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
At C:\Program Files\WindowsPowerShell\Modules\WindowsOSBuild\2202.1\WindowsOSBuild.psm1:161 char:21
+ ...             $ConvertToDate = [Datetime]::ParseExact($GetDate, 'MMMM d ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : FormatException

Version           : Version 21H2 (OS build 20348)
Build             : 20348.707
Availability date : 
Preview           : False
Out-of-band       : False
Servicing option  : LTSC
KB article        : KB5013944
KB URL            : https://support.microsoft.com/en-us/help/5013944
Catalog URL       : https://www.catalog.update.microsoft.com/Search.aspx?q=KB5013944

PS U:\> 
AshleyHow commented 2 years ago

Thank you for reporting - this appears to be due to running in a different culture. This should now be fixed in v2206.1. Please update to this version.