Prerequisites
Steps to reproduce
Affected version: All up to 7.6.2
The test Call Get-TimeZone using Name param and singe item found here has a logic error that can cause it break: Timezones can have aliases.
Specifically, the issue is that on my Linux machine with current tzdata 2026b, that the first time zone in the list is American Samoa Standard Time. This however exists in two forms, Pacific/Midway and Pacific/Pago_Pago - display names are (UTC-11:00) American Samoa Standard Time (Midway Atoll) and (UTC-11:00) American Samoa Standard Time (Pago Pago), but their standard name is just American Samoa Standard Time for both. Therefore, the selection here can return an array instead of a single entry, breaking the test.
P.S. Yes, single is also misspelled as singe in the test here. That would need a correction as well.
Expected behavior
Actual behavior
[-] Call Get-TimeZone using Name param and singe item 396ms
Expected 'American Samoa Standard Time', but got @('American Samoa Standard Time', 'American Samoa Standard Time').
104: $observed.StandardName | Should -Be $timezoneName
at <ScriptBlock>, /home/aurutils/.cache/aurutils/sync/powershell/src/PowerShell/test/powershell/Modules/Microsoft.PowerShell.Management/TimeZone.Tests.ps1: line 104
Error details
Environment data
Name Value
---- -----
PSVersion 7.6.2
PSEdition Core
GitCommitId 7.6.2-0-g0d3c290a8737d4252ee75c052d16190ffcdb7d19
OS Arch Linux
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
Prerequisites
Steps to reproduce
Affected version: All up to 7.6.2
The test
Call Get-TimeZone using Name param and singe itemfound here has a logic error that can cause it break: Timezones can have aliases.Specifically, the issue is that on my Linux machine with current tzdata 2026b, that the first time zone in the list is
American Samoa Standard Time. This however exists in two forms,Pacific/MidwayandPacific/Pago_Pago- display names are(UTC-11:00) American Samoa Standard Time (Midway Atoll)and(UTC-11:00) American Samoa Standard Time (Pago Pago), but their standard name is justAmerican Samoa Standard Timefor both. Therefore, the selection here can return an array instead of a single entry, breaking the test.P.S. Yes,
singleis also misspelled assingein the test here. That would need a correction as well.Expected behavior
No error.Actual behavior
Error details
Environment data
Visuals
No response