Skip to content

Commit 7c223b5

Browse files
robinharwoodmichaeltlombardi
authored andcommitted
Updated examples
1 parent 3ca3f37 commit 7c223b5

29 files changed

+177
-360
lines changed

docset/winserver2022-ps/failoverclusters/Add-ClusterCheckpoint.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,27 @@ local server.
3636

3737
### Example 1: Add registry checkpoint
3838

39-
```
40-
PS C:\> Add-ClusterCheckpoint -ResourceName "Cluster Name" -RegistryCheckpoint "software\clusname"
41-
Resource Name
42-
-------- ----
43-
Cluster Name software\clusname
39+
```powershell
40+
Add-ClusterCheckpoint -ResourceName "Cluster Name" -RegistryCheckpoint "software\clusname"
4441
```
4542

46-
This example adds a registry checkpoint called software\clusname for the resource named cluster
43+
This example adds a registry checkpoint called `software\clusname` for the resource named cluster
4744
name.
4845

4946
### Example 2: Add cryptographic checkpoint
5047

51-
```
52-
PS C:\> Get-ClusterResource -Name "Cluster Name" | Add-ClusterCheckpoint -CryptoCheckpointName "Microsoft Base Cryptographic Provider v1.0" -CryptoCheckpointType 1 -CryptoCheckpointKey "Crypto"
53-
Resource Name Type Key
54-
-------- ---- ---- ---
55-
Cluster Name Microsoft Base Cryptograph... 1 Crypto
48+
```powershell
49+
$parameters = @{
50+
CryptoCheckpointName = 'Microsoft Base Cryptographic Provider v1.0'
51+
CryptoCheckpointType = '1'
52+
CryptoCheckpointKey = 'Crypto'
53+
}
54+
Get-ClusterResource -Name "Cluster Name" | Add-ClusterCheckpoint @parameters
5655
```
5756

58-
This example adds a cryptographic checkpoint for the resource named Cluster Name.
57+
This example adds a cryptographic checkpoint for the resource named Cluster Name. This example uses
58+
splatting to pass parameter values from the `$Parameters` variable to the command. Learn more about
59+
[Splatting](/powershell/module/microsoft.powershell.core/about/about_splatting).
5960

6061
## PARAMETERS
6162

docset/winserver2022-ps/failoverclusters/Add-ClusterDisk.md

+8-18
Original file line numberDiff line numberDiff line change
@@ -34,40 +34,30 @@ information about disks that you can add to the cluster.
3434

3535
### Example 1: Add available disks to the Available Storage group
3636

37-
```
38-
PS C:\> Get-ClusterAvailableDisk | Add-ClusterDisk
39-
Name State Group ResourceType
40-
---- ----- ----- ------------
41-
Cluster Disk 7 OnlinePending Available Storage Physical Disk
42-
Cluster Disk 8 OnlinePending Available Storage Physical Disk
37+
```powershell
38+
Get-ClusterAvailableDisk | Add-ClusterDisk
4339
```
4440

4541
This example identifies the disks that are ready to be added to the cluster, and then adds them to
4642
Available Storage cluster group.
4743

4844
### Example 2: Add a specific available disk to Available Storage
4945

50-
```
51-
PS C:\> Get-ClusterAvailableDisk | Where-Object -FilterScript { $_.ScsiAddress -Eq 50331651 } | Add-ClusterDisk
52-
Name State Group ResourceType
53-
---- ----- ----- ------------
54-
Cluster Disk 4 OnlinePending Available Storage Physical Disk
46+
```powershell
47+
Get-ClusterAvailableDisk | Where-Object -FilterScript { $_.ScsiAddress -Eq 50331651 } | Add-ClusterDisk
5548
```
5649

5750
This example examines disks that are ready to be added to the cluster, finds the disk with a
5851
specific SCSI address, and adds it to Available Storage cluster group.
5952

6053
### Example 3: Cluster a physical disk
6154

