Skip to content

Commit

Permalink
Role(Set): Add role name on ShouldProcess
Browse files Browse the repository at this point in the history
  • Loading branch information
alagoutte committed Mar 31, 2022
1 parent 9bac0f0 commit 7a48b39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PowerArubaCP/Public/Role.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ function Set-ArubaCPRole {
#get role id from role ps object
if ($r) {
$id = $r.id
$rname = "(" + $r.name + ")"
}

$uri = "api/role/${id}"
Expand All @@ -238,7 +239,7 @@ function Set-ArubaCPRole {
$_r | add-member -name "description" -membertype NoteProperty -Value $description
}

if ($PSCmdlet.ShouldProcess($id, 'Configure Role')) {
if ($PSCmdlet.ShouldProcess("$id $rname", 'Configure Role')) {
$r = Invoke-ArubaCPRestMethod -method "PATCH" -body $_r -uri $uri -connection $connection
$r
}
Expand Down

0 comments on commit 7a48b39

Please sign in to comment.