Skip to content

Commit 27732ce

Browse files
sdwheelerDCtheGeek
authored andcommitted
Fixes #4803 - explain diff between Id and Name (#4806)
1 parent 1d1ef5d commit 27732ce

File tree

3 files changed

+120
-40
lines changed

3 files changed

+120
-40
lines changed

reference/5.1/Microsoft.PowerShell.Management/Set-TimeZone.md

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
33
keywords: powershell,cmdlet
44
locale: en-us
55
Module Name: Microsoft.PowerShell.Management
6-
ms.date: 06/09/2017
6+
ms.date: 09/18/2019
77
online version: https://go.microsoft.com/fwlink/?linkid=822279
88
schema: 2.0.0
99
title: Set-TimeZone
1010
---
11-
1211
# Set-TimeZone
1312

1413
## SYNOPSIS
@@ -17,36 +16,64 @@ Sets the system time zone to a specified time zone.
1716
## SYNTAX
1817

1918
### Name (Default)
19+
2020
```
2121
Set-TimeZone [-Name] <String> [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
2222
```
2323

2424
### Id
25+
2526
```
2627
Set-TimeZone -Id <String> [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
2728
```
2829

2930
### InputObject
31+
3032
```
3133
Set-TimeZone [-InputObject] <TimeZoneInfo> [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
3234
```
3335

3436
## DESCRIPTION
35-
The **Set-TimeZone** cmdlet sets the system time zone to a specified time zone.
37+
38+
The `Set-TimeZone` cmdlet sets the system time zone to a specified time zone.
3639

3740
## EXAMPLES
3841

39-
### Example 1: Set the time zone on the computer
42+
### Example 1: Set the time zone by Id
43+
44+
This example sets the time zone on the local computer to Russian Standard Time.
45+
46+
```powershell
47+
Set-TimeZone -Id "Russian Standard Time" -PassThru
4048
```
41-
PS C:\> Set-TimeZone -Name "Pacific Standard Time"
49+
50+
```Output
51+
Id : Russian Standard Time
52+
DisplayName : (UTC+03:00) Moscow, St. Petersburg
53+
StandardName : Russia TZ 2 Standard Time
54+
DaylightName : Russia TZ 2 Daylight Time
55+
BaseUtcOffset : 03:00:00
56+
SupportsDaylightSavingTime : True
57+
```
58+
59+
### Example 2: Set the time zone by name
60+
61+
This example sets the time zone on the local computer to Russian Standard Time.
62+
63+
```powershell
64+
Set-TimeZone -Name "Russia TZ 2 Standard Time"
4265
```
4366

44-
This command sets the time zone on the local computer to Pacific Standard Time.
67+
As we saw in the previous example, the **Id** and the **Name** of the Time Zone do not always match.
68+
The **Name** parameter must match the **StandardName** or **DaylightName** properties of the
69+
**TimeZoneInfo** object.
4570

4671
## PARAMETERS
4772

4873
### -Id
49-
Specifies the ID of the time zone that this cmdlet sets.
74+
75+
Specifies the ID of the time zone that this cmdlet sets. A full list of Time Zone IDs can be
76+
obtained by running the following command: `Get-TimeZone -ListAvailable`.
5077

5178
```yaml
5279
Type: String
@@ -61,6 +88,7 @@ Accept wildcard characters: False
6188
```
6289
6390
### -InputObject
91+
6492
Specifies a **TimeZoneInfo** object to use as input.
6593
6694
```yaml
@@ -76,7 +104,9 @@ Accept wildcard characters: False
76104
```
77105
78106
### -Name
79-
Specifies the name of the time zone that this cmdlet sets.
107+
108+
Specifies the name of the time zone that this cmdlet sets. A full list of Time Zone names can be
109+
obtained by running the following command: `Get-TimeZone -ListAvailable`.
80110

81111
```yaml
82112
Type: String
@@ -91,8 +121,9 @@ Accept wildcard characters: False
91121
```
92122

93123
### -PassThru
94-
Returns an object representing the item with which you are working.
95-
By default, this cmdlet does not generate any output.
124+
125+
Returns an object representing the item with which you are working. By default, this cmdlet does not
126+
generate any output.
96127

97128
```yaml
98129
Type: SwitchParameter
@@ -107,6 +138,7 @@ Accept wildcard characters: False
107138
```
108139

109140
### -Confirm
141+
110142
Prompts you for confirmation before running the cmdlet.
111143

