Updated if statements to ContainsKey function instead of bare contains
This commit is contained in:
@@ -50,7 +50,7 @@ function Get-ZertoVirtualizationSite {
|
||||
|
||||
"devices" {
|
||||
foreach ( $id in $siteIdentifier ) {
|
||||
if ( $PSBoundParameters.Contains( "hostIdentifier" ) ) {
|
||||
if ( $PSBoundParameters.ContainsKey( "hostIdentifier" ) ) {
|
||||
$uri = "{0}/{1}/devices?hostIdentifier={2}" -f $baseUri, $siteIdentifier, $hostIdentifier
|
||||
} else {
|
||||
$uri = "{0}/{1}/devices" -f $baseUri, $siteIdentifier
|
||||
@@ -61,7 +61,7 @@ function Get-ZertoVirtualizationSite {
|
||||
}
|
||||
|
||||
"hosts" {
|
||||
if ( $PSBoundParameters.Contains( "hostIdentifier" ) ) {
|
||||
if ( $PSBoundParameters.ContainsKey( "hostIdentifier" ) ) {
|
||||
$uri = "{0}/{1}/hosts/{2}" -f $baseUri, $siteIdentifier, $hostIdentifier
|
||||
} else {
|
||||
$uri = "{0}/{1}/hosts" -f $baseUri, $siteIdentifier
|
||||
|
||||
@@ -74,7 +74,7 @@ function Get-ZertoVpg {
|
||||
|
||||
"checkpoints" {
|
||||
$filter = $false
|
||||
if ( $PSBoundParameters.Contains("startDate") -or $PSBoundParameters.Contains("endDate") ) {
|
||||
if ( $PSBoundParameters.ContainsKey("startDate") -or $PSBoundParameters.ContainsKey("endDate") ) {
|
||||
$filter = $true
|
||||
$filterTable = @{}
|
||||
foreach ( $key in $PSBoundParameters.Keys ) {
|
||||
|
||||
Reference in New Issue
Block a user