Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected override void ProcessRecord()
// make sure we've got the latest time zone settings
TimeZoneInfo.ClearCachedData();

if (this.ParameterSetName.Equals("ListAvailable", StringComparison.OrdinalIgnoreCase))
if (ListAvailable)
{
// output the list of all available time zones
WriteObject(TimeZoneInfo.GetSystemTimeZones(), true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ Describe "Get-Timezone test cases" -Tags "CI" {
$oneExpectedOffset | Should -BeIn $observedIdList
}

It "Call with -ListAvailable:`$false returns current TimeZoneInfo (not list)" {
$result = Get-TimeZone -ListAvailable:$false
$result | Should -BeOfType TimeZoneInfo
$result.Id | Should -Be ([System.TimeZoneInfo]::Local).Id
}

It "Call Get-TimeZone using ID param and single item" {
$selectedTZ = $TimeZonesAvailable[0]
(Get-TimeZone -Id $selectedTZ.Id).Id | Should -Be $selectedTZ.Id
Expand Down
Loading