112144
```yaml
@@ -122,8 +154,8 @@ Accept wildcard characters: False
122154
```
123155

124156
### -WhatIf
125-
Shows what would happen if the cmdlet runs.
126-
The cmdlet is not run.
157+
158+
Shows what would happen if the cmdlet runs. The cmdlet is not run.
127159

128160
```yaml
129161
Type: SwitchParameter
@@ -138,7 +170,10 @@ Accept wildcard characters: False
138170
```
139171

140172
### CommonParameters
141-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
173+
174+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
175+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
176+
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
142177

143178
## INPUTS
144179

@@ -152,4 +187,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
152187

153188
[Get-TimeZone](Get-TimeZone.md)
154189

155-

reference/6/Microsoft.PowerShell.Management/Set-TimeZone.md

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
33
keywords: powershell,cmdlet
44
locale: en-us
55
Module Name: Microsoft.PowerShell.Management
6-
ms.date: 06/09/2017
6+
ms.date: 09/18/2019
77
online version: https://go.microsoft.com/fwlink/?linkid=2096821
88
schema: 2.0.0
99
title: Set-TimeZone
@@ -35,23 +35,45 @@ Set-TimeZone [-InputObject] <TimeZoneInfo> [-PassThru] [-WhatIf] [-Confirm] [<Co
3535

3636
## DESCRIPTION
3737

38-
The **Set-TimeZone** cmdlet sets the system time zone to a specified time zone.
38+
The `Set-TimeZone` cmdlet sets the system time zone to a specified time zone.
3939

4040
## EXAMPLES
4141

42-
### Example 1: Set the time zone on the computer
42+
### Example 1: Set the time zone by Id
4343

44+
This example sets the time zone on the local computer to Russian Standard Time.
45+
46+
```powershell
47+
Set-TimeZone -Id "Russian Standard Time" -PassThru
4448
```
45-
PS C:\> Set-TimeZone -Name "Pacific Standard Time"
49+
50+
```Output
51+
Id : Russian Standard Time
52+
DisplayName : (UTC+03:00) Moscow, St. Petersburg
53+
StandardName : Russia TZ 2 Standard Time
54+
DaylightName : Russia TZ 2 Daylight Time
55+
BaseUtcOffset : 03:00:00
56+
SupportsDaylightSavingTime : True
4657
```
4758

48-
This command sets the time zone on the local computer to Pacific Standard Time.
59+
### Example 2: Set the time zone by name
60+
61+
This example sets the time zone on the local computer to Russian Standard Time.
62+
63+
```powershell
64+
Set-TimeZone -Name "Russia TZ 2 Standard Time"
65+
```
66+
67+
As we saw in the previous example, the **Id** and the **Name** of the Time Zone do not always match.
68+
The **Name** parameter must match the **StandardName** or **DaylightName** properties of the
69+
**TimeZoneInfo** object.
4970

5071
## PARAMETERS
5172

5273
### -Id
5374

54-
Specifies the ID of the time zone that this cmdlet sets.
75+
Specifies the ID of the time zone that this cmdlet sets. A full list of Time Zone IDs can be
76+
obtained by running the following command: `Get-TimeZone -ListAvailable`.
5577

5678
```yaml
5779
Type: String
@@ -83,7 +105,8 @@ Accept wildcard characters: False
83105
84106
### -Name
85107
86-
Specifies the name of the time zone that this cmdlet sets.
108+
Specifies the name of the time zone that this cmdlet sets. A full list of Time Zone names can be
109+
obtained by running the following command: `Get-TimeZone -ListAvailable`.
87110

88111
```yaml
89112
Type: String
@@ -99,8 +122,8 @@ Accept wildcard characters: False
99122

100123
### -PassThru
101124

102-
Returns an object representing the item with which you are working.
103-
By default, this cmdlet does not generate any output.
125+
Returns an object representing the item with which you are working. By default, this cmdlet does not
126+
generate any output.
104127

105128
```yaml
106129
Type: SwitchParameter
@@ -132,8 +155,7 @@ Accept wildcard characters: False
132155

133156
### -WhatIf
134157

135-
Shows what would happen if the cmdlet runs.
136-
The cmdlet is not run.
158+
Shows what would happen if the cmdlet runs. The cmdlet is not run.
137159

138160
```yaml
139161
Type: SwitchParameter
@@ -149,7 +171,9 @@ Accept wildcard characters: False
149171

150172
### CommonParameters
151173

152-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
174+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
175+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
176+
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
153177

154178
## INPUTS
155179

@@ -163,4 +187,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
163187

164188
[Get-TimeZone](Get-TimeZone.md)
165189

166-

reference/7/Microsoft.PowerShell.Management/Set-TimeZone.md

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ external help file: Microsoft.PowerShell.Commands.Management.dll-Help.xml
33
keywords: powershell,cmdlet
44
locale: en-us
55
Module Name: Microsoft.PowerShell.Management
6-
ms.date: 06/09/2017
6+
ms.date: 09/18/2019
77
online version: https://go.microsoft.com/fwlink/?linkid=2097056
88
schema: 2.0.0
99
title: Set-TimeZone
@@ -35,23 +35,45 @@ Set-TimeZone [-InputObject] <TimeZoneInfo> [-PassThru] [-WhatIf] [-Confirm] [<Co
3535

3636
## DESCRIPTION
3737

38-
The **Set-TimeZone** cmdlet sets the system time zone to a specified time zone.
38+
The `Set-TimeZone` cmdlet sets the system time zone to a specified time zone.
3939

4040
## EXAMPLES
4141

42-
### Example 1: Set the time zone on the computer
42+
### Example 1: Set the time zone by Id
4343

44+
This example sets the time zone on the local computer to Russian Standard Time.
45+
46+
```powershell
47+
Set-TimeZone -Id "Russian Standard Time" -PassThru
4448
```
45-
PS C:\> Set-TimeZone -Name "Pacific Standard Time"
49+
50+
```Output
51+
Id : Russian Standard Time
52+
DisplayName : (UTC+03:00) Moscow, St. Petersburg
53+
StandardName : Russia TZ 2 Standard Time
54+
DaylightName : Russia TZ 2 Daylight Time
55+
BaseUtcOffset : 03:00:00
56+
SupportsDaylightSavingTime : True
4657
```
4758

48-
This command sets the time zone on the local computer to Pacific Standard Time.
59+
### Example 2: Set the time zone by name
60+
61+
This example sets the time zone on the local computer to Russian Standard Time.
62+
63+
```powershell
64+
Set-TimeZone -Name "Russia TZ 2 Standard Time"
65+
```
66+
67+
As we saw in the previous example, the **Id** and the **Name** of the Time Zone do not always match.
68+
The **Name** parameter must match the **StandardName** or **DaylightName** properties of the
69+
**TimeZoneInfo** object.
4970

5071
## PARAMETERS
5172

5273
### -Id
5374

54-
Specifies the ID of the time zone that this cmdlet sets.
75+
Specifies the ID of the time zone that this cmdlet sets. A full list of Time Zone IDs can be
76+
obtained by running the following command: `Get-TimeZone -ListAvailable`.
5577

5678
```yaml
5779
Type: String
@@ -83,7 +105,8 @@ Accept wildcard characters: False
83105
84106
### -Name
85107
86-
Specifies the name of the time zone that this cmdlet sets.
108+
Specifies the name of the time zone that this cmdlet sets. A full list of Time Zone names can be
109+
obtained by running the following command: `Get-TimeZone -ListAvailable`.
87110

88111
```yaml
89112
Type: String
@@ -99,8 +122,8 @@ Accept wildcard characters: False
99122

100123
### -PassThru
101124

102-
Returns an object representing the item with which you are working.
103-
By default, this cmdlet does not generate any output.
125+
Returns an object representing the item with which you are working. By default, this cmdlet does not
126+
generate any output.
104127

105128
```yaml
106129
Type: SwitchParameter
@@ -132,8 +155,7 @@ Accept wildcard characters: False
132155

133156
### -WhatIf
134157

135-
Shows what would happen if the cmdlet runs.
136-
The cmdlet is not run.
158+
Shows what would happen if the cmdlet runs. The cmdlet is not run.
137159

138160
```yaml
139161
Type: SwitchParameter
@@ -149,7 +171,9 @@ Accept wildcard characters: False
149171

150172
### CommonParameters
151173

152-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
174+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
175+
-InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose,
176+
-WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216).
153177

154178
## INPUTS
155179

@@ -163,4 +187,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
163187

164188
[Get-TimeZone](Get-TimeZone.md)
165189

166-

0 commit comments

Comments
 (0)