Skip to content

Commit

Permalink
Updated ShouldProcess output
Browse files Browse the repository at this point in the history
Updated ShouldProcess output and made easier to read in the code.
Also updated some examples given for Set-DattoBulkSeatChange and docs
  • Loading branch information
cksapp committed Jan 19, 2024
1 parent 44c6f9d commit 12f5790
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 8 additions & 4 deletions DattoAPI/Public/SaaS/Set-DattoBulkSeatChange.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ function Set-DattoBulkSeatChange {
Defines the external Subscription ID of the SaaS Protection Organization used to set SaaS bulk seat changes
.EXAMPLE
Set-DattoBulkSeatChange -saasCustomerId "12345678" -externalSubscriptionId 'Classic:Office365:123456' -seatType "User" -remoteId "ab23-bdf234-1234-asdf" -actionType "License"
Set-DattoBulkSeatChange -saasCustomerId "123456" -externalSubscriptionId 'Classic:Office365:567890' -seatType "User" -remoteId "ab23-bdf234-1234-asdf","cd45-cfe567-5678-qwer" -actionType "License"
Sets the Datto SaaS protection seats from the defined Office365 customer id
.EXAMPLE
Set-DattoBulkSeatChange -saasCustomerId "12345678" -externalSubscriptionId 'Classic:GoogleApps:123456' -seatType "SharedDrive" -remoteId "ab23-bdf234-1234-asdf","cd45-cfe567-5678-qwer" -actionType "Pause"
Set-DattoBulkSeatChange -saasCustomerId "123456" -externalSubscriptionId 'Classic:GoogleApps:567890' -seatType "User" -remoteId "132347796423154833164","165482361285249794358" -actionType "License"
Set-DattoBulkSeatChange -saasCustomerId "123456" -externalSubscriptionId 'Classic:GoogleApps:567890' -seatType "SharedDrive" -remoteId "0A7gHPLvNmJ9RUk3PQI","0B5rZXCtUyP4SUk2PVA" -actionType "Pause"
Sets the Datto SaaS protection seats from the defined Google customer id
Expand Down Expand Up @@ -60,7 +61,7 @@ function Set-DattoBulkSeatChange {
[ValidateNotNullOrEmpty()]
[string]$actionType,

# Either like 'Classic:Office365:123456', or 'Classic:GoogleApps:123456'
# Either like 'Classic:Office365:567890', or 'Classic:GoogleApps:567890'
[Parameter(
Mandatory = $true,
ValueFromPipeline = $true,
Expand All @@ -85,7 +86,10 @@ function Set-DattoBulkSeatChange {

process {

if ($PSCmdlet.ShouldProcess("saasCustomerId: $saasCustomerId, externalSubscriptionId: $externalSubscriptionId, $remoteId", "$actionType $seatType")) {
$target = "saasCustomerId: $saasCustomerId, externalSubscriptionId: $externalSubscriptionId, $remoteId"
$operation = "Set-DattoBulkSeatChange - $actionType $seatType"

if ($PSCmdlet.ShouldProcess($target, $operation)) {
Write-Verbose "Running the [ $($PSCmdlet.ParameterSetName) ] parameterSet"
Set-Variable -Name 'Datto_bulkSeatParameters' -Value $PSBoundParameters -Scope Global -Force

Expand Down
8 changes: 6 additions & 2 deletions docs/site/SaaS/Set-DattoBulkSeatChange.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ The `Set-DattoBulkSeatChange` cmdlet sets the Datto SaaS Protection bulk seat ch

### EXAMPLE 1
```powershell
Set-DattoBulkSeatChange -saasCustomerId "12345678" -externalSubscriptionId 'Classic:Office365:123456' -seatType "User" -remoteId "ab23-bdf234-1234-asdf" -actionType "License"
Set-DattoBulkSeatChange -saasCustomerId "123456" -externalSubscriptionId 'Classic:Office365:567890' -seatType "User" -remoteId "ab23-bdf234-1234-asdf","cd45-cfe567-5678-qwer" -actionType "License"
```

Sets the Datto SaaS protection seats from the defined Office365 customer id

### EXAMPLE 2
```powershell
Set-DattoBulkSeatChange -saasCustomerId "12345678" -externalSubscriptionId 'Classic:GoogleApps:123456' -seatType "SharedDrive" -remoteId "ab23-bdf234-1234-asdf","cd45-cfe567-5678-qwer" -actionType "Pause"
Set-DattoBulkSeatChange -saasCustomerId "123456" -externalSubscriptionId 'Classic:GoogleApps:567890' -seatType "User" -remoteId "132347796423154833164","165482361285249794358" -actionType "License"
```

```powershell
Set-DattoBulkSeatChange -saasCustomerId "123456" -externalSubscriptionId 'Classic:GoogleApps:567890' -seatType "SharedDrive" -remoteId "0A7gHPLvNmJ9RUk3PQI","0B5rZXCtUyP4SUk2PVA" -actionType "Pause"
```

Sets the Datto SaaS protection seats from the defined Google customer id
Expand Down

0 comments on commit 12f5790

Please sign in to comment.