Skip to content

Commit

Permalink
Fix Issue #104 added ShouldProcess Arguments (#107)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Hoggins <[email protected]>
  • Loading branch information
andrew-hoggins and Andrew Hoggins authored Mar 17, 2024
1 parent 6ed9303 commit da33b3d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function Update-ZoomMeetingRecordingsSettings {

$requestBody = ConvertTo-Json $requestBody

if ($pscmdlet.ShouldProcess) {
if ($pscmdlet.ShouldProcess($MeetingId, 'Update')) {
$response = Invoke-ZoomRestMethod -Uri $request.Uri -Body $requestBody -Method PATCH

Write-Output $response
Expand Down
2 changes: 1 addition & 1 deletion PSZoom/Public/Groups/Remove-ZoomGroupMembers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function Remove-ZoomGroupMembers {
foreach ($MemberId in $MemberIds) {
$Request = [System.UriBuilder]"https://api.$ZoomURI/v2/groups/$GroupId/members/$MemberId"

if ($PScmdlet.ShouldProcess) {
if ($PScmdlet.ShouldProcess("Removing $MemberId from $GroupId", $MemberId, 'Remove Group Member')) {
Write-Verbose "Removing $MemberId from $GroupId."
$response = Invoke-ZoomRestMethod -Uri $request.Uri -Method DELETE

Expand Down
2 changes: 1 addition & 1 deletion PSZoom/Public/Users/New-ZoomUser.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function New-ZoomUser {

$requestBody = $requestBody | ConvertTo-Json

if ($PScmdlet.ShouldProcess) {
if ($PScmdlet.ShouldProcess($Email, "Create Zoom Account")) {
$response = Invoke-ZoomRestMethod -Uri $request.Uri -Body $requestBody -Method POST

if ($passthru) {
Expand Down
2 changes: 1 addition & 1 deletion PSZoom/Public/Users/Update-ZoomUser.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ function Update-ZoomUser {

$RequestBody = $RequestBody | ConvertTo-Json

if ($pscmdlet.ShouldProcess) {
if ($pscmdlet.ShouldProcess($user, 'Update')) {
$response = Invoke-ZoomRestMethod -Uri $request.Uri -Body $requestBody -Method PATCH

if (-not $PassThru) {
Expand Down
2 changes: 1 addition & 1 deletion PSZoom/Public/Users/Update-ZoomUserPassword.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function Update-ZoomUserpassword {

$requestBody = $requestBody | ConvertTo-Json

if ($PSCmdlet.ShouldProcess) {
if ($PSCmdlet.ShouldProcess($UserId, 'Update Password')) {
$response = Invoke-ZoomRestMethod -Uri $request.Uri -Body $requestBody -Method PUT

if (-not $PassThru) {
Expand Down
4 changes: 2 additions & 2 deletions PSZoom/Public/Users/Update-ZoomUserSettings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ Update-ZoomUserSettings -UserId '[email protected]' -JoinBeforeHost $True
#>

function Update-ZoomUserSettings {
[CmdletBinding()]
[CmdletBinding(SupportsShouldProcess = $True)]
Param(
[Parameter(
Mandatory = $True,
Expand Down Expand Up @@ -944,7 +944,7 @@ function Update-ZoomUserSettings {

$requestBody = $requestBody | ConvertTo-Json

if ($pscmdlet.ShouldProcess) {
if ($pscmdlet.ShouldProcess($user,'Update')) {
$response = Invoke-ZoomRestMethod -Uri $request.Uri -Body $requestBody -Method PATCH

if (-not $PassThru) {
Expand Down

0 comments on commit da33b3d

Please sign in to comment.