From 16a162becddb53c97bfaf561967e6f01951bda78 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 20 Feb 2019 08:09:31 -0500 Subject: [PATCH] Updated if statements to ContainsKey function instead of bare contains --- ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 | 4 ++-- ZertoApiWrapper/Public/Get-ZertoVpg.ps1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 b/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 index af9013f..fa8124d 100644 --- a/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 @@ -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 diff --git a/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 index 63d0ae1..a08c33b 100644 --- a/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 @@ -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 ) {