I’m trying to get timezone on specific UTC using below command in PowerShell:
tzutil /l | find /I "utc-06"
But the output shows parameter format error while executing it.
PS C:\Windows\system32> tzutil /l | find /I "utc-06"
FIND: Parameter format not correct
PowerShell evaluates the content within double quotes to perform any variable expansion, sub-expressions, etc, then it discards those double quotes.
In my example, PowerShell returns from “utc-06” is literally utc-06. But FIND.EXE requires the search string enclosed with double quotes.
If you want to prevent PowerShell from stripping the double quotes use the single quote to escape them.
tzutil /l | find /I '"utc-06"'
As you can see, the error was gone.
PS C:\Windows\system32> tzutil /l | find /I '"utc-06"'
(UTC-06:00) Central America
(UTC-06:00) Central Time (US & Canada)
(UTC-06:00) Easter Island
(UTC-06:00) Guadalajara, Mexico City, Monterrey
(UTC-06:00) Saskatchewan
Alternatively, you can also use findstr or select-string instead
PS C:\Windows\system32> tzutil /l | findstr /i utc-06
(UTC-06:00) Central America
(UTC-06:00) Central Time (US & Canada)
(UTC-06:00) Easter Island
(UTC-06:00) Guadalajara, Mexico City, Monterrey
(UTC-06:00) Saskatchewan
PS C:\Windows\system32> tzutil /l | select-string utc-06
(UTC-06:00) Central America
(UTC-06:00) Central Time (US & Canada)
(UTC-06:00) Easter Island
(UTC-06:00) Guadalajara, Mexico City, Monterrey
(UTC-06:00) Saskatchewan
ADVERTISEMENT
5/5 - (1 vote)