Skip to content

Commit

Permalink
🚨 🔒 UPDATE New-PASGroup
Browse files Browse the repository at this point in the history
Added SupportsShouldProcess
  • Loading branch information
pspete committed Nov 30, 2019
1 parent 52ee5be commit f7b1540
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions psPAS/Functions/User/New-PASGroup.ps1
Expand Up @@ -38,7 +38,7 @@ psPAS.CyberArk.Vault.Group Object
.NOTES
Minimum Version 11.1
#>
[CmdletBinding()]
[CmdletBinding(SupportsShouldProcess)]
param(
[parameter(
Mandatory = $true,
Expand Down Expand Up @@ -73,8 +73,12 @@ Minimum Version 11.1
#Construct Request Body
$Body = $PSBoundParameters | Get-PASParameter | ConvertTo-Json

#send request to web service
$result = Invoke-PASRestMethod -Uri $URI -Method POST -Body $Body -WebSession $Script:WebSession
if ($PSCmdlet.ShouldProcess($groupName, "Create Group")) {

#send request to web service
$result = Invoke-PASRestMethod -Uri $URI -Method POST -Body $Body -WebSession $Script:WebSession

}

if ($result) {

Expand Down

0 comments on commit f7b1540

Please sign in to comment.