Skip to content

Commit d1e474e

Browse files
committed
Another function needs SupportsShouldProcess
1 parent 3f8a5cb commit d1e474e

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

source/Public/Deployment Pipeline/Start-FabricDeploymentPipelineStage.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Author: Kamil Nowinski
5959
#>
6060

6161
function Start-FabricDeploymentPipelineStage {
62-
[CmdletBinding()]
62+
[CmdletBinding(SupportsShouldProcess)]
6363
param(
6464
[Parameter(Mandatory = $true)]
6565
[ValidateNotNullOrEmpty()]
@@ -107,9 +107,11 @@ function Start-FabricDeploymentPipelineStage {
107107
}
108108

109109
# Step 4: Make the API request and validate response
110-
$response = Invoke-FabricRestMethod -Uri $apiEndpointUrl -Method Post -Body $requestBody
111-
#Write-Message -Message "Successfully initiated deployment. Operation ID: $($script:responseHeader['x-ms-operation-id'])" -Level Info
112-
Test-FabricApiResponse -Response $response -typeName 'Deploy Pipeline Stage' -ObjectIdOrName $DeploymentPipelineId -NoWait:$NoWait
110+
if ($PSCmdlet.ShouldProcess($apiEndpointUrl, "Start Deployment Pipeline")) {
111+
$response = Invoke-FabricRestMethod -Uri $apiEndpointUrl -Method Post -Body $requestBody
112+
#Write-Message -Message "Successfully initiated deployment. Operation ID: $($script:responseHeader['x-ms-operation-id'])" -Level Info
113+
$response = Test-FabricApiResponse -Response $response -typeName 'Deploy Pipeline Stage' -ObjectIdOrName $DeploymentPipelineId -NoWait:$NoWait
114+
}
113115

114116
# Step 5: Return results
115117
$response

tests/Unit/New-FabricDeploymentPipeline.Tests.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ param(
1717
"OutVariable"
1818
"OutBuffer"
1919
"PipelineVariable"
20+
"WhatIf"
21+
"Confirm"
2022
)
2123
)
2224

tests/Unit/Start-FabricDeploymentPipelineStage.Tests.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ param(
2020
"OutVariable"
2121
"OutBuffer"
2222
"PipelineVariable"
23+
"WhatIf"
24+
"Confirm"
2325
)
2426
)
2527

0 commit comments

Comments
 (0)