62-
```
63-
PS C:\> Get-Disk -Number 11 | Add-ClusterDisk
64-
Name State OwnerGroup ResourceType
65-
---- ----- ---------- ------------
66-
Cluster Disk 5 OnlinePending Available Storage Physical Disk
55+
```powershell
56+
Get-Disk -Number 11 | Add-ClusterDisk
6757
```
6858

69-
This example clusters a physical disk. This cmdlet adds a physical disk to the **Available Storage**
70-
for the cluster.
59+
This example clusters a physical disk. This cmdlet adds a physical disk to the cluster _Available
60+
Storage _.
7161

7262
## PARAMETERS
7363

docset/winserver2022-ps/failoverclusters/Add-ClusterFileServerRole.md

+9-18
Original file line numberDiff line numberDiff line change
@@ -38,38 +38,29 @@ clustered file server should use.
3838

3939
### Example 1: Create a clustered file server
4040

41-
```
42-
PS C:\> Add-ClusterFileServerRole -Storage "Cluster Disk 8"
43-
Name OwnerNode State
44-
---- --------- -----
45-
cluster1FS node1 Online
41+
```powershell
42+
Add-ClusterFileServerRole -Storage "Cluster Disk 8"
4643
```
4744

4845
This example creates a clustered file server using Cluster Disk 8, and assigns a default name.
4946

5047
### Example 2: Create and name a clustered file server
5148

52-
```
53-
PS C:\> Add-ClusterFileServerRole -Storage "Cluster Disk 6" -Name cluster1FS12
54-
Name OwnerNode State
55-
---- --------- -----
56-
cluster1FS12 node1 Online
49+
```powershell
50+
Add-ClusterFileServerRole -Storage "Cluster Disk 6" -Name cluster1FS12
5751
```
5852

5953
This example creates a clustered file server using Cluster Disk 6, and assigns the name
60-
cluster1FS12.
54+
`cluster1FS12`.
6155

6256
### Example 3: Create a clustered file server with no waiting for resources
6357

64-
```
65-
PS C:\> Add-ClusterFileServerRole -Storage "Cluster Disk 8" -Wait 0
66-
Name OwnerNode State
67-
---- --------- -----
68-
cluster1FS node1 Pending
58+
```powershell
59+
Add-ClusterFileServerRole -Storage "Cluster Disk 8" -Wait 0
6960
```
7061

71-
This example creates a clustered file server using Cluster Disk 8, and assigns a default name. The
72-
cmdlet completes without waiting for all resources to come online.
62+
This example creates a clustered file server using Cluster Disk 8, and assigns a default name.
63+
The cmdlet completes without waiting for all resources to come online.
7364

7465
## PARAMETERS
7566

docset/winserver2022-ps/failoverclusters/Add-ClusterGenericApplicationRole.md

+18-20
Original file line numberDiff line numberDiff line change
@@ -40,38 +40,36 @@ If so, then it is presumed to be online and will not be restarted or failed over
4040

4141
### Example 1: Configure an application as a generic clustered application
4242

43-
```
44-
PS C:\> Add-ClusterGenericApplicationRole -CommandLine NewApplication.exe
45-
Name OwnerNode State
46-
---- --------- -----
47-
cluster1GenApp node2 Online
43+
```powershell
44+
Add-ClusterGenericApplicationRole -CommandLine NewApplication.exe
4845
```
4946

50-
This example configures NewApplication.exe as a generic clustered application. A default name will
51-
be used for client access and this application requires no storage.
47+
This example configures `NewApplication.exe` as a generic clustered application.
48+
A default name will be used for client access and this application requires no storage.
5249

5350
### Example 2: Configure an application with storage and name
5451

55-
```
56-
PS C:\> Add-ClusterGenericApplicationRole -CommandLine NewApplication.exe -Storage "Cluster Disk 4" -Name NewApplication
57-
Name OwnerNode State
58-
---- --------- -----
59-
NewApplication node2 Online
52+
```powershell
53+
$parameters = @{
54+
CommandLine = 'NewApplication.exe'
55+
Storage = 'Cluster Disk 4'
56+
Name = 'NewApplication'
57+
}
58+
Add-ClusterGenericApplicationRole @parameters
6059
```
6160

62-
This example configures NewApplication.exe as a generic clustered application using Cluster Disk 4,
63-
and assigns the name NewApplication.
61+
This example configures `NewApplication.exe` as a generic clustered application using Cluster Disk 4,
62+
and assigns the name NewApplication. This example uses splatting to pass parameter values from the
63+
`$Parameters` variable to the command. Learn more about
64+
[Splatting](/powershell/module/microsoft.powershell.core/about/about_splatting).
6465

6566
### Example 3: Configure application with no wait for resources
6667

