@@ -6,22 +6,20 @@ title: Confirmation Messages
66# Confirmation Messages
77
88Here are different confirmation messages that can be displayed depending on the variants of the
9- [ System.Management.Automation.Cmdlet.ShouldProcess] ( /dotnet/api/System.Management.Automation.Cmdlet.ShouldProcess )
10- and
11- [ System.Management.Automation.Cmdlet.ShouldContinue] ( /dotnet/api/System.Management.Automation.Cmdlet.ShouldContinue )
12- methods that are called.
9+ [ System.Management.Automation.Cmdlet.ShouldProcess] [ 04 ] and
10+ [ System.Management.Automation.Cmdlet.ShouldContinue] [ 03 ] methods that are called.
1311
1412> [ !IMPORTANT]
1513> For sample code that shows how to request confirmations, see
16- > [ How to Request Confirmations ] ( ./how-to-request-confirmations.md ) .
14+ > [ Requesting Confirmation from Cmdlets ] [ 01 ] .
1715
1816## Specifying the Resource
1917
2018You can specify the resource that is about to be changed by calling the
21- [ System.Management.Automation.Cmdlet.ShouldProcess] ( /dotnet/api/System.Management.Automation.Cmdlet.ShouldProcess )
22- method. In this case, you supply the resource by using the ` target ` parameter of the method, and the
23- operation is added by Windows PowerShell. In the following message, the text "MyResource" is the
24- resource acted on and the operation is the name of the command that makes the call.
19+ [ System.Management.Automation.Cmdlet.ShouldProcess] [ 04 ] method. In this case, you supply the
20+ resource by using the ` target ` parameter of the method, and the operation is added by Windows
21+ PowerShell. In the following message, the text "MyResource" is the resource acted on and the
22+ operation is the name of the command that makes the call.
2523
2624``` Output
2725Confirm
@@ -31,9 +29,8 @@ Performing operation "Test-RequestConfirmationTemplate1" on Target "MyResource".
3129```
3230
3331If the user selects ** Yes** or ** Yes to All** to the confirmation request (as shown in the following
34- example), a call to the
35- [ System.Management.Automation.Cmdlet.ShouldContinue] ( /dotnet/api/System.Management.Automation.Cmdlet.ShouldContinue )
36- method is made, which causes a second confirmation message to be displayed.
32+ example), a call to the [ System.Management.Automation.Cmdlet.ShouldContinue] [ 03 ] method is made,
33+ which causes a second confirmation message to be displayed.
3734
3835``` Output
3936Confirm
@@ -49,11 +46,10 @@ Continue with this operation?
4946## Specifying the Operation and Resource
5047
5148You can specify the resource that is about to be changed and the operation that the command is about
52- to perform by calling the
53- [ System.Management.Automation.Cmdlet.ShouldProcess] ( /dotnet/api/System.Management.Automation.Cmdlet.ShouldProcess )
54- method. In this case, you supply the resource by using the ` target ` parameter and the operation by
55- using the ` target ` parameter. In the following message, the text "MyResource" is the resource acted
56- on and "MyAction" is the operation to be performed.
49+ to perform by calling the [ System.Management.Automation.Cmdlet.ShouldProcess] [ 04 ] method. In this
50+ case, you supply the resource by using the ` target ` parameter and the operation by using the
51+ ` target ` parameter. In the following message, the text "MyResource" is the resource acted on and
52+ "MyAction" is the operation to be performed.
5753
5854``` Output
5955Confirm
@@ -63,8 +59,8 @@ Performing operation "MyAction" on Target "MyResource".
6359```
6460
6561If the user selects ** Yes** or ** Yes to All** to the previous message, a call to the
66- [ System.Management.Automation.Cmdlet.ShouldContinue] ( /dotnet/api/System.Management.Automation.Cmdlet.ShouldContinue )
67- method is made, which causes a second confirmation message to be displayed.
62+ [ System.Management.Automation.Cmdlet.ShouldContinue] [ 03 ] method is made, which causes a second
63+ confirmation message to be displayed.
6864
6965``` Output
7066Confirm
@@ -79,4 +75,10 @@ Continue with this operation?
7975
8076## See Also
8177
82- [ Writing a Windows PowerShell Cmdlet] ( ./writing-a-windows-powershell-cmdlet.md )
78+ [ Writing a Windows PowerShell Cmdlet] [ 02 ]
79+
80+ <!-- link references -->
81+ [ 01 ] : ./requesting-confirmation-from-cmdlets.md
82+ [ 02 ] : ./writing-a-windows-powershell-cmdlet.md
83+ [ 03 ] : xref:System.Management.Automation.Cmdlet.ShouldContinue%2A
84+ [ 04 ] : xref:System.Management.Automation.Cmdlet.ShouldProcess%2A
0 commit comments