Skip to content

Commit

Permalink
Fix Set-RubrikVM boolean bug
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Wahl <[email protected]>
  • Loading branch information
chriswahl committed Dec 28, 2016
1 parent 7429e92 commit 1f5b6b2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Rubrik/Public/Set-RubrikVM.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ function Set-RubrikVM
# If this value is exceeded, backups will be prevented due to seeing too many existing snapshots
# Keeping snapshots open on a virtual machine can adversely affect performance and increase consolidation times
# Choices range from 0 - 4 snapshots
[ValidateRange(0,4)]
[Parameter(Position = 2)]
[ValidateRange(0,4)]
[int]$MaxNestedSnapshots,
# Set to $true to enable backups for a particular virtual machine
# Set to $false to disable backups for a particular virtual machine
[Parameter(Position = 3)]
[bool]$PauseBackups,
[ValidateSet('True','False')]
[String]$PauseBackups,
# Rubrik server IP or FQDN
[String]$Server = $global:RubrikConnection.server,
# API version
Expand Down Expand Up @@ -77,17 +78,18 @@ function Set-RubrikVM

if ($SnapConsistency)
{
Write-Verbose -Message 'Adding snapshotConsistencyMandate to Body'
$body.Add($resources.$api.Params.snapshotConsistencyMandate,$SnapConsistency)
}
if ($MaxNestedSnapshots)
{
Write-Verbose -Message 'Adding maxNestedVsphereSnapshots to Body'
$body.Add($resources.$api.Params.maxNestedVsphereSnapshots,$MaxNestedSnapshots)
}
if ($PauseBackups -ne $null)
if ($PauseBackups)
{
Write-Verbose -Message 'Adding isVmPaused to Body'
$body.Add($resources.$api.Params.isVmPaused,$PauseBackups)
$body.Add($resources.$api.Params.isVmPaused,[System.Convert]::ToBoolean($PauseBackups))
}

# If the $body variable is empty, no params were defined
Expand Down

0 comments on commit 1f5b6b2

Please sign in to comment.