67-
```
68-
PS C:\> Add-ClusterGenericApplicationRole -CommandLine NewApplication.exe -Wait 0
69-
Name OwnerNode State
70-
---- --------- -----
71-
cluster1GenApp node2 Pending
68+
```powershell
69+
Add-ClusterGenericApplicationRole -CommandLine NewApplication.exe -Wait 0
7270
```
7371

74-
This example configures NewApplication.exe as a generic clustered application and assigns the name
72+
This example configures `NewApplication.exe` as a generic clustered application and assigns the name
7573
NewApplication. The cmdlet completes without waiting for all resources to come online.
7674

7775
## PARAMETERS

docset/winserver2022-ps/failoverclusters/Add-ClusterGenericScriptRole.md

+9-18
Original file line numberDiff line numberDiff line change
@@ -39,38 +39,29 @@ script, the application will be restarted or failed over.
3939

4040
### Example 1: Configure a script to run on a failover cluster
4141

42-
```
43-
PS C:\> Add-ClusterGenericScriptRole -ScriptFilePath "script1.vbs"
44-
Name OwnerNode State
45-
---- --------- -----
46-
cluster1GenScript node2 Online
42+
```powershell
43+
Add-ClusterGenericScriptRole -ScriptFilePath "script1.vbs"
4744
```
4845

49-
This example configures the script named script1.vbs to run within a failover cluster, using
46+
This example configures the script named `script1.vbs` to run within a failover cluster, using
5047
defaults for the name and IP address, and doesn't assign a disk.
5148

5249
### Example 2: Configure a script on a failover cluster and assign a clustered script name
5350

54-
```
55-
PS C:\> Add-ClusterGenericScriptRole -ScriptFilePath "script1.vbs" -Storage "Cluster Disk 4" -Name "script1"
56-
Name OwnerNode State
57-
---- --------- -----
58-
script1 node2 Online
51+
```powershell
52+
Add-ClusterGenericScriptRole -ScriptFilePath "script1.vbs" -Storage "Cluster Disk 4" -Name "script1"
5953
```
6054

61-
This example configures the script named script1.vbs to run within a failover cluster and use
55+
This example configures the script named `script1.vbs` to run within a failover cluster and use
6256
Cluster Disk 4. The cmdlet assigns the clustered script the name script1.
6357

6458
### Example 3: Configure a script to run on a fail over cluster without waiting for resources
6559

66-
```
67-
PS C:\> Add-ClusterGenericScriptRole -ScriptFilePath "script1.vbs" -Wait 0
68-
Name OwnerNode State
69-
---- --------- -----
70-
cluster1GenScript node2 Pending
60+
```powershell
61+
Add-ClusterGenericScriptRole -ScriptFilePath "script1.vbs" -Wait 0
7162
```
7263

73-
This example configures the script called script1.vbs to run within a failover cluster, using
64+
This example configures the script called `script1.vbs` to run within a failover cluster, using
7465
defaults for the name and IP address, and doesn't assign a disk. The cmdlet completes without
7566
waiting for all resources to come online.
7667

docset/winserver2022-ps/failoverclusters/Add-ClusterGenericServiceRole.md

+4-10
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,17 @@ restarted or failed over.
3939

4040
### Example 1: Configure a service that uses default values
4141

42-
```
43-
PS C:\> Add-ClusterGenericServiceRole -ServiceName "Service1"
44-
Name OwnerNode State
45-
---- --------- -----
46-
cluster1GenSvc node1 Online
42+
```powershell
43+
Add-ClusterGenericServiceRole -ServiceName "Service1"
4744
```
4845

4946
This example configures Service1 as a generic clustered service, using defaults for the name and IP
5047
address, and doesn't assign a disk.
5148

5249
### Example 2: Configure a service that uses default values and a specified disk
5350

54-
```
55-
PS C:\> Add-ClusterGenericServiceRole -ServiceName "Service1" -Storage "Cluster Disk 6"
56-
Name OwnerNode State
57-
---- --------- -----
58-
cluster1GenSvc node1 Online
51+
```powershell
52+
Add-ClusterGenericServiceRole -ServiceName "Service1" -Storage "Cluster Disk 6"
5953
```
6054

6155
This example configures Service1 as a generic clustered service using Cluster Disk 6, and assigns

docset/winserver2022-ps/failoverclusters/Add-ClusterGroup.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,8 @@ is the unit of failover. During failover, all resources in the resource group mo
3131

3232
### Example 1: Add a resource group
3333

