Updated if statements to ContainsKey function instead of bare contains

This commit is contained in:
Wes Carroll
2019-02-20 08:09:31 -05:00
parent ed91b0e338
commit 16a162becd
2 changed files with 3 additions and 3 deletions
@@ -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
+1 -1
View File
@@ -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 ) {