34-
```
35-
PS C:\> Add-ClusterGroup -Name "Group1"
36-
Name OwnerNode State
37-
---- --------- -----
38-
Group1 node1 Online
34+
```powershell
35+
Add-ClusterGroup -Name "Group1"
3936
```
4037

4138
This example adds an empty resource group called Group1 to the failover cluster.

docset/winserver2022-ps/failoverclusters/Add-ClusterGroupSetDependency.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ The `Add-ClusterGroupSetDependency` cmdlet adds a dependency to a cluster set.
3737

3838
### Example 1: Add a dependency to a provider set
3939

40-
```
41-
PS C:\> Add-ClusterGroupSetDependency -Name "Set001" -Provider "Provider002"
40+
```powershell
41+
Add-ClusterGroupSetDependency -Name "Set001" -Provider "Provider002"
4242
```
4343

44-
This command adds the set named Provider002 as a provider to the set named Set001. Both sets cannot
45-
be empty.
44+
This command adds the set named `Provider002` as a provider to the set named `Set001`.
45+
Both sets cannot be empty.
4646

4747
## PARAMETERS
4848

docset/winserver2022-ps/failoverclusters/Add-ClusterGroupToSet.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ The `Add-ClusterGroupToSet` cmdlet adds a group to a set. A group can only belon
3737

3838
### Example 1: Add a cluster group to a set
3939

40-
```
41-
PS C:\> Add-ClusterGroupToSet -Name "Set001" -Group "Group001"
40+
```powershell
41+
Add-ClusterGroupToSet -Name "Set001" -Group "Group001"
4242
```
4343

44-
This command adds the cluster group named Group001 to the set named Set001.
44+
This command adds the cluster group named `Group001` to the set named `Set001`.
4545

4646
## PARAMETERS
4747

docset/winserver2022-ps/failoverclusters/Add-ClusterNode.md

+6-12
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,19 @@ connected correctly to the networks and storage and that it contains the same so
3737

3838
### Example 1
3939

40-
```
41-
PS C:\> Add-ClusterNode -Name node4
42-
Name State
43-
---- -----
44-
node4 Up
40+
```powershell
41+
Add-ClusterNode -Name node4
4542
```
4643

47-
This example adds node named node4 to the local cluster.
44+
This example adds node named `node4` to the local cluster.
4845

4946
### Example 2
5047

51-
```
52-
PS C:\> Get-Cluster -Name cluster1 | Add-ClusterNode -Name node3
53-
Name State
54-
---- -----
55-
node3 Up
48+
```powershell
49+
Get-Cluster -Name cluster1 | Add-ClusterNode -Name node3
5650
```
5751

58-
This example adds the node named node3 to cluster called cluster1.
52+
This example adds the node named `node3` to cluster called `cluster1`.
5953

6054
## PARAMETERS
6155

docset/winserver2022-ps/failoverclusters/Add-ClusterResource.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,12 @@ which to add the resource.
3030

3131
### Example 1
3232

33-
```
34-
PS C:\> Add-ClusterResource -Name resource1 -ResourceType "IP Address" -Group ClusterSrv1
35-
Name State Group ResourceType
36-
---- ----- ----- ------------
37-
resource1 Offline ClusterSrv1 IP Address
33+
```powershell
34+
Add-ClusterResource -Name resource1 -ResourceType "IP Address" -Group ClusterSrv1
3835
```
3936

40-
This example creates a new IP Address resource called resource1 on the local cluster. The cmdlet
41-
configures the resource as part of the clustered role, or resource group, called ClusterSrv1.
37+
This example creates a new IP Address resource called `resource1` on the local cluster. The cmdlet
38+
configures the resource as part of the clustered role, or resource group, called `ClusterSrv1`.
4239

4340
## PARAMETERS
4441

docset/winserver2022-ps/failoverclusters/Add-ClusterResourceDependency.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,12 @@ is taken offline before the resources on which it depends.
3535

3636
### Example 1
3737

38-
```
39-
PS C:\> Add-ClusterResourceDependency -Resource "FileServer-(cluster1FS12)" -Provider "Cluster Disk 4"
40-
Name State Group ResourceType
41-
---- ----- ----- ------------
42-
FileServer-(clus... Online cluster1FS12 File Server
38+
```powershell
39+
Add-ClusterResourceDependency -Resource "FileServer-(cluster1FS12)" -Provider "Cluster Disk 4"
4340
```
4441

45-
This example adds the resource named "Cluster Disk 4" to the list of resources on which the resource
46-
called "FileServer-(cluster1FS12)" depends, using AND as the connector.
42+
This example adds the resource named Cluster Disk 4 to the list of resources on which the resource
43+
called `FileServer-(cluster1FS12)` depends.
4744

4845
## PARAMETERS
4946

0 commit comments

Comments
 (0)