From 17275b1191a309ea4cdd00a72d40949ce5814add Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 19 May 2019 15:34:55 -0500 Subject: [PATCH 001/479] Move Move Logic to Process Block --- ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 index 8c7a9a3..da397a6 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 @@ -19,7 +19,7 @@ function Invoke-ZertoMove { [Parameter( HelpMessage = "The amount of time, in seconds, the Move is in a 'Before Commit' state, before performing the commitPolicy setting. If omitted, the site settings default will be applied." )] - # Min 5 Minutes, Max 24 Hours, Default 1 Hour. + # Min 5 Minutes, Max 24 Hours, Default Site Settigns. [ValidateRange(300, 86400)] [Int]$commitPolicyTimeout, [Parameter( @@ -46,7 +46,10 @@ function Invoke-ZertoMove { begin { $baseUri = "vpgs" - $body = [ordered]@{} + } + + process { + $body = @{ } #TODO - use a foreach loop to populate the body without all the if statments if ($PSBoundParameters.ContainsKey('commitPolicy')) { $body['commitPolicy'] = $commitPolicy @@ -80,9 +83,6 @@ function Invoke-ZertoMove { $body['keepSourceVms'] = $false } } - } - - process { foreach ($name in $vpgName) { $vpgId = $(Get-ZertoVpg -name $name).vpgIdentifier if ( -not $vpgId ) { From f2ab959b93965c13f6c70e21e28a3e0c07e84895 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 19 May 2019 15:35:15 -0500 Subject: [PATCH 002/479] Add Parameter Tests --- .../Invoke-ZertoFailoverRollback.Tests.ps1 | 9 +++ Tests/Public/Invoke-ZertoForceSync.Tests.ps1 | 9 +++ Tests/Public/Invoke-ZertoMove.Tests.ps1 | 55 +++++++++++++++++++ 3 files changed, 73 insertions(+) diff --git a/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 b/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 index 50d2f9d..89cf63f 100644 --- a/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 @@ -16,4 +16,13 @@ Describe $file.BaseName -Tag 'Unit' { $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) $errors | Should -HaveCount 0 } + + Context "$($file.BaseName)::Parameter Unit Tests" { + + it "has a mandatory string parameter for the vpgName" { + Get-Command $file.BaseName | Should -HaveParameter vpgName + Get-Command $file.BaseName | Should -HaveParameter vpgName -Type string[] + Get-Command $file.BaseName | Should -HaveParameter vpgName -Mandatory + } + } } \ No newline at end of file diff --git a/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 b/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 index 50d2f9d..89cf63f 100644 --- a/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 @@ -16,4 +16,13 @@ Describe $file.BaseName -Tag 'Unit' { $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) $errors | Should -HaveCount 0 } + + Context "$($file.BaseName)::Parameter Unit Tests" { + + it "has a mandatory string parameter for the vpgName" { + Get-Command $file.BaseName | Should -HaveParameter vpgName + Get-Command $file.BaseName | Should -HaveParameter vpgName -Type string[] + Get-Command $file.BaseName | Should -HaveParameter vpgName -Mandatory + } + } } \ No newline at end of file diff --git a/Tests/Public/Invoke-ZertoMove.Tests.ps1 b/Tests/Public/Invoke-ZertoMove.Tests.ps1 index 50d2f9d..abfb900 100644 --- a/Tests/Public/Invoke-ZertoMove.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMove.Tests.ps1 @@ -16,4 +16,59 @@ Describe $file.BaseName -Tag 'Unit' { $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) $errors | Should -HaveCount 0 } + + Context "$($file.BaseName)::Parameter Unit Tests" { + + it "has a mandatory string parameter for the vpgName" { + Get-Command $file.BaseName | Should -HaveParameter vpgName + Get-Command $file.BaseName | Should -HaveParameter vpgName -Type string[] + Get-Command $file.BaseName | Should -HaveParameter vpgName -Mandatory + } + + it "has a non-mandatory string parameter for commitPolicy" { + Get-Command $file.BaseName | Should -HaveParameter commitPolicy + Get-Command $file.BaseName | Should -HaveParameter commitPolicy -Type string + } + + it "CommitPolicy only accecpts 'Rollback', 'Commit', or 'None'" { + { Invoke-ZertoMove -vpgName "MyVpg" -commitPolicy "Rollbackk" } | Should -Throw + { Invoke-ZertoMove -vpgName "MyVpg" -commitPolicy "" } | Should -Throw + { Invoke-ZertoMove -vpgName "MyVpg" -commitPolicy $null } | Should -Throw + } + + it "has a non-mandatory int parameter for commitPolicyTimeout" { + Get-Command $file.BaseName | Should -HaveParameter commitPolicyTimeout + Get-Command $file.BaseName | Should -HaveParameter commitPolicyTimeout -Type Int + } + + it "Commit Policy Timeout will only accecpt an int value between 5 minutes and 24 Hours" { + { Invoke-ZertoMove -vpgName "MyVpg" -commitPolicyTimeout 150 } | Should -Throw + { Invoke-ZertoMove -vpgName "MyVpg" -commitPolicyTimeout 15000000 } | Should -Throw + { Invoke-ZertoMove -vpgName "MyVpg" -commitPolicyTimeout -1350 } | Should -Throw + { Invoke-ZertoMove -vpgName "MyVpg" -commitPolicyTimeout $null } | Should -Throw + { Invoke-ZertoMove -vpgName "MyVpg" -commitPolicyTimeout "" } | Should -Throw + } + + it "has a non-mandatory switch parameter for forceShutdown" { + Get-Command $file.BaseName | Should -HaveParameter forceShutdown + Get-Command $file.BaseName | Should -HaveParameter forceShutdown -Type Switch + } + + it "has a mandatory switch parameter for disableReverseProtection" { + Get-Command $file.BaseName | Should -HaveParameter disableReverseProtection + Get-Command $file.BaseName | Should -HaveParameter disableReverseProtection -Type Switch + Get-Command $file.BaseName | Should -HaveParameter disableReverseProtection -Mandatory + } + + it "has a non-mandatory switch parameter for keepSourceVms" { + Get-Command $file.BaseName | Should -HaveParameter keepSourceVms + Get-Command $file.BaseName | Should -HaveParameter keepSourceVms -Type Switch + Get-Command $file.BaseName | Should -HaveParameter keepSourceVms -Mandatory + } + + it "has a non-mandatory switch parameter for ContinueOnPreScriptFailure" { + Get-Command $file.BaseName | Should -HaveParameter ContinueOnPreScriptFailure + Get-Command $file.BaseName | Should -HaveParameter ContinueOnPreScriptFailure -Type Switch + } + } } \ No newline at end of file From 98aedca37316b091bbfa461c29199a5b43c46840 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 19 May 2019 16:24:39 -0500 Subject: [PATCH 003/479] Update Parameter Tests --- Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 | 9 +++++++++ Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 b/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 index 50d2f9d..89cf63f 100644 --- a/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 @@ -16,4 +16,13 @@ Describe $file.BaseName -Tag 'Unit' { $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) $errors | Should -HaveCount 0 } + + Context "$($file.BaseName)::Parameter Unit Tests" { + + it "has a mandatory string parameter for the vpgName" { + Get-Command $file.BaseName | Should -HaveParameter vpgName + Get-Command $file.BaseName | Should -HaveParameter vpgName -Type string[] + Get-Command $file.BaseName | Should -HaveParameter vpgName -Mandatory + } + } } \ No newline at end of file diff --git a/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 b/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 index 50d2f9d..89cf63f 100644 --- a/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 @@ -16,4 +16,13 @@ Describe $file.BaseName -Tag 'Unit' { $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) $errors | Should -HaveCount 0 } + + Context "$($file.BaseName)::Parameter Unit Tests" { + + it "has a mandatory string parameter for the vpgName" { + Get-Command $file.BaseName | Should -HaveParameter vpgName + Get-Command $file.BaseName | Should -HaveParameter vpgName -Type string[] + Get-Command $file.BaseName | Should -HaveParameter vpgName -Mandatory + } + } } \ No newline at end of file From 4de751bc3dabe397d70dee93e87d0e008a08c401 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 19 May 2019 16:52:36 -0500 Subject: [PATCH 004/479] Typo Fix --- ZertoApiWrapper/Public/Get-ZertoAlert.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Get-ZertoAlert.ps1 b/ZertoApiWrapper/Public/Get-ZertoAlert.ps1 index 1ee27f6..abd4571 100644 --- a/ZertoApiWrapper/Public/Get-ZertoAlert.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoAlert.ps1 @@ -43,7 +43,7 @@ function Get-ZertoAlert { [string]$endDate, [Parameter( ParameterSetName = "filter", - HelpMessage = "Returns alerts for the specified vraIdentifier" + HelpMessage = "Returns alerts for the specified vpgIdentifier" )] [ValidateNotNullOrEmpty()] [Alias("vpgId")] From 2465305ddf7d4cabcb323626221593b9677b2189 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 19 May 2019 16:52:44 -0500 Subject: [PATCH 005/479] Update Get-ZertoAlert.Tests.ps1 --- Tests/Public/Get-ZertoAlert.Tests.ps1 | 59 ++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/Tests/Public/Get-ZertoAlert.Tests.ps1 b/Tests/Public/Get-ZertoAlert.Tests.ps1 index 1367839..d3e1558 100644 --- a/Tests/Public/Get-ZertoAlert.Tests.ps1 +++ b/Tests/Public/Get-ZertoAlert.Tests.ps1 @@ -20,10 +20,65 @@ Describe $file.BaseName -Tag 'Unit' { Context "$($file.BaseName)::Parameter Unit Tests" { it "Has a mandatory string parameter for the Alert identifier" { - Get-Command $file.BaseName | Should -HaveParameter alertId -Mandatory -Type String[] + Get-Command $file.BaseName | Should -HaveParameter alertId + Get-Command $file.BaseName | Should -HaveParameter alertId -Mandatory + Get-Command $file.BaseName | Should -HaveParameter alertId -Type String[] } - } + it "Has a non-mandatory switch parameter for the entities" { + Get-Command $file.BaseName | Should -HaveParameter entities + Get-Command $file.BaseName | Should -HaveParameter entities -Type switch + } + it "Has a non-mandatory switch parameter for the helpIdentifiers" { + Get-Command $file.BaseName | Should -HaveParameter helpIdentifiers + Get-Command $file.BaseName | Should -HaveParameter helpIdentifiers -Type switch + } + + it "Has a non-mandatory switch parameter for the levels" { + Get-Command $file.BaseName | Should -HaveParameter levels + Get-Command $file.BaseName | Should -HaveParameter levels -Type switch + } + + it "Has a non-mandatory string parameter for the startDate" { + Get-Command $file.BaseName | Should -HaveParameter startDate + Get-Command $file.BaseName | Should -HaveParameter startDate -Type string + } + + it "Has a non-mandatory string parameter for the endDate" { + Get-Command $file.BaseName | Should -HaveParameter endDate + Get-Command $file.BaseName | Should -HaveParameter endDate -Type string + } + + it "Has a non-mandatory string parameter for the vpgIdentifier" { + Get-Command $file.BaseName | Should -HaveParameter vpgIdentifier + Get-Command $file.BaseName | Should -HaveParameter vpgIdentifier -Type string + } + + it "Has a non-mandatory string parameter for the siteIdentifier" { + Get-Command $file.BaseName | Should -HaveParameter siteIdentifier + Get-Command $file.BaseName | Should -HaveParameter siteIdentifier -Type string + } + + it "Has a non-mandatory string parameter for the zorgIdentifier" { + Get-Command $file.BaseName | Should -HaveParameter zorgIdentifier + Get-Command $file.BaseName | Should -HaveParameter zorgIdentifier -Type string + } + + it "Has a non-mandatory string parameter for the level" { + Get-Command $file.BaseName | Should -HaveParameter level + Get-Command $file.BaseName | Should -HaveParameter level -Type string + } + + it "Has a non-mandatory string parameter for the helpIdentifier" { + Get-Command $file.BaseName | Should -HaveParameter helpIdentifier + Get-Command $file.BaseName | Should -HaveParameter helpIdentifier -Type string + } + + it "Has a non-mandatory bool parameter for the isDismissed" { + Get-Command $file.BaseName | Should -HaveParameter isDismissed + Get-Command $file.BaseName | Should -HaveParameter isDismissed -Type bool + } + } } From 28c35115eb192da479d5f4976c8b345250d0c982 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 19 May 2019 17:01:36 -0500 Subject: [PATCH 006/479] Update Get-ZertoDatastore.Tests.ps1 --- Tests/Public/Get-ZertoDatastore.Tests.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tests/Public/Get-ZertoDatastore.Tests.ps1 b/Tests/Public/Get-ZertoDatastore.Tests.ps1 index 50d2f9d..294021f 100644 --- a/Tests/Public/Get-ZertoDatastore.Tests.ps1 +++ b/Tests/Public/Get-ZertoDatastore.Tests.ps1 @@ -16,4 +16,9 @@ Describe $file.BaseName -Tag 'Unit' { $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) $errors | Should -HaveCount 0 } + + It "has a non-mandatory string parameter for the datacenterIdentifier" { + Get-Command $file.BaseName | Should -HaveParameter datastoreIdentifier + Get-Command $file.BaseName | Should -HaveParameter datastoreIdentifier -Type String[] + } } \ No newline at end of file From 27612761b40dd53463c8b53506ca7ee5fb99f5d4 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 19 May 2019 17:52:32 -0500 Subject: [PATCH 007/479] Update Get-ZertoLocalSite.Tests.ps1 --- Tests/Public/Get-ZertoLocalSite.Tests.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Tests/Public/Get-ZertoLocalSite.Tests.ps1 b/Tests/Public/Get-ZertoLocalSite.Tests.ps1 index 50d2f9d..03ae2c6 100644 --- a/Tests/Public/Get-ZertoLocalSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoLocalSite.Tests.ps1 @@ -16,4 +16,12 @@ Describe $file.BaseName -Tag 'Unit' { $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) $errors | Should -HaveCount 0 } + + Context "$($file.BaseName)::Parameter Unit Tests" { + + it "Has a non-mandatory switch parameter for the pairing Statuses" { + Get-Command $file.BaseName | Should -HaveParameter pairingstatuses + Get-Command $file.BaseName | Should -HaveParameter pairingstatuses -Type switch + } + } } \ No newline at end of file From dae010c262ccdcb38acfcd85edd44e7826a15c81 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 20 May 2019 08:46:32 -0500 Subject: [PATCH 008/479] Update README.md Update Build Status to New Project Location --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0fa3a9a..a6ba2f9 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ PowerShell Core wrapper for Zerto Virtual Manager API ## Current Build Status [![Codacy Badge](https://api.codacy.com/project/badge/Grade/0e31e5cdad534271ac688a82cc3ca17d)](https://app.codacy.com/app/wcarroll/ZertoApiWrapper?utm_source=github.com&utm_medium=referral&utm_content=wcarroll/ZertoApiWrapper&utm_campaign=Badge_Grade_Settings) -[![Build Status](https://dev.azure.com/wescarroll/ZertoApiWrapper/_apis/build/status/wcarroll.ZertoApiWrapper?branchName=master)](https://dev.azure.com/wescarroll/ZertoApiWrapper/_build/latest?definitionId=1&branchName=master) +[![Build Status](https://dev.azure.com/ZertoPublic/ZertoApiWrapper/_apis/build/status/ZertoPublic.ZertoApiWrapper?branchName=master)](https://dev.azure.com/ZertoPublic/ZertoApiWrapper/_build/latest?definitionId=1&branchName=master) ## Legal Disclaimer From 51064c5d648fe76cf0019b68d3f27e4a96466dd1 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 31 May 2019 09:38:48 -0400 Subject: [PATCH 009/479] Update Minimum PowerShellVersion to 5.1.0 --- ZertoApiWrapper.build.ps1 | 4 ++-- ZertoApiWrapper/ZertoApiWrapper.psd1 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 9a9ad17..3ca2fb5 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -101,8 +101,8 @@ task CreatePsd1ForRelease CleanTemp, { Author = 'Wes Carroll' CompanyName = 'Zerto' Copyright = '(c) {0} Wes Carroll. All rights reserved.' -f $(Get-Date -format 'yyyy') - Description = 'PowerShell Core Wrapper Module for Zerto Virtual Manager API' - PowerShellVersion = '6.0.0' + Description = 'Windows PowerShell and PowerShell Core API Wrapper Module for Zerto Virtual Manager' + PowerShellVersion = '5.1.0' ProjectUri = 'https://github.com/wcarroll/ZertoApiWrapper' LicenseUri = 'https://github.com/wcarroll/ZertoApiWrapper/blob/master/LICENSE' Tags = @("Zerto", "Automation") diff --git a/ZertoApiWrapper/ZertoApiWrapper.psd1 b/ZertoApiWrapper/ZertoApiWrapper.psd1 index c86a32b..af87c16 100644 --- a/ZertoApiWrapper/ZertoApiWrapper.psd1 +++ b/ZertoApiWrapper/ZertoApiWrapper.psd1 @@ -33,7 +33,7 @@ Description = 'PowerShell Core Wrapper Module for Zerto Virtual Manager API' # Minimum version of the PowerShell engine required by this module - PowerShellVersion = '6.0.0' + PowerShellVersion = '5.1.0' # Name of the PowerShell host required by this module # PowerShellHostName = '' From fa043df02ff2edf27f676994689c2433077fb029 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 31 May 2019 09:39:54 -0400 Subject: [PATCH 010/479] Request Logic to support Windows PowerShell Added logic needed to support Windows PowerShell including a Certificate Bypass. May move this into a function later to cllean the module a bit. --- .../Private/Invoke-ZertoRestRequest.ps1 | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Private/Invoke-ZertoRestRequest.ps1 b/ZertoApiWrapper/Private/Invoke-ZertoRestRequest.ps1 index a52f9a8..342a1fd 100644 --- a/ZertoApiWrapper/Private/Invoke-ZertoRestRequest.ps1 +++ b/ZertoApiWrapper/Private/Invoke-ZertoRestRequest.ps1 @@ -28,7 +28,45 @@ function Invoke-ZertoRestRequest { try { # Set the zvmLastAction time and try to submit the REST Request $script:zvmLastAction = (get-date).Ticks - $apiRequestResults = Invoke-RestMethod -Uri $submittedURI -Headers $script:zvmHeaders -Method $method -Body $body -ContentType $contentType -Credential $credential -SkipCertificateCheck -ResponseHeadersVariable responseHeaders -TimeoutSec 100 + # If running PwSh - Use this Invoke-RestMethod with passed Variables + if ($PSVersionTable.PSVersion.Major -ge 6) { + $apiRequestResults = Invoke-RestMethod -Uri $submittedURI -Headers $script:zvmHeaders -Method $method -Body $body -ContentType $contentType -Credential $credential -SkipCertificateCheck -ResponseHeadersVariable responseHeaders -TimeoutSec 100 + } else { + # If running PowerShell 5.1 --> Do the Following + # Check to see if All Certs are Trusted. If not, Create the Policy to Trust All Certificates + if ([System.Net.ServicePointManager]::CertificatePolicy.GetType().Name -ne "TrustAllCertsPolicy") { + Try { + $type = @' +using System.Net; +using System.Security.Cryptography.X509Certificates; +public class TrustAllCertsPolicy : ICertificatePolicy { + public bool CheckValidationResult( ServicePoint srvPoint, X509Certificate certificate, WebRequest request, int certificateProblem) { + return true; + } +} +'@ + Add-Type -TypeDefinition $type -ErrorAction SilentlyContinue + } Catch { + if ($error[0].Exception -ne "Cannot add type. The type name 'TrustAllCertsPolicy already exists.") { + Write-Debug $error[0] + } + } + [System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy + + } + # If we are authenticating to the ZVM, Use this block to use Invoke-WebRequest and format the Headers as expected. + if ($uri -eq "session/add" -and $method -eq "POST") { + $apiRequestResults = Invoke-WebRequest -Uri $submittedURI -Headers $script:zvmHeaders -Method $method -Body $body -ContentType $contentType -Credential $credential -TimeoutSec 100 + $responseHeaders = @{} + $responseHeaders['x-zerto-session'] = @($apiRequestResults.Headers['x-zerto-session']) + } elseif ($method -ne "GET") { + # If the Method is something other than 'GET' use this call with a body parameter + $apiRequestResults = Invoke-RestMethod -Uri $submittedURI -Headers $script:zvmHeaders -Method $method -Body $body -ContentType $contentType -Credential $credential -TimeoutSec 100 + } else { + # If the Method we are calling is 'GET' use this call without a body parameter + $apiRequestResults = Invoke-RestMethod -Uri $submittedURI -Headers $script:zvmHeaders -Method $method -ContentType $contentType -Credential $credential -TimeoutSec 100 + } + } } catch { # If an error is encountered, Catch Write-Error -ErrorRecord $_ -ErrorAction $callerErrorActionPreference From 8763be768d572824559c57c771c285ad46e23cc0 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 31 May 2019 10:01:50 -0400 Subject: [PATCH 011/479] Update AzPipelines to run PowerShell 5.1 Tests --- azure-pipelines.yml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 46201e1..e1f7ae8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,23 +5,40 @@ name: $(TeamProject)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.rr) -# Trigger CI on commit to master and develop branches +# Trigger CI on commit to master branch trigger: branches: include: - master - - develop - - TestingBranch + - PowerShellBackPort # Trigger CI on pull requests to master and develop branches pr: - master - - develop - - TestingBranch jobs: - # Windows Build Job + # Windows PowerShell 5.1 Build Job - job: Build_PS_Win2016 + timeoutInMinutes: 10 + cancelTimeoutInMinutes: 2 + pool: + vmImage: vs2017-win2016 + steps: + # Run build.ps1 script in PowerShell Core + - powershell: | + .\build.ps1 -Verbose + displayName: 'Build and Test' + # Upload test results to Azure Pipeline + - task: PublishTestResults@2 + inputs: + testRunner: 'NUnit' + testResultsFiles: '**/TestResults.xml' + testRunTitle: 'PS_Win2016' + displayName: 'Publish Test Results' + condition: always() + + # Windows PowerShell Core Build Job + - job: Build_PSCore_Win2016 timeoutInMinutes: 10 cancelTimeoutInMinutes: 2 pool: From 6b73f0bcce2ee0cb6361beabbc14fe7f75c1eabc Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 31 May 2019 10:32:12 -0400 Subject: [PATCH 012/479] Update GitHub URLs to Reflect ZertoPublic Project --- README.md | 4 +- ZertoApiWrapper.build.ps1 | 4 +- .../Public/en-us/ZertoApiWrapper-help.xml | 96 +++++++++---------- docs/Add-ZertoPeerSite.md | 2 +- docs/Checkpoint-ZertoVpg.md | 2 +- docs/Connect-ZertoServer.md | 2 +- docs/Disconnect-ZertoServer.md | 2 +- docs/Edit-ZertoVra.md | 2 +- docs/Export-ZertoVpg.md | 2 +- docs/Get-ZertoAlert.md | 2 +- docs/Get-ZertoDatastore.md | 2 +- docs/Get-ZertoEvent.md | 2 +- docs/Get-ZertoLicense.md | 2 +- docs/Get-ZertoLocalSite.md | 2 +- docs/Get-ZertoPeerSite.md | 2 +- docs/Get-ZertoProtectedVm.md | 2 +- docs/Get-ZertoRecoveryReport.md | 2 +- docs/Get-ZertoResourcesReport.md | 2 +- docs/Get-ZertoServiceProfile.md | 2 +- docs/Get-ZertoTask.md | 2 +- docs/Get-ZertoUnprotectedVm.md | 2 +- docs/Get-ZertoVirtualizationSite.md | 2 +- docs/Get-ZertoVolume.md | 2 +- docs/Get-ZertoVpg.md | 2 +- docs/Get-ZertoVpgSetting.md | 2 +- docs/Get-ZertoVra.md | 2 +- docs/Get-ZertoZorg.md | 2 +- docs/Get-ZertoZsspSession.md | 2 +- docs/Import-ZertoVpg.md | 2 +- docs/Install-ZertoVra.md | 2 +- docs/Invoke-ZertoFailover.md | 2 +- docs/Invoke-ZertoFailoverCommit.md | 2 +- docs/Invoke-ZertoFailoverRollback.md | 2 +- docs/Invoke-ZertoForceSync.md | 2 +- docs/Invoke-ZertoMove.md | 2 +- docs/Invoke-ZertoMoveRollback.md | 2 +- docs/New-ZertoVpg.md | 4 +- docs/New-ZertoVpgSettingsIdentifier.md | 2 +- docs/Remove-ZertoPeerSite.md | 4 +- docs/Remove-ZertoVpg.md | 2 +- docs/Resume-ZertoVpg.md | 2 +- docs/Save-ZertoVpgSetting.md | 2 +- docs/Set-ZertoAlert.md | 2 +- docs/Set-ZertoLicense.md | 2 +- docs/Start-ZertoCloneVpg.md | 2 +- docs/Start-ZertoFailoverTest.md | 2 +- docs/Stop-ZertoCloneVpg.md | 2 +- docs/Stop-ZertoFailoverTest.md | 2 +- docs/Suspend-ZertoVpg.md | 2 +- docs/Uninstall-ZertoVra.md | 2 +- 50 files changed, 101 insertions(+), 101 deletions(-) diff --git a/README.md b/README.md index a6ba2f9..9d58ada 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,8 @@ If you are using this as part of a larger script, I highly suggest explicitly en ## Recent Updates -- March 15th, 2019: Implement Export and Import Functionality. Please See [Export-ZertoVpg Help](https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Export-ZertoVpg.md) and [Import-ZertoVpg Help](https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Import-ZertoVpg.md) for assistance. No current pre-seed support. -- March 11th, 2019: Create basic VPG completed. Please see [New-ZertoVpg Help](https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md) +- March 15th, 2019: Implement Export and Import Functionality. Please See [Export-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Export-ZertoVpg.md) and [Import-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVpg.md) for assistance. No current pre-seed support. +- March 11th, 2019: Create basic VPG completed. Please see [New-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md) ## TODO diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 3ca2fb5..448cab0 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -103,8 +103,8 @@ task CreatePsd1ForRelease CleanTemp, { Copyright = '(c) {0} Wes Carroll. All rights reserved.' -f $(Get-Date -format 'yyyy') Description = 'Windows PowerShell and PowerShell Core API Wrapper Module for Zerto Virtual Manager' PowerShellVersion = '5.1.0' - ProjectUri = 'https://github.com/wcarroll/ZertoApiWrapper' - LicenseUri = 'https://github.com/wcarroll/ZertoApiWrapper/blob/master/LICENSE' + ProjectUri = 'https://github.com/ZertoPublic/ZertoApiWrapper' + LicenseUri = 'https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/LICENSE' Tags = @("Zerto", "Automation") FunctionsToExport = $functionsToExport CmdletsToExport = @() diff --git a/ZertoApiWrapper/Public/en-us/ZertoApiWrapper-help.xml b/ZertoApiWrapper/Public/en-us/ZertoApiWrapper-help.xml index 6ae1461..51251ea 100644 --- a/ZertoApiWrapper/Public/en-us/ZertoApiWrapper-help.xml +++ b/ZertoApiWrapper/Public/en-us/ZertoApiWrapper-help.xml @@ -150,7 +150,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Add-ZertoPeerSite.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Add-ZertoPeerSite.md Zerto REST API Peer Site End Point Documentation @@ -262,7 +262,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Checkpoint-ZertoVpg.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Checkpoint-ZertoVpg.md Zerto REST API VPG End Point Documentation @@ -421,7 +421,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Connect-ZertoServer.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Connect-ZertoServer.md Zerto REST API Session End Point Documentation @@ -492,7 +492,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Disconnect-ZertoServer.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Disconnect-ZertoServer.md Zerto REST API Session End Point Documentation @@ -746,7 +746,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Edit-ZertoVra.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Edit-ZertoVra.md Zerto REST API VRA End Point Documentation @@ -903,7 +903,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/Master/docs/Export-ZertoVpg.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Export-ZertoVpg.md Zerto REST API VPG Settings End Point Documentation @@ -1325,7 +1325,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoAlert.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoAlert.md Zerto REST API Alerts End Point Documentation @@ -1420,7 +1420,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoDatastore.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoDatastore.md Zerto REST API Datastore Information End Point Documentation @@ -1916,7 +1916,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoEvent.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoEvent.md Zerto REST API Events End Point Documentation @@ -1979,7 +1979,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoLicense.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoLicense.md Zerto REST API License Information @@ -2066,7 +2066,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoLocalSite.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoLocalSite.md Zerto REST API Local Site End Point Documentation @@ -2310,7 +2310,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoPeerSite.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoPeerSite.md Zerto REST API Peer Site End Point Documentation @@ -2663,7 +2663,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoProtectedVm.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoProtectedVm.md Zerto REST API Protected VMs End Point Documentation @@ -2926,7 +2926,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoRecoveryReport.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoRecoveryReport.md Zerto REST API Recovery Report End Point Documentation @@ -3399,7 +3399,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoResourcesReport.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoResourcesReport.md Zerto REST API Resources Report End Point Documentation @@ -3514,7 +3514,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoServiceProfile.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoServiceProfile.md Zerto REST API Service Profile End Point Documentation @@ -3782,7 +3782,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoTask.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoTask.md Zerto REST API Task End Point Documentation @@ -3845,7 +3845,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoUnprotectedVm.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoUnprotectedVm.md Zerto REST API Virtualization Sites End Point Documentation @@ -4332,7 +4332,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoVirtualizationSite.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoVirtualizationSite.md Zerto REST API Virtualization Sites End Point Documentation @@ -4530,7 +4530,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoVolume.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoVolume.md Zerto REST API Volumes End Point Documentation @@ -5221,7 +5221,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoVpg.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoVpg.md Zerto REST API VPG End Point Documentation @@ -6035,7 +6035,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoVpgSetting.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoVpgSetting.md Zerto REST API VPG Settings End Point Documentation @@ -6401,7 +6401,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoVra.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoVra.md Zerto REST API VRA End Point Documentation @@ -6496,7 +6496,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoZorg.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoZorg.md Zerto REST API ZOrg End Point Documentation @@ -6584,7 +6584,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertpZsspSession.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertpZsspSession.md Zerto REST API ZSSP Session End Point Documentation @@ -6672,7 +6672,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/Master/docs/Import-ZertoVpg.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Import-ZertoVpg.md Zerto REST API VPG Settings End Point Documentation @@ -7089,7 +7089,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Install-ZertoVra.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Install-ZertoVra.md Zerto REST API VRA End Point Documentation @@ -7386,7 +7386,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Invoke-ZertoFailover.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZertoFailover.md Zerto REST API VPG End Point Documentation @@ -7504,7 +7504,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Invoke-ZertoFailoverCommit.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZertoFailoverCommit.md Zerto REST API VPG End Point Documentation @@ -7592,7 +7592,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Invoke-ZertoFailoverRollback.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZertoFailoverRollback.md Zerto REST API VPG End Point Documentation @@ -7680,7 +7680,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Invoke-ZertoForceSync.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZertoForceSync.md Zerto REST API VPG End Point Documentation @@ -8046,7 +8046,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Invoke-ZertoMove.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZertoMove.md Zerto REST API VPG End Point Documentation @@ -8360,7 +8360,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Invoke-ZertoMoveRollback.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZertoMoveRollback.md Zerto REST API VPG End Point Documentation @@ -10299,7 +10299,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md Zerto REST API VPG Settings End Point Documentation @@ -10488,7 +10488,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/Master/docs/New-ZertoVpgSettingsIdentifier.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/New-ZertoVpgSettingsIdentifier.md Zerto REST API VPG Settings End Point Documentation @@ -10761,7 +10761,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Remove-ZertoPeerSite.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Remove-ZertoPeerSite.md Zerto REST API Peer Site End Point Documentation @@ -11033,7 +11033,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Remove-ZertoVpg.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Remove-ZertoVpg.md Zerto REST API VPG End Point Documentation @@ -11121,7 +11121,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Resume-ZertoVpg.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Resume-ZertoVpg.md Zerto REST API VPG End Point Documentation @@ -11255,7 +11255,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Save-ZertoVpgSetting.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Save-ZertoVpgSetting.md Zerto REST API VPG Settings End Point Documentation @@ -11479,7 +11479,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Set-ZertoAlert.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Set-ZertoAlert.md Zerto REST API Alerts End Point Documentation @@ -11613,7 +11613,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Set-ZertoLicense.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Set-ZertoLicense.md Zerto REST API License Information @@ -11819,7 +11819,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Start-ZertoCloneVpg.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Start-ZertoCloneVpg.md Zerto REST API VPG End Point Documentation @@ -12001,7 +12001,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Start-ZertoFailoverTest.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Start-ZertoFailoverTest.md Zerto REST API VPG End Point Documentation @@ -12135,7 +12135,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Stop-ZertoCloneVpg.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Stop-ZertoCloneVpg.md Zerto REST API VPG End Point Documentation @@ -12317,7 +12317,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Stop-ZertoFailoverTest.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Stop-ZertoFailoverTest.md Zerto REST API VPG End Point Documentation @@ -12405,7 +12405,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Suspend-ZertoVpg.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Suspend-ZertoVpg.md Zerto REST API VPG End Point Documentation @@ -12493,7 +12493,7 @@ Online Version: - https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Uninstall-ZertoVra.md + https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Uninstall-ZertoVra.md Zerto REST API VRA End Point Documentation @@ -12501,4 +12501,4 @@ - \ No newline at end of file + diff --git a/docs/Add-ZertoPeerSite.md b/docs/Add-ZertoPeerSite.md index c05f0ef..2589547 100644 --- a/docs/Add-ZertoPeerSite.md +++ b/docs/Add-ZertoPeerSite.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Add-ZertoPeerSite.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Add-ZertoPeerSite.md schema: 2.0.0 --- diff --git a/docs/Checkpoint-ZertoVpg.md b/docs/Checkpoint-ZertoVpg.md index 3c08107..d7cfbf5 100644 --- a/docs/Checkpoint-ZertoVpg.md +++ b/docs/Checkpoint-ZertoVpg.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Checkpoint-ZertoVpg.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Checkpoint-ZertoVpg.md schema: 2.0.0 --- diff --git a/docs/Connect-ZertoServer.md b/docs/Connect-ZertoServer.md index 810bdb0..8c657b7 100644 --- a/docs/Connect-ZertoServer.md +++ b/docs/Connect-ZertoServer.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Connect-ZertoServer.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Connect-ZertoServer.md schema: 2.0.0 --- diff --git a/docs/Disconnect-ZertoServer.md b/docs/Disconnect-ZertoServer.md index 814d8cc..9cb7188 100644 --- a/docs/Disconnect-ZertoServer.md +++ b/docs/Disconnect-ZertoServer.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Disconnect-ZertoServer.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Disconnect-ZertoServer.md schema: 2.0.0 --- diff --git a/docs/Edit-ZertoVra.md b/docs/Edit-ZertoVra.md index be40e81..37b894a 100644 --- a/docs/Edit-ZertoVra.md +++ b/docs/Edit-ZertoVra.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Edit-ZertoVra.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Edit-ZertoVra.md schema: 2.0.0 --- diff --git a/docs/Export-ZertoVpg.md b/docs/Export-ZertoVpg.md index 52e6dc5..8a1ee4c 100644 --- a/docs/Export-ZertoVpg.md +++ b/docs/Export-ZertoVpg.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/Master/docs/Export-ZertoVpg.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Export-ZertoVpg.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoAlert.md b/docs/Get-ZertoAlert.md index 1dfd749..8df174b 100644 --- a/docs/Get-ZertoAlert.md +++ b/docs/Get-ZertoAlert.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoAlert.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoAlert.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoDatastore.md b/docs/Get-ZertoDatastore.md index 8db8390..d3bc777 100644 --- a/docs/Get-ZertoDatastore.md +++ b/docs/Get-ZertoDatastore.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoDatastore.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoDatastore.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoEvent.md b/docs/Get-ZertoEvent.md index 3e0c546..79b37d7 100644 --- a/docs/Get-ZertoEvent.md +++ b/docs/Get-ZertoEvent.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoEvent.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoEvent.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoLicense.md b/docs/Get-ZertoLicense.md index f864948..74ca60b 100644 --- a/docs/Get-ZertoLicense.md +++ b/docs/Get-ZertoLicense.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoLicense.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoLicense.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoLocalSite.md b/docs/Get-ZertoLocalSite.md index ad0fdd9..b094547 100644 --- a/docs/Get-ZertoLocalSite.md +++ b/docs/Get-ZertoLocalSite.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoLocalSite.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoLocalSite.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoPeerSite.md b/docs/Get-ZertoPeerSite.md index 9142de4..828031b 100644 --- a/docs/Get-ZertoPeerSite.md +++ b/docs/Get-ZertoPeerSite.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoPeerSite.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoPeerSite.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoProtectedVm.md b/docs/Get-ZertoProtectedVm.md index 1d814ea..ec1172a 100644 --- a/docs/Get-ZertoProtectedVm.md +++ b/docs/Get-ZertoProtectedVm.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoProtectedVm.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoProtectedVm.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoRecoveryReport.md b/docs/Get-ZertoRecoveryReport.md index 0a586f7..488169d 100644 --- a/docs/Get-ZertoRecoveryReport.md +++ b/docs/Get-ZertoRecoveryReport.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoRecoveryReport.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoRecoveryReport.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoResourcesReport.md b/docs/Get-ZertoResourcesReport.md index bf12822..ab0476f 100644 --- a/docs/Get-ZertoResourcesReport.md +++ b/docs/Get-ZertoResourcesReport.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoResourcesReport.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoResourcesReport.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoServiceProfile.md b/docs/Get-ZertoServiceProfile.md index 98a0c97..174ae17 100644 --- a/docs/Get-ZertoServiceProfile.md +++ b/docs/Get-ZertoServiceProfile.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoServiceProfile.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoServiceProfile.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoTask.md b/docs/Get-ZertoTask.md index 8e10bcd..e8e1410 100644 --- a/docs/Get-ZertoTask.md +++ b/docs/Get-ZertoTask.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoTask.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoTask.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoUnprotectedVm.md b/docs/Get-ZertoUnprotectedVm.md index ba21f4f..5da328b 100644 --- a/docs/Get-ZertoUnprotectedVm.md +++ b/docs/Get-ZertoUnprotectedVm.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoUnprotectedVm.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoUnprotectedVm.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoVirtualizationSite.md b/docs/Get-ZertoVirtualizationSite.md index 88f78cf..815019c 100644 --- a/docs/Get-ZertoVirtualizationSite.md +++ b/docs/Get-ZertoVirtualizationSite.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoVirtualizationSite.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoVirtualizationSite.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoVolume.md b/docs/Get-ZertoVolume.md index 5663b51..57c5d8e 100644 --- a/docs/Get-ZertoVolume.md +++ b/docs/Get-ZertoVolume.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoVolume.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoVolume.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoVpg.md b/docs/Get-ZertoVpg.md index d574889..f453476 100644 --- a/docs/Get-ZertoVpg.md +++ b/docs/Get-ZertoVpg.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoVpg.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoVpg.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoVpgSetting.md b/docs/Get-ZertoVpgSetting.md index e9a05dd..d7e0411 100644 --- a/docs/Get-ZertoVpgSetting.md +++ b/docs/Get-ZertoVpgSetting.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoVpgSetting.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoVpgSetting.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoVra.md b/docs/Get-ZertoVra.md index 676e491..c2c8325 100644 --- a/docs/Get-ZertoVra.md +++ b/docs/Get-ZertoVra.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoVra.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoVra.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoZorg.md b/docs/Get-ZertoZorg.md index 5ddcd16..ebd30f9 100644 --- a/docs/Get-ZertoZorg.md +++ b/docs/Get-ZertoZorg.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertoZorg.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoZorg.md schema: 2.0.0 --- diff --git a/docs/Get-ZertoZsspSession.md b/docs/Get-ZertoZsspSession.md index 09ce28b..9c698a9 100644 --- a/docs/Get-ZertoZsspSession.md +++ b/docs/Get-ZertoZsspSession.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Get-ZertpZsspSession.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertpZsspSession.md schema: 2.0.0 --- diff --git a/docs/Import-ZertoVpg.md b/docs/Import-ZertoVpg.md index 6d42d89..979a347 100644 --- a/docs/Import-ZertoVpg.md +++ b/docs/Import-ZertoVpg.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/Master/docs/Import-ZertoVpg.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Import-ZertoVpg.md schema: 2.0.0 --- diff --git a/docs/Install-ZertoVra.md b/docs/Install-ZertoVra.md index 1e2527e..ddd4a18 100644 --- a/docs/Install-ZertoVra.md +++ b/docs/Install-ZertoVra.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Install-ZertoVra.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Install-ZertoVra.md schema: 2.0.0 --- diff --git a/docs/Invoke-ZertoFailover.md b/docs/Invoke-ZertoFailover.md index 41edbae..ac68d01 100644 --- a/docs/Invoke-ZertoFailover.md +++ b/docs/Invoke-ZertoFailover.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Invoke-ZertoFailover.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZertoFailover.md schema: 2.0.0 --- diff --git a/docs/Invoke-ZertoFailoverCommit.md b/docs/Invoke-ZertoFailoverCommit.md index 9f1b3d1..627ece1 100644 --- a/docs/Invoke-ZertoFailoverCommit.md +++ b/docs/Invoke-ZertoFailoverCommit.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Invoke-ZertoFailoverCommit.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZertoFailoverCommit.md schema: 2.0.0 --- diff --git a/docs/Invoke-ZertoFailoverRollback.md b/docs/Invoke-ZertoFailoverRollback.md index 51c8a09..8757c40 100644 --- a/docs/Invoke-ZertoFailoverRollback.md +++ b/docs/Invoke-ZertoFailoverRollback.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Invoke-ZertoFailoverRollback.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZertoFailoverRollback.md schema: 2.0.0 --- diff --git a/docs/Invoke-ZertoForceSync.md b/docs/Invoke-ZertoForceSync.md index 2d88313..a124bb3 100644 --- a/docs/Invoke-ZertoForceSync.md +++ b/docs/Invoke-ZertoForceSync.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Invoke-ZertoForceSync.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZertoForceSync.md schema: 2.0.0 --- diff --git a/docs/Invoke-ZertoMove.md b/docs/Invoke-ZertoMove.md index 6239eda..420088e 100644 --- a/docs/Invoke-ZertoMove.md +++ b/docs/Invoke-ZertoMove.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Invoke-ZertoMove.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZertoMove.md schema: 2.0.0 --- diff --git a/docs/Invoke-ZertoMoveRollback.md b/docs/Invoke-ZertoMoveRollback.md index 4df0772..2229cc1 100644 --- a/docs/Invoke-ZertoMoveRollback.md +++ b/docs/Invoke-ZertoMoveRollback.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Invoke-ZertoMoveRollback.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZertoMoveRollback.md schema: 2.0.0 --- diff --git a/docs/New-ZertoVpg.md b/docs/New-ZertoVpg.md index cd68b3d..c288dbd 100644 --- a/docs/New-ZertoVpg.md +++ b/docs/New-ZertoVpg.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md schema: 2.0.0 --- @@ -537,4 +537,4 @@ Vpg Settings Identifier ## RELATED LINKS -[Zerto REST API VPG Settings End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/RestfulAPIs/StatusAPIs.5.108.html#) \ No newline at end of file +[Zerto REST API VPG Settings End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/RestfulAPIs/StatusAPIs.5.108.html#) diff --git a/docs/New-ZertoVpgSettingsIdentifier.md b/docs/New-ZertoVpgSettingsIdentifier.md index f703f1b..8128a62 100644 --- a/docs/New-ZertoVpgSettingsIdentifier.md +++ b/docs/New-ZertoVpgSettingsIdentifier.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/Master/docs/New-ZertoVpgSettingsIdentifier.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/New-ZertoVpgSettingsIdentifier.md schema: 2.0.0 --- diff --git a/docs/Remove-ZertoPeerSite.md b/docs/Remove-ZertoPeerSite.md index 9475bdc..a42c84b 100644 --- a/docs/Remove-ZertoPeerSite.md +++ b/docs/Remove-ZertoPeerSite.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Remove-ZertoPeerSite.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Remove-ZertoPeerSite.md schema: 2.0.0 --- @@ -160,4 +160,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS -[Zerto REST API Peer Site End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.044.html%23) \ No newline at end of file +[Zerto REST API Peer Site End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.044.html%23) diff --git a/docs/Remove-ZertoVpg.md b/docs/Remove-ZertoVpg.md index 86ef8db..c365cd7 100644 --- a/docs/Remove-ZertoVpg.md +++ b/docs/Remove-ZertoVpg.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Remove-ZertoVpg.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Remove-ZertoVpg.md schema: 2.0.0 --- diff --git a/docs/Resume-ZertoVpg.md b/docs/Resume-ZertoVpg.md index 93e9f43..6e52056 100644 --- a/docs/Resume-ZertoVpg.md +++ b/docs/Resume-ZertoVpg.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Resume-ZertoVpg.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Resume-ZertoVpg.md schema: 2.0.0 --- diff --git a/docs/Save-ZertoVpgSetting.md b/docs/Save-ZertoVpgSetting.md index b0305e1..cd2cc59 100644 --- a/docs/Save-ZertoVpgSetting.md +++ b/docs/Save-ZertoVpgSetting.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Save-ZertoVpgSetting.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Save-ZertoVpgSetting.md schema: 2.0.0 --- diff --git a/docs/Set-ZertoAlert.md b/docs/Set-ZertoAlert.md index 9a7cd65..5ceb8ba 100644 --- a/docs/Set-ZertoAlert.md +++ b/docs/Set-ZertoAlert.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Set-ZertoAlert.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Set-ZertoAlert.md schema: 2.0.0 --- diff --git a/docs/Set-ZertoLicense.md b/docs/Set-ZertoLicense.md index a604a13..a353532 100644 --- a/docs/Set-ZertoLicense.md +++ b/docs/Set-ZertoLicense.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Set-ZertoLicense.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Set-ZertoLicense.md schema: 2.0.0 --- diff --git a/docs/Start-ZertoCloneVpg.md b/docs/Start-ZertoCloneVpg.md index 6c0cedb..9ab204d 100644 --- a/docs/Start-ZertoCloneVpg.md +++ b/docs/Start-ZertoCloneVpg.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Start-ZertoCloneVpg.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Start-ZertoCloneVpg.md schema: 2.0.0 --- diff --git a/docs/Start-ZertoFailoverTest.md b/docs/Start-ZertoFailoverTest.md index 7899454..1299291 100644 --- a/docs/Start-ZertoFailoverTest.md +++ b/docs/Start-ZertoFailoverTest.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Start-ZertoFailoverTest.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Start-ZertoFailoverTest.md schema: 2.0.0 --- diff --git a/docs/Stop-ZertoCloneVpg.md b/docs/Stop-ZertoCloneVpg.md index 5e96bd7..2c28b8d 100644 --- a/docs/Stop-ZertoCloneVpg.md +++ b/docs/Stop-ZertoCloneVpg.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Stop-ZertoCloneVpg.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Stop-ZertoCloneVpg.md schema: 2.0.0 --- diff --git a/docs/Stop-ZertoFailoverTest.md b/docs/Stop-ZertoFailoverTest.md index f4ab758..5a52590 100644 --- a/docs/Stop-ZertoFailoverTest.md +++ b/docs/Stop-ZertoFailoverTest.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Stop-ZertoFailoverTest.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Stop-ZertoFailoverTest.md schema: 2.0.0 --- diff --git a/docs/Suspend-ZertoVpg.md b/docs/Suspend-ZertoVpg.md index d1336a2..466b6d7 100644 --- a/docs/Suspend-ZertoVpg.md +++ b/docs/Suspend-ZertoVpg.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Suspend-ZertoVpg.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Suspend-ZertoVpg.md schema: 2.0.0 --- diff --git a/docs/Uninstall-ZertoVra.md b/docs/Uninstall-ZertoVra.md index b19e8f1..cae5377 100644 --- a/docs/Uninstall-ZertoVra.md +++ b/docs/Uninstall-ZertoVra.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/wcarroll/ZertoApiWrapper/blob/master/docs/Uninstall-ZertoVra.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Uninstall-ZertoVra.md schema: 2.0.0 --- From b18da2e79bede88219dfdd2de6921ba6ceffd4df Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 31 May 2019 17:03:10 -0400 Subject: [PATCH 013/479] Refelect 5.1 Update --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9d58ada..42e6b22 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ZertoApiWrapper -PowerShell Core wrapper for Zerto Virtual Manager API +PowerShell wrapper for Zerto Virtual Manager API ## Current Build Status @@ -54,6 +54,7 @@ If you are using this as part of a larger script, I highly suggest explicitly en ## Recent Updates +- May 31st, 2019: Implement logic to allow use of this module in both Windows PowerShell 5.1 and PowerShell Core. - March 15th, 2019: Implement Export and Import Functionality. Please See [Export-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Export-ZertoVpg.md) and [Import-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVpg.md) for assistance. No current pre-seed support. - March 11th, 2019: Create basic VPG completed. Please see [New-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md) From 5713fcd02ceb0cdfec6593f42b3cab589fe594f7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 31 May 2019 17:03:26 -0400 Subject: [PATCH 014/479] Getting Ready for Release to PSGallery --- RELEASENOTES.md | 6 ++---- version.txt | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index cfd8e79..3b4868a 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,6 +1,4 @@ -* New Feature 1 -* New Feature 2 - * New SubFeature 1 -* What is happening??? +* Initial Release +* Updated 'Invoke-ZertoRestRequest' to work in Powershell 5.1 as well as Powershell core diff --git a/version.txt b/version.txt index 6e8bf73..3eefcb9 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.1.0 +1.0.0 From ca5d357d2f1238066d4d4f0a8068c15aae820fc6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 3 Jun 2019 07:11:15 -0400 Subject: [PATCH 015/479] Create Invoke-ZARestRequest.ps1 --- .../Private/Invoke-ZARestRequest.ps1 | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 diff --git a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 new file mode 100644 index 0000000..599bad8 --- /dev/null +++ b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 @@ -0,0 +1,20 @@ +function Invoke-ZARestRequest { + [cmdletbinding()] + param( + [string]$uri, + [string]$method = "GET", + [string]$body, + [string]$contentType = "application/json" + ) + + $submittedUri = "https://analytics.api.zerto.com/v2/{0}" -f $uri + if ($PSVersionTable.PSVersion.Major -ge 6) { + Invoke-RestMethod -Uri $submittedUri -Method $method -Body $body -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 + } else { + if ([String]::IsNullOrEmpty($body)) { + Invoke-RestMethod -Uri $submittedUri -Method $method -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 + } else { + Invoke-RestMethod -Uri $submittedUri -Method $method -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 -Body $body + } + } +} \ No newline at end of file From a1a4a7882060ac41fe5c262d9ae1ada3c576e18b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 3 Jun 2019 07:11:20 -0400 Subject: [PATCH 016/479] Create Connect-ZertoAnalytics.ps1 --- .../Public/Connect-ZertoAnalytics.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 diff --git a/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 new file mode 100644 index 0000000..698d957 --- /dev/null +++ b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 @@ -0,0 +1,19 @@ +function Connect-ZertoAnalytics { + [cmdletbinding()] + param( + [Parameter( + Mandatory = $true, + HelpMessage = "PSCredential Object containing username and password authorized for the Zerto Analytics site", + Position = 0 + )] + [System.Management.Automation.PSCredential]$credential + ) + + $uri = "auth/token" + Set-Variable -Name zaHeaders -Scope Script -Value @{"Accept" = "application/json" } + Set-Variable -Name zaLastActionTime -Scope Script -Value $(Get-date).Ticks + $body = @{"username" = $credential.UserName; "password" = $credential.GetNetworkCredential().password } + $result = Invoke-ZARestRequest -Uri $uri -body $($body | ConvertTo-Json) -Method POST + $Script:zaHeaders["Authorization"] = "Bearer $($result.Token)" + $Script:zaHeaders +} \ No newline at end of file From b22481e3b0f1ee285e2e6772778e7ab844cc05ef Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 3 Jun 2019 07:11:33 -0400 Subject: [PATCH 017/479] Create Get-ZALicense.ps1 --- ZertoApiWrapper/Public/Get-ZALicense.ps1 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 ZertoApiWrapper/Public/Get-ZALicense.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZALicense.ps1 b/ZertoApiWrapper/Public/Get-ZALicense.ps1 new file mode 100644 index 0000000..02c8fd1 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZALicense.ps1 @@ -0,0 +1,4 @@ +function Get-ZALicense { + $uri = "licenses" + Invoke-ZARestRequest -uri $uri +} \ No newline at end of file From 14424c6b51db5de1af77004036d2c51e8af98f30 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:07:37 -0400 Subject: [PATCH 018/479] Add External Help File --- ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 index 698d957..2c8e95f 100644 --- a/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 +++ b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 @@ -1,3 +1,4 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Connect-ZertoAnalytics { [cmdletbinding()] param( From 1ef5d63cf7adeff2086d5ec29aeb86dd13573bcf Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:07:58 -0400 Subject: [PATCH 019/479] Create Invoke-ZARestRequest.Tests.ps1 --- Tests/Private/Invoke-ZARestRequest.Tests.ps1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Tests/Private/Invoke-ZARestRequest.Tests.ps1 diff --git a/Tests/Private/Invoke-ZARestRequest.Tests.ps1 b/Tests/Private/Invoke-ZARestRequest.Tests.ps1 new file mode 100644 index 0000000..984d682 --- /dev/null +++ b/Tests/Private/Invoke-ZARestRequest.Tests.ps1 @@ -0,0 +1,17 @@ +$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper' +$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.' +$file = Get-ChildItem "$filePath\$fileName" +. $file.FullName + +Describe $file.BaseName -Tag Unit { + it "file should exist" { + $file.FullName | should exist + } + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file.FullName -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} \ No newline at end of file From 947fbe64681fb0b283931fb990b94474ae4a0dda Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:08:06 -0400 Subject: [PATCH 020/479] Create Connect-ZertoAnalytics.Tests.ps1 --- Tests/Public/Connect-ZertoAnalytics.Tests.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Tests/Public/Connect-ZertoAnalytics.Tests.ps1 diff --git a/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 new file mode 100644 index 0000000..50d2f9d --- /dev/null +++ b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} \ No newline at end of file From ce5a37ceb62a5da601fbaef570943e11d0660089 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:08:45 -0400 Subject: [PATCH 021/479] Make into an advanced function. --- ZertoApiWrapper/Public/Get-ZALicense.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ZertoApiWrapper/Public/Get-ZALicense.ps1 b/ZertoApiWrapper/Public/Get-ZALicense.ps1 index 02c8fd1..bd1bd94 100644 --- a/ZertoApiWrapper/Public/Get-ZALicense.ps1 +++ b/ZertoApiWrapper/Public/Get-ZALicense.ps1 @@ -1,4 +1,7 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Get-ZALicense { + [cmdletbinding()] + param() $uri = "licenses" Invoke-ZARestRequest -uri $uri } \ No newline at end of file From 04b8b9837b442772d46b9c5852bd3cc5e59c412b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:12:36 -0400 Subject: [PATCH 022/479] Create Get-ZALicense.Tests.ps1 --- Tests/Public/Get-ZALicense.Tests.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Tests/Public/Get-ZALicense.Tests.ps1 diff --git a/Tests/Public/Get-ZALicense.Tests.ps1 b/Tests/Public/Get-ZALicense.Tests.ps1 new file mode 100644 index 0000000..50d2f9d --- /dev/null +++ b/Tests/Public/Get-ZALicense.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} \ No newline at end of file From 50354f10cf02fce296edcbfd629f6951d2f76b5a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:13:31 -0400 Subject: [PATCH 023/479] Create ZAMonitoring Function and Tests --- Tests/Public/Get-ZAMonitoring.Tests.ps1 | 19 +++++++++++++++++++ ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 Tests/Public/Get-ZAMonitoring.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 diff --git a/Tests/Public/Get-ZAMonitoring.Tests.ps1 b/Tests/Public/Get-ZAMonitoring.Tests.ps1 new file mode 100644 index 0000000..50d2f9d --- /dev/null +++ b/Tests/Public/Get-ZAMonitoring.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} \ No newline at end of file diff --git a/ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 b/ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 new file mode 100644 index 0000000..a196baa --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 @@ -0,0 +1,18 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAMonitoring { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the user's statistics for a single account. If the ZORG identifier is omitted, statistics related to all sites, for a single account, is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + $uri = "monitoring/" + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ){ + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier} + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}" -f $uri, $filterString + } + Invoke-ZARestRequest -uri $uri +} \ No newline at end of file From 58a3500dddc14a4e4171fbbfb2c42e6247e5dc88 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:16:43 -0400 Subject: [PATCH 024/479] Create Get-ZAAlert Function and Tests --- Tests/Public/Get-ZAAlert.Tests.ps1 | 19 +++++++++++++ ZertoApiWrapper/Public/Get-ZAAlert.ps1 | 38 ++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 Tests/Public/Get-ZAAlert.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAAlert.ps1 diff --git a/Tests/Public/Get-ZAAlert.Tests.ps1 b/Tests/Public/Get-ZAAlert.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAAlert.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAAlert.ps1 b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 new file mode 100644 index 0000000..f47ca3f --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 @@ -0,0 +1,38 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAAlert { + [cmdletbinding( DefaultParameterSetName = "zOrg")] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the alert list. If the ZORG identifier is omitted, a list of all the alerts is retrieved.", + ParameterSetName = "zOrg" + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The maximum number of alerts to return.", + ParameterSetName = "zOrg" + )] + [ValidateRange(1, 1000000)] + [int]$limitTo, + [Parameter( + HelpMessage = "The VPG Idnetifier", + ParameterSetName = "vpgId" + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier + ) + $uri = "monitoring/alerts" + switch ($PSCmdlet.ParameterSetName) { + zOrg { + if ( $PSBoundParameters.Keys.Count -gt 0 ) { + $filterString = Get-ZertoApiFilter -filterTable $PSBoundParameters + $uri = "{0}{1}" -f $uri, $filterString + } + } + + vpgId { + $uri = "{0}/{1}" -f $uri, $vpgIdentifier + } + } + Invoke-ZARestRequest -uri $uri +} From ee7770e1e96d3f360ff1004ef2cc9eede7724fc5 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:17:41 -0400 Subject: [PATCH 025/479] Create Get-ZAAlertAggregation Function and Tests --- Tests/Public/Get-ZAAlertAggregation.Tests.ps1 | 19 ++++++++++++++++++ .../Public/Get-ZAAlertAggregation.ps1 | 20 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Tests/Public/Get-ZAAlertAggregation.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 diff --git a/Tests/Public/Get-ZAAlertAggregation.Tests.ps1 b/Tests/Public/Get-ZAAlertAggregation.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAAlertAggregation.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 b/ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 new file mode 100644 index 0000000..7b82559 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 @@ -0,0 +1,20 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAAlertAggeration { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the alert count. If the ZORG identifier is omitted, retrieves all alerts sorted by entity and by type." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + $uri = "monitoring/alerts" + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}&format=aggregations" -f $uri, $filterString + } else { + $uri = "{0}?format=aggregations" -f $uri + } + Invoke-ZARestRequest -uri $uri +} From bcc5c49b711c6e4cc8bb1443298c0695591dfb5f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:18:16 -0400 Subject: [PATCH 026/479] Create Get-ZASite Function and Tests --- Tests/Public/Get-ZASite.Tests.ps1 | 19 +++++++++++++++++++ ZertoApiWrapper/Public/Get-ZASite.ps1 | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 Tests/Public/Get-ZASite.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZASite.ps1 diff --git a/Tests/Public/Get-ZASite.Tests.ps1 b/Tests/Public/Get-ZASite.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZASite.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZASite.ps1 b/ZertoApiWrapper/Public/Get-ZASite.ps1 new file mode 100644 index 0000000..dc2b66d --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZASite.ps1 @@ -0,0 +1,18 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZASite { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter site list. If the ZORG identifier is omitted, a list of all sites is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + $uri = "monitoring/sites" + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}" -f $uri, $filterString + } + Invoke-ZARestRequest -uri $uri +} From 0f35782f66699bfb4f62dee84875a23a7d4005e6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:18:57 -0400 Subject: [PATCH 027/479] Create Get-ZASiteTopology Function and Tests --- Tests/Public/Get-ZASiteTopology.Tests.ps1 | 19 ++++++++++++++++++ ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 | 20 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Tests/Public/Get-ZASiteTopology.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 diff --git a/Tests/Public/Get-ZASiteTopology.Tests.ps1 b/Tests/Public/Get-ZASiteTopology.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZASiteTopology.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 b/ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 new file mode 100644 index 0000000..82795c3 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 @@ -0,0 +1,20 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZASiteTopology { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter sites topology list. If the ZORG identifier is omitted, information related to all sites topology is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + $uri = "monitoring/sites" + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}&format=topology" -f $uri, $filterString + } else { + $uri = "{0}?format=topology" -f $uri + } + Invoke-ZARestRequest -uri $uri +} From 1b331105b90105bb8e27c545f94f45fb2487647c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:19:34 -0400 Subject: [PATCH 028/479] Create Get-ZAVpg Function and Tests --- Tests/Public/Get-ZAVpg.Tests.ps1 | 19 +++++++++++++++ ZertoApiWrapper/Public/Get-ZAVpg.ps1 | 36 ++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 Tests/Public/Get-ZAVpg.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAVpg.ps1 diff --git a/Tests/Public/Get-ZAVpg.Tests.ps1 b/Tests/Public/Get-ZAVpg.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAVpg.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAVpg.ps1 b/ZertoApiWrapper/Public/Get-ZAVpg.ps1 new file mode 100644 index 0000000..3b31e20 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAVpg.ps1 @@ -0,0 +1,36 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAVpg { + [cmdletbinding(DefaultParameterSetName = 'zOrg')] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the VPG list. If the ZORG identifier is omitted, a list of all VPGs is retrieved.", + ParameterSetName = 'zOrg' + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The VPG Identifier", + ParameterSetName = "vpg", + Mandatory = $true + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier + ) + $uri = "monitoring/vpgs" + + switch ($PSCmdlet.ParameterSetName) { + zOrg { + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}" -f $uri, $filterString + } + } + + vpg { + $uri = "{0}/$vpgIdentifier" + } + } + + Invoke-ZARestRequest -uri $uri +} From fd2d175def0a5e60dc53fe07971e59a9913d12c9 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:20:13 -0400 Subject: [PATCH 029/479] Create Get-ZAzOrg Function and Tests --- Tests/Public/Get-ZAzOrg.Tests.ps1 | 19 +++++++++++++++++++ ZertoApiWrapper/Public/Get-ZAzOrg.ps1 | 7 +++++++ 2 files changed, 26 insertions(+) create mode 100644 Tests/Public/Get-ZAzOrg.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAzOrg.ps1 diff --git a/Tests/Public/Get-ZAzOrg.Tests.ps1 b/Tests/Public/Get-ZAzOrg.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAzOrg.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAzOrg.ps1 b/ZertoApiWrapper/Public/Get-ZAzOrg.ps1 new file mode 100644 index 0000000..7a69bc1 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAzOrg.ps1 @@ -0,0 +1,7 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAzOrg { + [cmdletbinding()] + param() + $uri = "monitoring/zorgs" + Invoke-ZARestRequest -uri $uri +} \ No newline at end of file From 1008c2c67047b608b4fa87f30071340ba9a169bc Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 15:41:31 -0400 Subject: [PATCH 030/479] Update Invoke-ZertoFailoverCommit.md Add SupportShouldProcess --- docs/Invoke-ZertoFailoverCommit.md | 34 ++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/docs/Invoke-ZertoFailoverCommit.md b/docs/Invoke-ZertoFailoverCommit.md index 627ece1..b9d302f 100644 --- a/docs/Invoke-ZertoFailoverCommit.md +++ b/docs/Invoke-ZertoFailoverCommit.md @@ -13,7 +13,7 @@ Commit a running VPG failover ## SYNTAX ``` -Invoke-ZertoFailoverCommit [-vpgName] [-reverseProtection] [] +Invoke-ZertoFailoverCommit [-vpgName] [-reverseProtection] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -67,8 +67,38 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS From 83650838143350d589b1163c1684952002808b5c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 10:32:00 -0400 Subject: [PATCH 031/479] Create CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..c79c49d --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at technicalmarketing@zerto.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq From 79fe7de886fcbe7f0d76d75661a4b89962b3c246 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 3 Jun 2019 07:11:15 -0400 Subject: [PATCH 032/479] Create Invoke-ZARestRequest.ps1 --- .../Private/Invoke-ZARestRequest.ps1 | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 diff --git a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 new file mode 100644 index 0000000..599bad8 --- /dev/null +++ b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 @@ -0,0 +1,20 @@ +function Invoke-ZARestRequest { + [cmdletbinding()] + param( + [string]$uri, + [string]$method = "GET", + [string]$body, + [string]$contentType = "application/json" + ) + + $submittedUri = "https://analytics.api.zerto.com/v2/{0}" -f $uri + if ($PSVersionTable.PSVersion.Major -ge 6) { + Invoke-RestMethod -Uri $submittedUri -Method $method -Body $body -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 + } else { + if ([String]::IsNullOrEmpty($body)) { + Invoke-RestMethod -Uri $submittedUri -Method $method -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 + } else { + Invoke-RestMethod -Uri $submittedUri -Method $method -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 -Body $body + } + } +} \ No newline at end of file From 6a32ed6e14d7a35c48c7df85f115230449d6303c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 3 Jun 2019 07:11:20 -0400 Subject: [PATCH 033/479] Create Connect-ZertoAnalytics.ps1 --- .../Public/Connect-ZertoAnalytics.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 diff --git a/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 new file mode 100644 index 0000000..698d957 --- /dev/null +++ b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 @@ -0,0 +1,19 @@ +function Connect-ZertoAnalytics { + [cmdletbinding()] + param( + [Parameter( + Mandatory = $true, + HelpMessage = "PSCredential Object containing username and password authorized for the Zerto Analytics site", + Position = 0 + )] + [System.Management.Automation.PSCredential]$credential + ) + + $uri = "auth/token" + Set-Variable -Name zaHeaders -Scope Script -Value @{"Accept" = "application/json" } + Set-Variable -Name zaLastActionTime -Scope Script -Value $(Get-date).Ticks + $body = @{"username" = $credential.UserName; "password" = $credential.GetNetworkCredential().password } + $result = Invoke-ZARestRequest -Uri $uri -body $($body | ConvertTo-Json) -Method POST + $Script:zaHeaders["Authorization"] = "Bearer $($result.Token)" + $Script:zaHeaders +} \ No newline at end of file From 183bbc7d1314ac6a7398139430f93eceb75fe43e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 3 Jun 2019 07:11:33 -0400 Subject: [PATCH 034/479] Create Get-ZALicense.ps1 --- ZertoApiWrapper/Public/Get-ZALicense.ps1 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 ZertoApiWrapper/Public/Get-ZALicense.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZALicense.ps1 b/ZertoApiWrapper/Public/Get-ZALicense.ps1 new file mode 100644 index 0000000..02c8fd1 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZALicense.ps1 @@ -0,0 +1,4 @@ +function Get-ZALicense { + $uri = "licenses" + Invoke-ZARestRequest -uri $uri +} \ No newline at end of file From 934f02664489bff524d3361c3d6d82996ccf6eea Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:07:37 -0400 Subject: [PATCH 035/479] Add External Help File --- ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 index 698d957..2c8e95f 100644 --- a/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 +++ b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 @@ -1,3 +1,4 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Connect-ZertoAnalytics { [cmdletbinding()] param( From ab39ba70a2144186a159a1412149726d7729f68a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:07:58 -0400 Subject: [PATCH 036/479] Create Invoke-ZARestRequest.Tests.ps1 --- Tests/Private/Invoke-ZARestRequest.Tests.ps1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Tests/Private/Invoke-ZARestRequest.Tests.ps1 diff --git a/Tests/Private/Invoke-ZARestRequest.Tests.ps1 b/Tests/Private/Invoke-ZARestRequest.Tests.ps1 new file mode 100644 index 0000000..984d682 --- /dev/null +++ b/Tests/Private/Invoke-ZARestRequest.Tests.ps1 @@ -0,0 +1,17 @@ +$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper' +$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.' +$file = Get-ChildItem "$filePath\$fileName" +. $file.FullName + +Describe $file.BaseName -Tag Unit { + it "file should exist" { + $file.FullName | should exist + } + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file.FullName -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} \ No newline at end of file From c78ad3e696c93c0f5c30d54b6d37e2104a94185b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:08:06 -0400 Subject: [PATCH 037/479] Create Connect-ZertoAnalytics.Tests.ps1 --- Tests/Public/Connect-ZertoAnalytics.Tests.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Tests/Public/Connect-ZertoAnalytics.Tests.ps1 diff --git a/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 new file mode 100644 index 0000000..50d2f9d --- /dev/null +++ b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} \ No newline at end of file From 5f24cc8c73c7508197e17d675e943943604d7515 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:08:45 -0400 Subject: [PATCH 038/479] Make into an advanced function. --- ZertoApiWrapper/Public/Get-ZALicense.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ZertoApiWrapper/Public/Get-ZALicense.ps1 b/ZertoApiWrapper/Public/Get-ZALicense.ps1 index 02c8fd1..bd1bd94 100644 --- a/ZertoApiWrapper/Public/Get-ZALicense.ps1 +++ b/ZertoApiWrapper/Public/Get-ZALicense.ps1 @@ -1,4 +1,7 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Get-ZALicense { + [cmdletbinding()] + param() $uri = "licenses" Invoke-ZARestRequest -uri $uri } \ No newline at end of file From b4246057350b53270a3ffac0b751cbf5da5faaa1 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:12:36 -0400 Subject: [PATCH 039/479] Create Get-ZALicense.Tests.ps1 --- Tests/Public/Get-ZALicense.Tests.ps1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Tests/Public/Get-ZALicense.Tests.ps1 diff --git a/Tests/Public/Get-ZALicense.Tests.ps1 b/Tests/Public/Get-ZALicense.Tests.ps1 new file mode 100644 index 0000000..50d2f9d --- /dev/null +++ b/Tests/Public/Get-ZALicense.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} \ No newline at end of file From 848daf3c49f02a8192198501c480aab0a352e311 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:13:31 -0400 Subject: [PATCH 040/479] Create ZAMonitoring Function and Tests --- Tests/Public/Get-ZAMonitoring.Tests.ps1 | 19 +++++++++++++++++++ ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 Tests/Public/Get-ZAMonitoring.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 diff --git a/Tests/Public/Get-ZAMonitoring.Tests.ps1 b/Tests/Public/Get-ZAMonitoring.Tests.ps1 new file mode 100644 index 0000000..50d2f9d --- /dev/null +++ b/Tests/Public/Get-ZAMonitoring.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} \ No newline at end of file diff --git a/ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 b/ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 new file mode 100644 index 0000000..a196baa --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAMonitoring.ps1 @@ -0,0 +1,18 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAMonitoring { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the user's statistics for a single account. If the ZORG identifier is omitted, statistics related to all sites, for a single account, is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + $uri = "monitoring/" + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ){ + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier} + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}" -f $uri, $filterString + } + Invoke-ZARestRequest -uri $uri +} \ No newline at end of file From 15435c9261c4386d819ac6a7f7d83a424387957e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:16:43 -0400 Subject: [PATCH 041/479] Create Get-ZAAlert Function and Tests --- Tests/Public/Get-ZAAlert.Tests.ps1 | 19 +++++++++++++ ZertoApiWrapper/Public/Get-ZAAlert.ps1 | 38 ++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 Tests/Public/Get-ZAAlert.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAAlert.ps1 diff --git a/Tests/Public/Get-ZAAlert.Tests.ps1 b/Tests/Public/Get-ZAAlert.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAAlert.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAAlert.ps1 b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 new file mode 100644 index 0000000..f47ca3f --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 @@ -0,0 +1,38 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAAlert { + [cmdletbinding( DefaultParameterSetName = "zOrg")] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the alert list. If the ZORG identifier is omitted, a list of all the alerts is retrieved.", + ParameterSetName = "zOrg" + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The maximum number of alerts to return.", + ParameterSetName = "zOrg" + )] + [ValidateRange(1, 1000000)] + [int]$limitTo, + [Parameter( + HelpMessage = "The VPG Idnetifier", + ParameterSetName = "vpgId" + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier + ) + $uri = "monitoring/alerts" + switch ($PSCmdlet.ParameterSetName) { + zOrg { + if ( $PSBoundParameters.Keys.Count -gt 0 ) { + $filterString = Get-ZertoApiFilter -filterTable $PSBoundParameters + $uri = "{0}{1}" -f $uri, $filterString + } + } + + vpgId { + $uri = "{0}/{1}" -f $uri, $vpgIdentifier + } + } + Invoke-ZARestRequest -uri $uri +} From e43e911c7b177fcc4f7302bcb661ea41429ac291 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:17:41 -0400 Subject: [PATCH 042/479] Create Get-ZAAlertAggregation Function and Tests --- Tests/Public/Get-ZAAlertAggregation.Tests.ps1 | 19 ++++++++++++++++++ .../Public/Get-ZAAlertAggregation.ps1 | 20 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Tests/Public/Get-ZAAlertAggregation.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 diff --git a/Tests/Public/Get-ZAAlertAggregation.Tests.ps1 b/Tests/Public/Get-ZAAlertAggregation.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAAlertAggregation.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 b/ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 new file mode 100644 index 0000000..7b82559 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 @@ -0,0 +1,20 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAAlertAggeration { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the alert count. If the ZORG identifier is omitted, retrieves all alerts sorted by entity and by type." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + $uri = "monitoring/alerts" + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}&format=aggregations" -f $uri, $filterString + } else { + $uri = "{0}?format=aggregations" -f $uri + } + Invoke-ZARestRequest -uri $uri +} From 5018404641d22cec04c216b205251d9ccbcd64f7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:18:16 -0400 Subject: [PATCH 043/479] Create Get-ZASite Function and Tests --- Tests/Public/Get-ZASite.Tests.ps1 | 19 +++++++++++++++++++ ZertoApiWrapper/Public/Get-ZASite.ps1 | 18 ++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 Tests/Public/Get-ZASite.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZASite.ps1 diff --git a/Tests/Public/Get-ZASite.Tests.ps1 b/Tests/Public/Get-ZASite.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZASite.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZASite.ps1 b/ZertoApiWrapper/Public/Get-ZASite.ps1 new file mode 100644 index 0000000..dc2b66d --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZASite.ps1 @@ -0,0 +1,18 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZASite { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter site list. If the ZORG identifier is omitted, a list of all sites is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + $uri = "monitoring/sites" + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}" -f $uri, $filterString + } + Invoke-ZARestRequest -uri $uri +} From 97aa9f1ba80abd035c542df264d0365309345482 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:18:57 -0400 Subject: [PATCH 044/479] Create Get-ZASiteTopology Function and Tests --- Tests/Public/Get-ZASiteTopology.Tests.ps1 | 19 ++++++++++++++++++ ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 | 20 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Tests/Public/Get-ZASiteTopology.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 diff --git a/Tests/Public/Get-ZASiteTopology.Tests.ps1 b/Tests/Public/Get-ZASiteTopology.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZASiteTopology.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 b/ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 new file mode 100644 index 0000000..82795c3 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZASiteTopology.ps1 @@ -0,0 +1,20 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZASiteTopology { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter sites topology list. If the ZORG identifier is omitted, information related to all sites topology is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + $uri = "monitoring/sites" + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}&format=topology" -f $uri, $filterString + } else { + $uri = "{0}?format=topology" -f $uri + } + Invoke-ZARestRequest -uri $uri +} From 87857303a03adac5e3ae64fee3a3e1ef5ca5c334 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:19:34 -0400 Subject: [PATCH 045/479] Create Get-ZAVpg Function and Tests --- Tests/Public/Get-ZAVpg.Tests.ps1 | 19 +++++++++++++++ ZertoApiWrapper/Public/Get-ZAVpg.ps1 | 36 ++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 Tests/Public/Get-ZAVpg.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAVpg.ps1 diff --git a/Tests/Public/Get-ZAVpg.Tests.ps1 b/Tests/Public/Get-ZAVpg.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAVpg.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAVpg.ps1 b/ZertoApiWrapper/Public/Get-ZAVpg.ps1 new file mode 100644 index 0000000..3b31e20 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAVpg.ps1 @@ -0,0 +1,36 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAVpg { + [cmdletbinding(DefaultParameterSetName = 'zOrg')] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the VPG list. If the ZORG identifier is omitted, a list of all VPGs is retrieved.", + ParameterSetName = 'zOrg' + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The VPG Identifier", + ParameterSetName = "vpg", + Mandatory = $true + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier + ) + $uri = "monitoring/vpgs" + + switch ($PSCmdlet.ParameterSetName) { + zOrg { + if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { + $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } + $filterString = Get-ZertoApiFilter -filterTable $filterTable + $uri = "{0}{1}" -f $uri, $filterString + } + } + + vpg { + $uri = "{0}/$vpgIdentifier" + } + } + + Invoke-ZARestRequest -uri $uri +} From 8d5111a24a0e506cf4389370ef2ba0a6c4ae8746 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 14:20:13 -0400 Subject: [PATCH 046/479] Create Get-ZAzOrg Function and Tests --- Tests/Public/Get-ZAzOrg.Tests.ps1 | 19 +++++++++++++++++++ ZertoApiWrapper/Public/Get-ZAzOrg.ps1 | 7 +++++++ 2 files changed, 26 insertions(+) create mode 100644 Tests/Public/Get-ZAzOrg.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAzOrg.ps1 diff --git a/Tests/Public/Get-ZAzOrg.Tests.ps1 b/Tests/Public/Get-ZAzOrg.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAzOrg.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAzOrg.ps1 b/ZertoApiWrapper/Public/Get-ZAzOrg.ps1 new file mode 100644 index 0000000..7a69bc1 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAzOrg.ps1 @@ -0,0 +1,7 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAzOrg { + [cmdletbinding()] + param() + $uri = "monitoring/zorgs" + Invoke-ZARestRequest -uri $uri +} \ No newline at end of file From bc9e485346d2352cac1631c06c16a33df0cb7641 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 15:41:31 -0400 Subject: [PATCH 047/479] Update Invoke-ZertoFailoverCommit.md Add SupportShouldProcess --- docs/Invoke-ZertoFailoverCommit.md | 34 ++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/docs/Invoke-ZertoFailoverCommit.md b/docs/Invoke-ZertoFailoverCommit.md index 627ece1..b9d302f 100644 --- a/docs/Invoke-ZertoFailoverCommit.md +++ b/docs/Invoke-ZertoFailoverCommit.md @@ -13,7 +13,7 @@ Commit a running VPG failover ## SYNTAX ``` -Invoke-ZertoFailoverCommit [-vpgName] [-reverseProtection] [] +Invoke-ZertoFailoverCommit [-vpgName] [-reverseProtection] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -67,8 +67,38 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS From 70261242db7497a6a37079f3dc8f2be9957df3b5 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Jun 2019 15:55:28 -0400 Subject: [PATCH 048/479] Update Invoke-ZertoFailoverCommit.md --- docs/Invoke-ZertoFailoverCommit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Invoke-ZertoFailoverCommit.md b/docs/Invoke-ZertoFailoverCommit.md index b9d302f..f7876b3 100644 --- a/docs/Invoke-ZertoFailoverCommit.md +++ b/docs/Invoke-ZertoFailoverCommit.md @@ -98,7 +98,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS From ba4f0fc82a399b4dd2615dc583803f2c9a14cd8c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:20:01 -0400 Subject: [PATCH 049/479] Create Connect-ZertoAnalytics.md --- docs/Connect-ZertoAnalytics.md | 60 ++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 docs/Connect-ZertoAnalytics.md diff --git a/docs/Connect-ZertoAnalytics.md b/docs/Connect-ZertoAnalytics.md new file mode 100644 index 0000000..86a10c7 --- /dev/null +++ b/docs/Connect-ZertoAnalytics.md @@ -0,0 +1,60 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Connect-ZertoAnalytics + +## SYNOPSIS +All requests to the server, apart from the request to authenticate, must contain a security token which is provided on successful authentication. +In order to authenticate, the user sends myZerto credentials (user/password). + +## SYNTAX + +``` +Connect-ZertoAnalytics [-credential] [] +``` + +## DESCRIPTION +All requests to the server, apart from the request to authenticate, must contain a security token which is provided on successful authentication. +In order to authenticate, the user sends myZerto credentials (user/password). Once this call has been completed successfully, the header authentication token will be stored as a variable and automatically passed during future calls to the Zerto Analytics platform. This token will automatically expire after 60 minutes of inactivity and need to be reauthorized by calling this function again. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Connect-ZertoAnalytics -credential $myCredential +``` + +Connects to the Zerto Analytics site and gets a Bearer Authorization token that is automatically stored as a variable for future calls to the Zerto Analytics REST API. This token will automatically expire after 60 minutes of inactivity and need to be reauthorized by calling this function again. + +## PARAMETERS + +### -credential +PSCredential Object containing username and password authorized for the Zerto Analytics site + +```yaml +Type: PSCredential +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS +[Zerto Analytics REST API Endpoint for Authentication](https://docs.api.zerto.com/#/Authentication/post_v2_auth_token) From 8581c037d719812f9d6d47679765c9a49ac7de74 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:20:29 -0400 Subject: [PATCH 050/479] Add task to update the Markdown help files with new commands. --- ZertoApiWrapper.build.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 448cab0..69d0b3e 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -89,6 +89,12 @@ task UpdateMarkdownHelp CheckPlatyPSInstalled, { Update-MarkDownHelp -Path docs -AlphabeticParamsOrder } +task UpdateMarkdownHelpModule CheckPlatyPSInstalled, { + remove-module ZertoApiWrapper -force -ErrorAction SilentlyContinue + Import-Module .\ZertoApiWrapper\ZertoApiWrapper.psm1 -Force + Update-MarkDownHelpModule -Path docs -AlphabeticParamsOrder +} + task CreatePsd1ForRelease CleanTemp, { $functionsToExport = Get-ChildItem -Path 'ZertoApiWrapper\Public\*.ps1' | ForEach-Object { $_.BaseName } $releaseNotes = "# {0}{1}" -f $version, $(Get-Content .\RELEASENOTES.md -Raw) From 5990d57285bd69dd87b33bf2916d20960efb8667 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:31:44 -0400 Subject: [PATCH 051/479] Fix variable Typo --- ZertoApiWrapper/Public/Get-ZAAlert.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZAAlert.ps1 b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 index f47ca3f..f2e4a2d 100644 --- a/ZertoApiWrapper/Public/Get-ZAAlert.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 @@ -16,10 +16,10 @@ function Get-ZAAlert { [int]$limitTo, [Parameter( HelpMessage = "The VPG Idnetifier", - ParameterSetName = "vpgId" + ParameterSetName = "alertId" )] [ValidateNotNullOrEmpty()] - [string]$vpgIdentifier + [string]$alertIdentifier ) $uri = "monitoring/alerts" switch ($PSCmdlet.ParameterSetName) { @@ -30,8 +30,8 @@ function Get-ZAAlert { } } - vpgId { - $uri = "{0}/{1}" -f $uri, $vpgIdentifier + alertId { + $uri = "{0}/{1}" -f $uri, $alertIdentifier } } Invoke-ZARestRequest -uri $uri From d8084b2fb3a01e5c748e954b2797b53a46900d95 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:31:55 -0400 Subject: [PATCH 052/479] Formatting Update --- docs/Connect-ZertoAnalytics.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Connect-ZertoAnalytics.md b/docs/Connect-ZertoAnalytics.md index 86a10c7..3d50e87 100644 --- a/docs/Connect-ZertoAnalytics.md +++ b/docs/Connect-ZertoAnalytics.md @@ -57,4 +57,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES ## RELATED LINKS + [Zerto Analytics REST API Endpoint for Authentication](https://docs.api.zerto.com/#/Authentication/post_v2_auth_token) From f0f45a383f40ff9efc2c88d0264d221013462a4d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:34:27 -0400 Subject: [PATCH 053/479] Create Get-ZAAlert Markdown Help File --- docs/Get-ZAAlert.md | 125 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 docs/Get-ZAAlert.md diff --git a/docs/Get-ZAAlert.md b/docs/Get-ZAAlert.md new file mode 100644 index 0000000..abced20 --- /dev/null +++ b/docs/Get-ZAAlert.md @@ -0,0 +1,125 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZAAlert + +## SYNOPSIS +Retrieve information about all existing alerts. + +## SYNTAX + +### zOrg (Default) +``` +Get-ZAAlert [-zOrgIdentifier ] [-limitTo ] [] +``` + +### alertId +``` +Get-ZAAlert [-alertIdentifier ] [] +``` + +## DESCRIPTION +Retrieve information about all existing alerts. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAAlert +``` + +Returns all alerts. + +### Example 2 +```powershell +PS C:\> Get-ZAAlert -limitTo 10 +``` + +Returns 10 alerts. + +### Example 3 +```powershell +PS C:\> Get-ZAAlert -zOrgIdentifier "1234-5678-9012" +``` + +Returns all alerts for the zOrg with Identifier "1234-5678-9012". + +### Example 4 +```powershell +PS C:\> Get-ZAAlert -zOrgIdentifier "1234-5678-9012" -limitTo 10 +``` + +Returns 10 alerts for the zOrg with Identifier "1234-5678-9012". + +### Example 3 +```powershell +PS C:\> Get-ZAAlert -alertId "1234-5678-9012" +``` + +Returns one alert with identifier "1234-5678-9012". + +## PARAMETERS + +### -alertIdentifier +The VPG Idnetifier + +```yaml +Type: String +Parameter Sets: alertId +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -limitTo +The maximum number of alerts to return. + +```yaml +Type: Int32 +Parameter Sets: zOrg +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the alert list. +If the ZORG identifier is omitted, a list of all the alerts is retrieved. + +```yaml +Type: String +Parameter Sets: zOrg +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Alerts](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_alerts) +[Zerto Analytics REST API Endpoint for Alerts by Identifier](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_alerts__alertIdentifier_) From 0fbc6d2242f2ea72fab38b78b653903e5362dbdb Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:35:41 -0400 Subject: [PATCH 054/479] Create Get-ZALicense Markdown Help File --- docs/Get-ZALicense.md | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/Get-ZALicense.md diff --git a/docs/Get-ZALicense.md b/docs/Get-ZALicense.md new file mode 100644 index 0000000..27a9e9c --- /dev/null +++ b/docs/Get-ZALicense.md @@ -0,0 +1,45 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZALicense + +## SYNOPSIS + +Retrieve a list of all licenses. + +## SYNTAX + +``` +Get-ZALicense [] +``` + +## DESCRIPTION +Retrieve a list of all licenses. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZALicense +``` + +Returns all licenses and associated information + +## PARAMETERS + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API License End Point Documentation](https://docs.api.zerto.com/#/Licenses/get_v2_licenses) From 8b09b702d61781cdb64b0ab2ccbd5cda6045582b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:42:01 -0400 Subject: [PATCH 055/479] Create Get-ZAMonitoring Markdown Help file --- docs/Get-ZAMonitoring.md | 69 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 docs/Get-ZAMonitoring.md diff --git a/docs/Get-ZAMonitoring.md b/docs/Get-ZAMonitoring.md new file mode 100644 index 0000000..131adca --- /dev/null +++ b/docs/Get-ZAMonitoring.md @@ -0,0 +1,69 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZAMonitoring + +## SYNOPSIS + +Retrieve statistics related to all the user’s sites - belonging to a single account. + +## SYNTAX + +``` +Get-ZAMonitoring [[-zOrgIdentifier] ] [] +``` + +## DESCRIPTION + +Retrieve statistics related to all the user’s sites - belonging to a single account. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAMonitoring +``` + +Retrieve statistics related to all the user’s sites - belonging to a single account. + +### Example 1 +```powershell +PS C:\> Get-ZAMonitoring -zOrgIdentifier "1234-5678-9012" +``` + +Retrieve statistics related to the zOrgIdentifier provided + +## PARAMETERS + +### -zOrgIdentifier +The ZORG identifier by which to filter the user's statistics for a single account. +If the ZORG identifier is omitted, statistics related to all sites, for a single account, is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Monitoring](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_) From 6d66a1c35b139910ee21fce225114adb402aaeaf Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:44:04 -0400 Subject: [PATCH 056/479] Create Get-ZASite Markdown help file --- docs/Get-ZASite.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 docs/Get-ZASite.md diff --git a/docs/Get-ZASite.md b/docs/Get-ZASite.md new file mode 100644 index 0000000..5bb6dbe --- /dev/null +++ b/docs/Get-ZASite.md @@ -0,0 +1,69 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZASite + +## SYNOPSIS + +Retrieve a list of all sites. + +## SYNTAX + +``` +Get-ZASite [[-zOrgIdentifier] ] [] +``` + +## DESCRIPTION + +Retrieve a list of all sites. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZASite +``` + +Retrieve a list of all sites. + +### Example 2 +```powershell +PS C:\> Get-ZASite -zOrgIdentifier "1234-5678-9012" +``` + +Retrieve a list of all sites managed under zOrgIdentifier "1234-5678-9012". + +## PARAMETERS + +### -zOrgIdentifier +The ZORG identifier by which to filter site list. +If the ZORG identifier is omitted, a list of all sites is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Sites](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_sites) From a3fd87f933fecf7c573811212acada3691a2d97f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:46:49 -0400 Subject: [PATCH 057/479] Create Get-ZASiteTopology Markdown Help File --- docs/Get-ZASiteTopology.md | 70 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 docs/Get-ZASiteTopology.md diff --git a/docs/Get-ZASiteTopology.md b/docs/Get-ZASiteTopology.md new file mode 100644 index 0000000..c6b5686 --- /dev/null +++ b/docs/Get-ZASiteTopology.md @@ -0,0 +1,70 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZASiteTopology + +## SYNOPSIS + +Retrieves a collection of Sites topology information structures for all the available user’s sites, including disabled and non-transmitting due to lack of a transmitter (older ZVR versions). + +## SYNTAX + +``` +Get-ZASiteTopology [[-zOrgIdentifier] ] [] +``` + +## DESCRIPTION + +Retrieves a collection of Sites topology information structures for all the available user’s sites, including disabled and non-transmitting due to lack of a transmitter (older ZVR versions). | The following note should be taken into consideration: +The information might not be complete, since there are sites that do not transmit (disabled), yet this API concludes their presence and VPG count from the VPGs they share with transmitting sites. Such a disabled site might have relations with other disabled sites, which this API does not reveal. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZASiteTopology +``` + +Retrieves a collection of Sites topology information structures for all the available user’s sites. + +### Example 2 +```powershell +PS C:\> Get-ZASiteTopology -zOrgIdentifier "1234-5678-9012" +``` + +Retrieves a collection of Sites topology information structures for all the available user’s sites within zOrgIdentifier "1234-5678-9012". + +## PARAMETERS + +### -zOrgIdentifier +The ZORG identifier by which to filter sites topology list. +If the ZORG identifier is omitted, information related to all sites topology is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Site Topology](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_sites_format_topology) From ebc86c5e7164376521efaaad679f61aa5f607689 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:48:49 -0400 Subject: [PATCH 058/479] Update Function to set variable to mandatory --- ZertoApiWrapper/Public/Get-ZAAlert.ps1 | 3 ++- docs/Get-ZAAlert.md | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZAAlert.ps1 b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 index f2e4a2d..af0c80e 100644 --- a/ZertoApiWrapper/Public/Get-ZAAlert.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 @@ -16,7 +16,8 @@ function Get-ZAAlert { [int]$limitTo, [Parameter( HelpMessage = "The VPG Idnetifier", - ParameterSetName = "alertId" + ParameterSetName = "alertId", + Mandatory = $true )] [ValidateNotNullOrEmpty()] [string]$alertIdentifier diff --git a/docs/Get-ZAAlert.md b/docs/Get-ZAAlert.md index abced20..2e98eaa 100644 --- a/docs/Get-ZAAlert.md +++ b/docs/Get-ZAAlert.md @@ -19,7 +19,7 @@ Get-ZAAlert [-zOrgIdentifier ] [-limitTo ] [] ### alertId ``` -Get-ZAAlert [-alertIdentifier ] [] +Get-ZAAlert -alertIdentifier [] ``` ## DESCRIPTION @@ -72,7 +72,7 @@ Type: String Parameter Sets: alertId Aliases: -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False From cddd25ded1b5204b341319a985cdfa55e28fd858 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:49:49 -0400 Subject: [PATCH 059/479] Formatting Update --- docs/Get-ZAMonitoring.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Get-ZAMonitoring.md b/docs/Get-ZAMonitoring.md index 131adca..7489568 100644 --- a/docs/Get-ZAMonitoring.md +++ b/docs/Get-ZAMonitoring.md @@ -9,7 +9,7 @@ schema: 2.0.0 ## SYNOPSIS -Retrieve statistics related to all the user’s sites - belonging to a single account. +Retrieve statistics related to all the user's sites - belonging to a single account. ## SYNTAX @@ -19,7 +19,7 @@ Get-ZAMonitoring [[-zOrgIdentifier] ] [] ## DESCRIPTION -Retrieve statistics related to all the user’s sites - belonging to a single account. +Retrieve statistics related to all the user's sites - belonging to a single account. ## EXAMPLES @@ -28,7 +28,7 @@ Retrieve statistics related to all the user’s sites - belonging to a single ac PS C:\> Get-ZAMonitoring ``` -Retrieve statistics related to all the user’s sites - belonging to a single account. +Retrieve statistics related to all the user's sites - belonging to a single account. ### Example 1 ```powershell From 9799feaeea545f2568cac8eeef69771020103ffe Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:50:09 -0400 Subject: [PATCH 060/479] Formatting Update --- docs/Get-ZASiteTopology.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/Get-ZASiteTopology.md b/docs/Get-ZASiteTopology.md index c6b5686..cb42853 100644 --- a/docs/Get-ZASiteTopology.md +++ b/docs/Get-ZASiteTopology.md @@ -9,7 +9,7 @@ schema: 2.0.0 ## SYNOPSIS -Retrieves a collection of Sites topology information structures for all the available user’s sites, including disabled and non-transmitting due to lack of a transmitter (older ZVR versions). +Retrieves a collection of Sites topology information structures for all the available user's sites, including disabled and non-transmitting due to lack of a transmitter (older ZVR versions). ## SYNTAX @@ -19,7 +19,7 @@ Get-ZASiteTopology [[-zOrgIdentifier] ] [] ## DESCRIPTION -Retrieves a collection of Sites topology information structures for all the available user’s sites, including disabled and non-transmitting due to lack of a transmitter (older ZVR versions). | The following note should be taken into consideration: +Retrieves a collection of Sites topology information structures for all the available user's sites, including disabled and non-transmitting due to lack of a transmitter (older ZVR versions). | The following note should be taken into consideration: The information might not be complete, since there are sites that do not transmit (disabled), yet this API concludes their presence and VPG count from the VPGs they share with transmitting sites. Such a disabled site might have relations with other disabled sites, which this API does not reveal. ## EXAMPLES @@ -29,14 +29,14 @@ The information might not be complete, since there are sites that do not transmi PS C:\> Get-ZASiteTopology ``` -Retrieves a collection of Sites topology information structures for all the available user’s sites. +Retrieves a collection of Sites topology information structures for all the available user's sites. ### Example 2 ```powershell PS C:\> Get-ZASiteTopology -zOrgIdentifier "1234-5678-9012" ``` -Retrieves a collection of Sites topology information structures for all the available user’s sites within zOrgIdentifier "1234-5678-9012". +Retrieves a collection of Sites topology information structures for all the available user's sites within zOrgIdentifier "1234-5678-9012". ## PARAMETERS From 2c891795b2fcb664fac60bee7c9dcc011bcee0ec Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 11:57:05 -0400 Subject: [PATCH 061/479] Add Online Parameter URL --- docs/Connect-ZertoAnalytics.md | 2 +- docs/Get-ZAAlert.md | 2 +- docs/Get-ZALicense.md | 2 +- docs/Get-ZAMonitoring.md | 2 +- docs/Get-ZASite.md | 2 +- docs/Get-ZASiteTopology.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/Connect-ZertoAnalytics.md b/docs/Connect-ZertoAnalytics.md index 3d50e87..4b789bf 100644 --- a/docs/Connect-ZertoAnalytics.md +++ b/docs/Connect-ZertoAnalytics.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Connect-ZertoAnalytics.md schema: 2.0.0 --- diff --git a/docs/Get-ZAAlert.md b/docs/Get-ZAAlert.md index 2e98eaa..3ef258f 100644 --- a/docs/Get-ZAAlert.md +++ b/docs/Get-ZAAlert.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAAlert.md schema: 2.0.0 --- diff --git a/docs/Get-ZALicense.md b/docs/Get-ZALicense.md index 27a9e9c..cc9b992 100644 --- a/docs/Get-ZALicense.md +++ b/docs/Get-ZALicense.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZALicense.md schema: 2.0.0 --- diff --git a/docs/Get-ZAMonitoring.md b/docs/Get-ZAMonitoring.md index 7489568..da04a32 100644 --- a/docs/Get-ZAMonitoring.md +++ b/docs/Get-ZAMonitoring.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAMonitoring.md schema: 2.0.0 --- diff --git a/docs/Get-ZASite.md b/docs/Get-ZASite.md index 5bb6dbe..4af04a2 100644 --- a/docs/Get-ZASite.md +++ b/docs/Get-ZASite.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZASite.md schema: 2.0.0 --- diff --git a/docs/Get-ZASiteTopology.md b/docs/Get-ZASiteTopology.md index cb42853..cd75b6d 100644 --- a/docs/Get-ZASiteTopology.md +++ b/docs/Get-ZASiteTopology.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZASiteTopology.md schema: 2.0.0 --- From f2d2e00f12db2f6595bdbdf90fb31dbe09bace28 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 12:28:07 -0400 Subject: [PATCH 062/479] Create Get-ZAVpg External Help File --- docs/Get-ZAVpg.md | 98 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 docs/Get-ZAVpg.md diff --git a/docs/Get-ZAVpg.md b/docs/Get-ZAVpg.md new file mode 100644 index 0000000..07ff413 --- /dev/null +++ b/docs/Get-ZAVpg.md @@ -0,0 +1,98 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAVpg.md +schema: 2.0.0 +--- + +# Get-ZAVpg + +## SYNOPSIS + +Retrieve a list of all VPGs. + +## SYNTAX + +### zOrg (Default) +``` +Get-ZAVpg [-zOrgIdentifier ] [] +``` + +### vpg +``` +Get-ZAVpg -vpgIdentifier [] +``` + +## DESCRIPTION + +Retrieve a list of all VPGs. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAVpg +``` + +Retrieve a list of all VPGs. + +### Example 2 +```powershell +PS C:\> Get-ZAVpg -zOrgIdentifier "1234-5678-9012" +``` + +Retrieve a list of all VPGs associated with zOrg "1234-5678-9012" + +### Example 3 +```powershell +PS C:\> Get-ZAVpg -vpgIdentifier "2109-8765-4321" +``` + +Retrieve information for VPG with identifier "2109-8765-4321" + +## PARAMETERS + +### -vpgIdentifier +The VPG Identifier + +```yaml +Type: String +Parameter Sets: vpg +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the VPG list. +If the ZORG identifier is omitted, a list of all VPGs is retrieved. + +```yaml +Type: String +Parameter Sets: zOrg +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for VPGs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_vpgs) +[Zerto Analytics REST API Endpoint for VPG Identifier](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_vpgs__vpgIdentifier_) From 7ec6d846c0ba2e896ceb236a186f700cf0ff7f84 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 12:30:01 -0400 Subject: [PATCH 063/479] Create External Help File for Get-ZAzOrg Function --- docs/Get-ZAzOrg.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 docs/Get-ZAzOrg.md diff --git a/docs/Get-ZAzOrg.md b/docs/Get-ZAzOrg.md new file mode 100644 index 0000000..4fe4457 --- /dev/null +++ b/docs/Get-ZAzOrg.md @@ -0,0 +1,46 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAzOrg.md +schema: 2.0.0 +--- + +# Get-ZAzOrg + +## SYNOPSIS + +Retrieve a list of all ZORGs. + +## SYNTAX + +``` +Get-ZAzOrg [] +``` + +## DESCRIPTION + +Retrieve a list of all ZORGs. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAzOrg +``` + +Retrieve a list of all ZORGs. + +## PARAMETERS + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for ZOrgs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_zorgs) From 4fc6c9ebcd7c2007a17ca9108a89e732bd1605c2 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 13:36:04 -0400 Subject: [PATCH 064/479] Create Get-ZAEvent Files --- Tests/Public/Get-ZAEvent.Tests.ps1 | 19 ++++ ZertoApiWrapper/Public/Get-ZAEvent.ps1 | 39 +++++++ docs/Get-ZAEvent.md | 140 +++++++++++++++++++++++++ 3 files changed, 198 insertions(+) create mode 100644 Tests/Public/Get-ZAEvent.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAEvent.ps1 create mode 100644 docs/Get-ZAEvent.md diff --git a/Tests/Public/Get-ZAEvent.Tests.ps1 b/Tests/Public/Get-ZAEvent.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAEvent.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAEvent.ps1 b/ZertoApiWrapper/Public/Get-ZAEvent.ps1 new file mode 100644 index 0000000..beb9ca9 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAEvent.ps1 @@ -0,0 +1,39 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAEvent { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the user's events. If the ZORG identifier is omitted, events is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The event category (events/alertsHistory). Default displays the list of all." + )] + [ValidateSet("events", "alertsHistory")] + [string]$category, + [Parameter( + HelpMessage = "The maximum number of events to return." + )] + [ValidateRange(1, 1000000)] + [int]$limitTo, + [Parameter( + HelpMessage = "The earliest timestamp of an event to return, in RFC 3339 standard ('1970-01-01T00:00:00Z'). Default is one year ago." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The latest timestamp of an event to return, in RFC 3339 standard ('1970-01-01T00:00:00Z'). Default is the present time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + $uri = "monitoring/events" + + if ( $PSBoundParameters.Keys.Count -gt 0 ) { + $filterString = Get-ZertoApiFilter -filterTable $PSBoundParameters + $uri = "{0}{1}" -f $uri, $filterString + } + + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAEvent.md b/docs/Get-ZAEvent.md new file mode 100644 index 0000000..dbfa390 --- /dev/null +++ b/docs/Get-ZAEvent.md @@ -0,0 +1,140 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAEvent.md +schema: 2.0.0 +--- + +# Get-ZAEvent + +## SYNOPSIS + +Retrieve details of all existing events. + +## SYNTAX + +``` +Get-ZAEvent [[-zOrgIdentifier] ] [[-category] ] [[-limitTo] ] [[-startDate] ] + [[-endDate] ] [] +``` + +## DESCRIPTION + +Retrieve details of all existing events. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAEvent +``` + +Retrieve details of all existing events. + +### Example 2 +```powershell +PS C:\> Get-ZAEvent -zOrgIdentifier "1234-5678-9012" +``` + +Retrieve details of all existing events for zOrg with Identifier "1234-5678-9012" + +### Example 3 +```powershell +PS C:\> Get-ZAEvent -category events -startDate "2019-03-01" -endDate "2019-04-01" -limitTo 400 +``` + +Retrieve details of all events between March 1st and April 1st and limit results to 400. + +## PARAMETERS + +### -category +The event category (events/alertsHistory). +Default displays the list of all. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -endDate +The latest timestamp of an event to return, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +Default is the present time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -limitTo +The maximum number of events to return. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The earliest timestamp of an event to return, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +Default is one year ago. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the user's events. +If the ZORG identifier is omitted, events is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Events](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_events) From 0e148bdb1b2314d1bd64ce6b4f6a503d94f97411 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 13:59:13 -0400 Subject: [PATCH 065/479] Create Get-ZATask files and content --- Tests/Public/Get-ZATask.Tests.ps1 | 19 +++++ ZertoApiWrapper/Public/Get-ZATask.ps1 | 39 +++++++++ docs/Get-ZATask.md | 112 ++++++++++++++++++++++++++ 3 files changed, 170 insertions(+) create mode 100644 Tests/Public/Get-ZATask.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZATask.ps1 create mode 100644 docs/Get-ZATask.md diff --git a/Tests/Public/Get-ZATask.Tests.ps1 b/Tests/Public/Get-ZATask.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZATask.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZATask.ps1 b/ZertoApiWrapper/Public/Get-ZATask.ps1 new file mode 100644 index 0000000..2f1bce5 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZATask.ps1 @@ -0,0 +1,39 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZATask { + [cmdletbinding( DefaultParameterSetName = "zOrg")] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the task list. If the ZORG identifier is omitted, a list of all the tasks is retrieved.", + ParameterSetName = "zOrg" + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The maximum number of tasks to return.", + ParameterSetName = "zOrg" + )] + [ValidateRange(1, 1000000)] + [int]$limitTo, + [Parameter( + HelpMessage = "The task Idnetifier", + ParameterSetName = "taskId", + Mandatory = $true + )] + [ValidateNotNullOrEmpty()] + [string]$taskIdentifier + ) + $uri = "monitoring/tasks" + switch ($PSCmdlet.ParameterSetName) { + zOrg { + if ( $PSBoundParameters.Keys.Count -gt 0 ) { + $filterString = Get-ZertoApiFilter -filterTable $PSBoundParameters + $uri = "{0}{1}" -f $uri, $filterString + } + } + + taskId { + $uri = "{0}/{1}" -f $uri, $taskIdentifier + } + } + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZATask.md b/docs/Get-ZATask.md new file mode 100644 index 0000000..bb5f3bf --- /dev/null +++ b/docs/Get-ZATask.md @@ -0,0 +1,112 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZATask.md +schema: 2.0.0 +--- + +# Get-ZATask + +## SYNOPSIS + +Retrieve details of all existing tasks. + +## SYNTAX + +### zOrg (Default) +``` +Get-ZATask [-zOrgIdentifier ] [-limitTo ] [] +``` + +### taskId +``` +Get-ZATask -taskIdentifier [] +``` + +## DESCRIPTION + +Retrieve details of all existing tasks. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZATask +``` + +Retrieve details of all existing tasks. + +### Example 2 +```powershell +PS C:\> Get-ZATask -zOrgIdentifier "1234-5678-9012" +``` + +Retrieve details of all existing tasks for zOrg with Identifier "1234-5678-9012". + +### Example 1 +```powershell +PS C:\> Get-ZATask -taskIdentifier "9012-3456-7890" +``` + +Retrieve details of a specific task with identifier "9012-3456-7890". + +## PARAMETERS + +### -limitTo +The maximum number of tasks to return. + +```yaml +Type: Int32 +Parameter Sets: zOrg +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -taskIdentifier +The task Idnetifier + +```yaml +Type: String +Parameter Sets: taskId +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the task list. +If the ZORG identifier is omitted, a list of all the tasks is retrieved. + +```yaml +Type: String +Parameter Sets: zOrg +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Tasks](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_tasks) From c88d175fd0da6e359c2ecdab22fd9f01d5b78021 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 13:59:41 -0400 Subject: [PATCH 066/479] Correct Help Message Typo --- ZertoApiWrapper/Public/Get-ZAAlert.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Get-ZAAlert.ps1 b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 index af0c80e..1026895 100644 --- a/ZertoApiWrapper/Public/Get-ZAAlert.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 @@ -15,7 +15,7 @@ function Get-ZAAlert { [ValidateRange(1, 1000000)] [int]$limitTo, [Parameter( - HelpMessage = "The VPG Idnetifier", + HelpMessage = "The alert Idnetifier", ParameterSetName = "alertId", Mandatory = $true )] From 1f03feb1c68b909269b3b3b5e584dee6d86c27b8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 6 Jun 2019 14:29:22 -0400 Subject: [PATCH 067/479] Create Get-ZADatastore function & supporting docs --- Tests/Public/Get-ZADatastore.Tests.ps1 | 19 ++++ ZertoApiWrapper/Public/Get-ZADatastore.ps1 | 37 +++++++ docs/Get-ZADatastore.md | 123 +++++++++++++++++++++ 3 files changed, 179 insertions(+) create mode 100644 Tests/Public/Get-ZADatastore.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZADatastore.ps1 create mode 100644 docs/Get-ZADatastore.md diff --git a/Tests/Public/Get-ZADatastore.Tests.ps1 b/Tests/Public/Get-ZADatastore.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZADatastore.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZADatastore.ps1 b/ZertoApiWrapper/Public/Get-ZADatastore.ps1 new file mode 100644 index 0000000..64bb34f --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZADatastore.ps1 @@ -0,0 +1,37 @@ +function Get-ZADatastore { + [CmdletBinding(DefaultParameterSetName = "AllInfo")] + param ( + [Parameter( + HelpMessage = "The site identifier. The site identifier is mandatory. Omit the datastore and datastore cluster identifiers to view site level storage information.", + Mandatory = $true, + ParameterSetName = "AllInfo" + )] + [Parameter( + Mandatory = $true, + ParameterSetName = "cluster" + )] + [Parameter( + Mandatory = $true, + ParameterSetName = "datastore" + )] + [ValidateNotNullOrEmpty()] + [string]$siteIdentifier, + [Parameter( + HelpMessage = "The datastore cluster identifier. Gets a list of datastores in the cluster.", + ParameterSetName = "cluster", + Mandatory = "true" + )] + [ValidateNotNullOrEmpty()] + [string]$clusterIdentifier, + [Parameter( + HelpMessage = "The datastore identifer. Gets the datastore info.", + ParameterSetName = "datastore", + Mandatory = $true + )] + [string]$datastoreIdentifier + + ) + $filter = Get-ZertoApiFilter -filterTable $PSBoundParameters + $uri = "monitoring/datastores{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZADatastore.md b/docs/Get-ZADatastore.md new file mode 100644 index 0000000..b44e4f4 --- /dev/null +++ b/docs/Get-ZADatastore.md @@ -0,0 +1,123 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZATask.md +schema: 2.0.0 +--- + +# Get-ZADatastore + +## SYNOPSIS + +Get a list of datastore/s, filtered by site. Enter a site identifier only to get the list of all datastores. Enter a site identifier and cluster identifier to get a list of datastores in the cluster. Enter a site identifier and datastore identifier to get specific datastore info. + +## SYNTAX + +### AllInfo (Default) +``` +Get-ZADatastore -siteIdentifier [] +``` + +### datastore +``` +Get-ZADatastore -siteIdentifier -datastoreIdentifier [] +``` + +### cluster +``` +Get-ZADatastore -siteIdentifier -clusterIdentifier [] +``` + +## DESCRIPTION + +Get a list of datastore/s, filtered by site. Enter a site identifier only to get the list of all datastores. Enter a site identifier and cluster identifier to get a list of datastores in the cluster. Enter a site identifier and datastore identifier to get specific datastore info. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZADatastore -siteIdentifier "7890-1234-5678" +``` + +Returns all datastore clusters and datastores associated with site identifier "7890-1234-5678" + +### Example 2 +```powershell +PS C:\> Get-ZADatastore -siteIdentifier "7890-1234-5678" -clusterIdentifier "3456-7890-1234" +``` + +Returns datastore cluster information with identifier "3456-7890-1234" associated with site identifier "7890-1234-5678" + +### Example 3 +```powershell +PS C:\> Get-ZADatastore -siteIdentifier "7890-1234-5678" -datastoreIdentifier "5678-9012-3456" +``` + +Returns all datastore information with identifier "5678-9012-3456" associated with site identifier "7890-1234-5678" + +## PARAMETERS + +### -clusterIdentifier +The datastore cluster identifier. +Gets a list of datastores in the cluster. + +```yaml +Type: String +Parameter Sets: cluster +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -datastoreIdentifier +The datastore identifer. +Gets the datastore info. + +```yaml +Type: String +Parameter Sets: datastore +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -siteIdentifier +The site identifier. +The site identifier is mandatory. +Omit the datastore and datastore cluster identifiers to view site level storage information. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Datastores](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_datastores) From c83eb2d8a71557c85e5d26c807e5f446c391e145 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 8 Jun 2019 16:08:25 -0400 Subject: [PATCH 068/479] Create Get-ZAVolume and required files --- Tests/Public/Get-ZAVolume.Tests.ps1 | 19 ++++ ZertoApiWrapper/Public/Get-ZAVolume.ps1 | 43 ++++++++ docs/Get-ZAVolume.md | 137 ++++++++++++++++++++++++ 3 files changed, 199 insertions(+) create mode 100644 Tests/Public/Get-ZAVolume.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAVolume.ps1 create mode 100644 docs/Get-ZAVolume.md diff --git a/Tests/Public/Get-ZAVolume.Tests.ps1 b/Tests/Public/Get-ZAVolume.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAVolume.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAVolume.ps1 b/ZertoApiWrapper/Public/Get-ZAVolume.ps1 new file mode 100644 index 0000000..554f2ad --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAVolume.ps1 @@ -0,0 +1,43 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAVolume { + [CmdletBinding(DefaultParameterSetName = "VpgIdentifier")] + param ( + [Parameter( + HelpMessage = "The site identifier. The site identifier is mandatory if vpgIdentifier is not entered.", + Mandatory, + ParameterSetName = "SiteAndClusterIdentifier" + )] + [Parameter( + HelpMessage = "The site identifier. The site identifier is mandatory if vpgIdentifier is not entered.", + Mandatory, + ParameterSetName = "SiteAndDatastoreIdentifier" + )] + [ValidateNotNullOrEmpty()] + [string]$siteIdentifier, + [Parameter( + HelpMessage = "The cluster identifier. If a cluster identifier is not entered, you must enter a datastore identifier.", + Mandatory, + ParameterSetName = "SiteAndClusterIdentifier" + )] + [ValidateNotNullOrEmpty()] + [string]$clusterIdentifier, + [Parameter( + HelpMessage = "The datastore identifer. If a datastore identifier is not entered, you must enter a cluster identifier.", + Mandatory, + ParameterSetName = "SiteAndDatastoreIdentifier" + )] + [ValidateNotNullOrEmpty()] + [string]$datastoreIdentifier, + [Parameter( + HelpMessage = "The vpg identifer.", + Mandatory, + ParameterSetName = "VpgIdentifier" + )] + [string]$vpgIdentifier + + ) + + $filter = Get-ZertoApiFilter -FilterTable $PSBoundParameters + $uri = "monitoring/volumes{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAVolume.md b/docs/Get-ZAVolume.md new file mode 100644 index 0000000..0b56f41 --- /dev/null +++ b/docs/Get-ZAVolume.md @@ -0,0 +1,137 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAVolume.md +schema: 2.0.0 +--- + +# Get-ZAVolume + +## SYNOPSIS + +Retrieves account volumes by datastore. Enter a site identifier and cluster identifier to get the list of volumes that exist in the datastore cluster. Or, enter a site identifier and datastore identifier to get the list of volumes that exist in the datastore. To retrieve all volumes for a specific VPG, enter a VPG identifier only. + +## SYNTAX + +### VpgIdentifier (Default) +``` +Get-ZAVolume -vpgIdentifier [] +``` + +### SiteAndDatastoreIdentifier +``` +Get-ZAVolume -siteIdentifier -datastoreIdentifier [] +``` + +### SiteAndClusterIdentifier +``` +Get-ZAVolume -siteIdentifier -clusterIdentifier [] +``` + +## DESCRIPTION + +Retrieves account volumes by datastore. Enter a site identifier and cluster identifier to get the list of volumes that exist in the datastore cluster. Or, enter a site identifier and datastore identifier to get the list of volumes that exist in the datastore. To retrieve all volumes for a specific VPG, enter a VPG identifier only. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAVolume -vpgIdentifier "2345-6789-0123" +``` + +Returns all volume information for all VMs in VPG with Identifier "2345-6789-0123" + +### Example 2 +```powershell +PS C:\> Get-ZAVolume -siteIdentifier "3456-7890-1234" -clusterIdentifier "0123-4567-8901" +``` + +Returns all volume information for all volumes in Site with Identifier "3456-7890-1234" on Datastore Cluster with Identifier "0123-4567-8901" + +### Example 3 +```powershell +PS C:\> Get-ZAVolume -siteIdentifier "3456-7890-1234" -datastoreIdentifier "5678-9012-3456" +``` + +Returns all volume information for all volumes in Site with Identifier "3456-7890-1234" on Datastore with Identifier "5678-9012-3456" + +## PARAMETERS + +### -clusterIdentifier +The cluster identifier. +If a cluster identifier is not entered, you must enter a datastore identifier. + +```yaml +Type: String +Parameter Sets: SiteAndClusterIdentifier +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -datastoreIdentifier +The datastore identifer. +If a datastore identifier is not entered, you must enter a cluster identifier. + +```yaml +Type: String +Parameter Sets: SiteAndDatastoreIdentifier +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -siteIdentifier +The site identifier. +The site identifier is mandatory if vpgIdentifier is not entered. + +```yaml +Type: String +Parameter Sets: SiteAndDatastoreIdentifier, SiteAndClusterIdentifier +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The vpg identifer. + +```yaml +Type: String +Parameter Sets: VpgIdentifier +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Volumes](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_volumes) From 35b03a963f0daf2b619ca637afb1fa96ff52a15d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 8 Jun 2019 16:08:57 -0400 Subject: [PATCH 069/479] Update Help File --- docs/Invoke-ZertoFailoverCommit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Invoke-ZertoFailoverCommit.md b/docs/Invoke-ZertoFailoverCommit.md index b9d302f..f7876b3 100644 --- a/docs/Invoke-ZertoFailoverCommit.md +++ b/docs/Invoke-ZertoFailoverCommit.md @@ -98,7 +98,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS From f0fb1d4fc6bf38703785660d142065c9b52dcdf7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 8 Jun 2019 16:09:10 -0400 Subject: [PATCH 070/479] Add required External Help Line --- ZertoApiWrapper/Public/Get-ZADatastore.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/ZertoApiWrapper/Public/Get-ZADatastore.ps1 b/ZertoApiWrapper/Public/Get-ZADatastore.ps1 index 64bb34f..8f12ddb 100644 --- a/ZertoApiWrapper/Public/Get-ZADatastore.ps1 +++ b/ZertoApiWrapper/Public/Get-ZADatastore.ps1 @@ -1,3 +1,4 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Get-ZADatastore { [CmdletBinding(DefaultParameterSetName = "AllInfo")] param ( From 358d680c72d935d839ecf2e4f43708eb5d130c87 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 8 Jun 2019 16:11:04 -0400 Subject: [PATCH 071/479] Remove AlertAggregation Remove AlertAggregation, Will add aggregation into Alert down the road. --- Tests/Public/Get-ZAAlertAggregation.Tests.ps1 | 19 ------------------ .../Public/Get-ZAAlertAggregation.ps1 | 20 ------------------- 2 files changed, 39 deletions(-) delete mode 100644 Tests/Public/Get-ZAAlertAggregation.Tests.ps1 delete mode 100644 ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 diff --git a/Tests/Public/Get-ZAAlertAggregation.Tests.ps1 b/Tests/Public/Get-ZAAlertAggregation.Tests.ps1 deleted file mode 100644 index f5816b6..0000000 --- a/Tests/Public/Get-ZAAlertAggregation.Tests.ps1 +++ /dev/null @@ -1,19 +0,0 @@ -#Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force - -Describe $file.BaseName -Tag 'Unit' { - - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 - } -} diff --git a/ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 b/ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 deleted file mode 100644 index 7b82559..0000000 --- a/ZertoApiWrapper/Public/Get-ZAAlertAggregation.ps1 +++ /dev/null @@ -1,20 +0,0 @@ -<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> -function Get-ZAAlertAggeration { - [cmdletbinding()] - param( - [Parameter( - HelpMessage = "The ZORG identifier by which to filter the alert count. If the ZORG identifier is omitted, retrieves all alerts sorted by entity and by type." - )] - [ValidateNotNullOrEmpty()] - [string]$zOrgIdentifier - ) - $uri = "monitoring/alerts" - if ( -not [String]::IsNullorEmpty($zOrgIdentifier) ) { - $filterTable = @{"zOrgIdentifier" = $zOrgIdentifier } - $filterString = Get-ZertoApiFilter -filterTable $filterTable - $uri = "{0}{1}&format=aggregations" -f $uri, $filterString - } else { - $uri = "{0}?format=aggregations" -f $uri - } - Invoke-ZARestRequest -uri $uri -} From f7fff2248e22b9ce3849712f78518cd0f4cbf7b5 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 08:56:04 -0400 Subject: [PATCH 072/479] Create Get-ZARPOSummary and Docs --- Tests/Public/Get-ZARPOSummary.Tests.ps1 | 19 ++++ ZertoApiWrapper/Public/Get-ZARPOSummary.ps1 | 26 +++++ docs/Get-ZARPOSummary.md | 107 ++++++++++++++++++++ 3 files changed, 152 insertions(+) create mode 100644 Tests/Public/Get-ZARPOSummary.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZARPOSummary.ps1 create mode 100644 docs/Get-ZARPOSummary.md diff --git a/Tests/Public/Get-ZARPOSummary.Tests.ps1 b/Tests/Public/Get-ZARPOSummary.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZARPOSummary.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZARPOSummary.ps1 b/ZertoApiWrapper/Public/Get-ZARPOSummary.ps1 new file mode 100644 index 0000000..58f3a61 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZARPOSummary.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZARPOSummary { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -FilterTable $PSBoundParameters + $uri = "reports/rpo-summary{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZARPOSummary.md b/docs/Get-ZARPOSummary.md new file mode 100644 index 0000000..bfeeb10 --- /dev/null +++ b/docs/Get-ZARPOSummary.md @@ -0,0 +1,107 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAMonitoring.md +schema: 2.0.0 +--- + +# Get-ZARPOSummary + +## SYNOPSIS + +Retrieves RPO historical statistics for a given VPG. + +## SYNTAX + +``` +Get-ZARPOSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION + +Retrieves RPO historical statistics for a given VPG. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOSummary -vpgIdentifier "3456-7890-1234" +``` + +Gets the RPO Summary for the VPG with identifier "3456-7890-1234" for the past 7 days. + +### Example 2 +```powershell +PS C:\> Get-ZARPOSummary -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" +``` + +Gets the RPO Summary for the VPG with identifier "3456-7890-1234" starting January 1st, 2019 till the date this command is run. + +### Example 3 +```powershell +PS C:\> Get-ZARPOSummary -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -endDate "2019-02-01T00:00:00" +``` + +Gets the RPO Summary for the VPG with identifier "3456-7890-1234" for the Month of January. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for RPO Summary](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_rpo_summary) From 9262f1b42de7defea421d6d3631699804075a82b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 09:50:35 -0400 Subject: [PATCH 073/479] Create Get-ZARPOStat and required docs --- Tests/Public/Get-ZARPOStat.ps1 | 19 +++++ ZertoApiWrapper/Public/Get-ZARPOStat.ps1 | 26 ++++++ docs/Get-ZARPOStat.md | 104 +++++++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 Tests/Public/Get-ZARPOStat.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZARPOStat.ps1 create mode 100644 docs/Get-ZARPOStat.md diff --git a/Tests/Public/Get-ZARPOStat.ps1 b/Tests/Public/Get-ZARPOStat.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZARPOStat.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZARPOStat.ps1 b/ZertoApiWrapper/Public/Get-ZARPOStat.ps1 new file mode 100644 index 0000000..14f9a29 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZARPOStat.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZARPOStat { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -FilterTable $PSBoundParameters + $uri = "reports/stats-rpo{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZARPOStat.md b/docs/Get-ZARPOStat.md new file mode 100644 index 0000000..e3f9a91 --- /dev/null +++ b/docs/Get-ZARPOStat.md @@ -0,0 +1,104 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZARPOStat.md +schema: 2.0.0 +--- + +# Get-ZARPOStat + +## SYNOPSIS + +## SYNTAX + +``` +Get-ZARPOStat [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION +{{ Fill in the Description }} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOStat -vpgIdentifier "3456-7890-1234" +``` + +Gets the RPO Stats for the VPG with identifier "3456-7890-1234" for the past 7 days. + +### Example 2 +```powershell +PS C:\> Get-ZARPOStat -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" +``` + +Gets the RPO Stats for the VPG with identifier "3456-7890-1234" starting January 1st, 2019 till the date this command is run. + +### Example 3 +```powershell +PS C:\> Get-ZARPOStat -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -endDate "2019-02-01T00:00:00" +``` + +Gets the RPO Stats for the VPG with identifier "3456-7890-1234" for the Month of January. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for RPO Stats](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_stats_rpo) From 1c9a5bb6cb993b853b16d653ec186d0022177a16 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 09:59:05 -0400 Subject: [PATCH 074/479] Fix Get-ZARPOStat issues with tests and docs --- Tests/Public/{Get-ZARPOStat.ps1 => Get-ZARPOStat.Tests.ps1} | 0 docs/Get-ZARPOStat.md | 5 ++++- 2 files changed, 4 insertions(+), 1 deletion(-) rename Tests/Public/{Get-ZARPOStat.ps1 => Get-ZARPOStat.Tests.ps1} (100%) diff --git a/Tests/Public/Get-ZARPOStat.ps1 b/Tests/Public/Get-ZARPOStat.Tests.ps1 similarity index 100% rename from Tests/Public/Get-ZARPOStat.ps1 rename to Tests/Public/Get-ZARPOStat.Tests.ps1 diff --git a/docs/Get-ZARPOStat.md b/docs/Get-ZARPOStat.md index e3f9a91..414c814 100644 --- a/docs/Get-ZARPOStat.md +++ b/docs/Get-ZARPOStat.md @@ -9,6 +9,8 @@ schema: 2.0.0 ## SYNOPSIS +Retrieves Rpo min, max and avg. Stats. + ## SYNTAX ``` @@ -16,7 +18,8 @@ Get-ZARPOStat [-vpgIdentifier] [[-startDate] ] [[-endDate] Date: Sun, 9 Jun 2019 10:02:50 -0400 Subject: [PATCH 075/479] Create Get-ZARPOBreach and required docs. --- Tests/Public/Get-ZARPOBreach.Tests.ps1 | 19 ++++ ZertoApiWrapper/Public/Get-ZARPOBreach.ps1 | 26 +++++ docs/Get-ZARPOBreach.md | 107 +++++++++++++++++++++ 3 files changed, 152 insertions(+) create mode 100644 Tests/Public/Get-ZARPOBreach.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZARPOBreach.ps1 create mode 100644 docs/Get-ZARPOBreach.md diff --git a/Tests/Public/Get-ZARPOBreach.Tests.ps1 b/Tests/Public/Get-ZARPOBreach.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZARPOBreach.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZARPOBreach.ps1 b/ZertoApiWrapper/Public/Get-ZARPOBreach.ps1 new file mode 100644 index 0000000..3030cca --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZARPOBreach.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZARPOBreach { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -FilterTable $PSBoundParameters + $uri = "reports/rpo-breach{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZARPOBreach.md b/docs/Get-ZARPOBreach.md new file mode 100644 index 0000000..5e4ceb7 --- /dev/null +++ b/docs/Get-ZARPOBreach.md @@ -0,0 +1,107 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZARPOBreach.md +schema: 2.0.0 +--- + +# Get-ZARPOBreach + +## SYNOPSIS + +Retrieves RPO breaches over the selected timeframe. + +## SYNTAX + +``` +Get-ZARPOBreach [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION + +Retrieves RPO breaches over the selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOBreach -vpgIdentifier "3456-7890-1234" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" for the past 7 days. + +### Example 2 +```powershell +PS C:\> Get-ZARPOBreach -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" starting January 1st, 2019 till the date this command is run. + +### Example 3 +```powershell +PS C:\> Get-ZARPOBreach -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -endDate "2019-02-01T00:00:00" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" for the Month of January. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for RPO Breach](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_rpo_breach) From 675c43b35e1e001836eabb66405bda05e74c2d6d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 10:12:00 -0400 Subject: [PATCH 076/479] Create Get-ZARPOStatusProportion and Docs --- .../Get-ZARPOStatusProportion.Tests.ps1 | 19 +++ .../Public/Get-ZARPOStatusProportion.ps1 | 26 +++++ docs/Get-ZARPOStatusProportion.md | 108 ++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZARPOStatusProportion.ps1 create mode 100644 docs/Get-ZARPOStatusProportion.md diff --git a/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 b/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZARPOStatusProportion.ps1 b/ZertoApiWrapper/Public/Get-ZARPOStatusProportion.ps1 new file mode 100644 index 0000000..493d7f7 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZARPOStatusProportion.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZARPOStatusProportion { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -FilterTable $PSBoundParameters + $uri = "reports/rpo-statuses-proportions{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZARPOStatusProportion.md b/docs/Get-ZARPOStatusProportion.md new file mode 100644 index 0000000..3ad8d16 --- /dev/null +++ b/docs/Get-ZARPOStatusProportion.md @@ -0,0 +1,108 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZARPOStatusProportion.md +schema: 2.0.0 +--- + +# Get-ZARPOStatusProportion + +## SYNOPSIS + +Retrieves RPO SLA status distribution over the selected timeframe. + +## SYNTAX + +``` +Get-ZARPOStatusProportion [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves RPO SLA status distribution over the selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOStatusProportion -vpgIdentifier "3456-7890-1234" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" for the past 7 days. + +### Example 2 +```powershell +PS C:\> Get-ZARPOStatusProportion -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" starting January 1st, 2019 till the date this command is run. + +### Example 3 +```powershell +PS C:\> Get-ZARPOStatusProportion -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -endDate "2019-02-01T00:00:00" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" for the Month of January. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for RPO Statuses Proportions](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_rpo_statuses_proportions) From f3d07003b4afb3a924d69ee977126e24ae1763c6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 11:17:07 -0400 Subject: [PATCH 077/479] Create Get-ZARPOAccountAverage and Docs --- .../Public/Get-ZARPOAccountAverage.Tests.ps1 | 19 +++ .../Public/Get-ZARPOAccountAverage.ps1 | 25 ++++ docs/Get-ZARPOAccountAverage.md | 109 ++++++++++++++++++ 3 files changed, 153 insertions(+) create mode 100644 Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZARPOAccountAverage.ps1 create mode 100644 docs/Get-ZARPOAccountAverage.md diff --git a/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 b/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZARPOAccountAverage.ps1 b/ZertoApiWrapper/Public/Get-ZARPOAccountAverage.ps1 new file mode 100644 index 0000000..d9149fc --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZARPOAccountAverage.ps1 @@ -0,0 +1,25 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZARPOAccountAverage { + [CmdletBinding()] + param ( + [Parameter( + Helpmessage = "The ZORG identifier by which to filter the user's average RPO for a single account. If the ZORG identifier is omitted, statistics related to all sites, for a single account, is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -FilterTable $PSBoundParameters + $uri = "reports/account-rpo-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZARPOAccountAverage.md b/docs/Get-ZARPOAccountAverage.md new file mode 100644 index 0000000..d5eded0 --- /dev/null +++ b/docs/Get-ZARPOAccountAverage.md @@ -0,0 +1,109 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Get-ZARPOAccountAverage.md +schema: 2.0.0 +--- + +# Get-ZARPOAccountAverage + +## SYNOPSIS + +Get average RPO for all VPGs in a single account, filtered by last 30 days. + +## SYNTAX + +``` +Get-RPOAccountAverage [[-zOrgIdentifier] ] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Get average RPO for all VPGs in a single account, filtered by last 30 days. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOAccountAverage +``` + +Get average RPO for all VPGs in a single account. + +### Example 2 +```powershell +PS C:\> Get-ZARPOAccountAverage -zOrgIdentifier "1234-5678-9012" +``` + +Get average RPO for all VPGs in zOrg with identifier "1234-5678-9012". + +### Example 3 +```powershell +PS C:\> Get-ZARPOAccountAverage -startDate "2019-06-01T00:00:00Z" -endDate "2019-06-02T00:00:00Z" +``` + +Get average RPO for all VPGs in a single account for June 6th, 2019 + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the user's average RPO for a single account. +If the ZORG identifier is omitted, statistics related to all sites, for a single account, is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for RPO Average](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_account_rpo_average) From e80fab4eac1aedbd1a263d50c6753acba9241931 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 11:52:21 -0400 Subject: [PATCH 078/479] Fix Function Name Typo --- docs/Get-ZARPOAccountAverage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Get-ZARPOAccountAverage.md b/docs/Get-ZARPOAccountAverage.md index d5eded0..509bb0a 100644 --- a/docs/Get-ZARPOAccountAverage.md +++ b/docs/Get-ZARPOAccountAverage.md @@ -14,7 +14,7 @@ Get average RPO for all VPGs in a single account, filtered by last 30 days. ## SYNTAX ``` -Get-RPOAccountAverage [[-zOrgIdentifier] ] [[-startDate] ] [[-endDate] ] +Get-ZARPOAccountAverage [[-zOrgIdentifier] ] [[-startDate] ] [[-endDate] ] [] ``` From 80bad682389a400b76f87829a7ee7e40b43586a8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:02:06 -0400 Subject: [PATCH 079/479] Update Related Links description --- docs/Get-ZARPOAccountAverage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Get-ZARPOAccountAverage.md b/docs/Get-ZARPOAccountAverage.md index 509bb0a..8461d13 100644 --- a/docs/Get-ZARPOAccountAverage.md +++ b/docs/Get-ZARPOAccountAverage.md @@ -106,4 +106,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS -[Zerto Analytics REST API Endpoint for RPO Average](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_account_rpo_average) +[Zerto Analytics REST API Endpoint for Account RPO Average](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_account_rpo_average) From 72cbe0eb29d406dd5e1ef9d767ca5634cd9b678a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:02:25 -0400 Subject: [PATCH 080/479] Create Get-ZARPOAverage and Required Docs --- Tests/Public/Get-ZARPOAverage.Tests.ps1 | 19 ++++ ZertoApiWrapper/Public/Get-ZARPOAverage.ps1 | 31 +++++ docs/Get-ZARPOAverage.md | 118 ++++++++++++++++++++ 3 files changed, 168 insertions(+) create mode 100644 Tests/Public/Get-ZARPOAverage.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZARPOAverage.ps1 create mode 100644 docs/Get-ZARPOAverage.md diff --git a/Tests/Public/Get-ZARPOAverage.Tests.ps1 b/Tests/Public/Get-ZARPOAverage.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZARPOAverage.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZARPOAverage.ps1 b/ZertoApiWrapper/Public/Get-ZARPOAverage.ps1 new file mode 100644 index 0000000..2114c85 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZARPOAverage.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZARPOAverage { + [CmdletBinding()] + param ( + [Parameter( + Helpmessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be 1-minute data granularity for up to 6 hours’ time frame, 1-hour data granularity for 6 hours to 15 days’ time frame or 1-day data granularity for 15 days up to 30 days’ time frame. Value should be submitted in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoApiFilter -FilterTable $PSBoundParameters + $uri = "reports/rpo-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZARPOAverage.md b/docs/Get-ZARPOAverage.md new file mode 100644 index 0000000..cb16613 --- /dev/null +++ b/docs/Get-ZARPOAverage.md @@ -0,0 +1,118 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Get-ZARPOAverage.md +schema: 2.0.0 +--- + +# Get-ZARPOAverage + +## SYNOPSIS + +Retrieves list of average RPO values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the RPO samples interval. by default a 1 minutes interval. + +## SYNTAX + +``` +Get-ZARPOAverage [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [[-interval] ] + [] +``` + +## DESCRIPTION + +Retrieves list of average RPO values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the RPO samples interval. by default a 1 minutes interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOAverage -vpgIdentifier "5678-9012-3456" +``` + +Returns RPO Average over the past 7 days for VPG with Identifier "5678-9012-3456" + +### Example 2 +```powershell +PS C:\> Get-ZARPOAverage -vpgIdentifier "5678-9012-3456" -startDate "2019-06-01T12:00:00Z" -endDate "2019-06-01T14:00:00Z" -interval 60 +``` + +Returns RPO Average in one minute intervals for the time period between June 1st, 2019 at Noon to June 1st, 2019 at 14:00 for VPG with Identifier "5678-9012-3456" + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. +The interval can be 1-minute data granularity for up to 6 hours' time frame, 1-hour data granularity for 6 hours to 15 days' time frame or 1-day data granularity for 15 days up to 30 days' time frame. +Value should be submitted in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for RPO Average](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_rpo_average) From 89bfe61a1b35688399e8e5323ffc52c7718cd0d7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:18:11 -0400 Subject: [PATCH 081/479] Add Parameter Validation --- ZertoApiWrapper/Public/Get-ZADatastore.ps1 | 1 + ZertoApiWrapper/Public/Get-ZAVolume.ps1 | 1 + 2 files changed, 2 insertions(+) diff --git a/ZertoApiWrapper/Public/Get-ZADatastore.ps1 b/ZertoApiWrapper/Public/Get-ZADatastore.ps1 index 8f12ddb..60bdc9e 100644 --- a/ZertoApiWrapper/Public/Get-ZADatastore.ps1 +++ b/ZertoApiWrapper/Public/Get-ZADatastore.ps1 @@ -29,6 +29,7 @@ function Get-ZADatastore { ParameterSetName = "datastore", Mandatory = $true )] + [ValidateNotNullOrEmpty()] [string]$datastoreIdentifier ) diff --git a/ZertoApiWrapper/Public/Get-ZAVolume.ps1 b/ZertoApiWrapper/Public/Get-ZAVolume.ps1 index 554f2ad..662448e 100644 --- a/ZertoApiWrapper/Public/Get-ZAVolume.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAVolume.ps1 @@ -33,6 +33,7 @@ function Get-ZAVolume { Mandatory, ParameterSetName = "VpgIdentifier" )] + [ValidateNotNullOrEmpty()] [string]$vpgIdentifier ) From bb6de17e7cca21023da9e2ef82d9a57252c0ead7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:25:07 -0400 Subject: [PATCH 082/479] Create Get-ZAJournalSummary and Docs --- Tests/Public/Get-ZAJournalSummary.Tests.ps1 | 19 ++++ .../Public/Get-ZAJournalSummary.ps1 | 26 +++++ docs/Get-ZAJournalSummary.md | 101 ++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalSummary.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalSummary.ps1 create mode 100644 docs/Get-ZAJournalSummary.md diff --git a/Tests/Public/Get-ZAJournalSummary.Tests.ps1 b/Tests/Public/Get-ZAJournalSummary.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalSummary.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAJournalSummary.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSummary.ps1 new file mode 100644 index 0000000..cdcdb9a --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalSummary.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalSummary { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/journal-summary{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalSummary.md b/docs/Get-ZAJournalSummary.md new file mode 100644 index 0000000..e8cad08 --- /dev/null +++ b/docs/Get-ZAJournalSummary.md @@ -0,0 +1,101 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSummary.md +schema: 2.0.0 +--- + +# Get-ZAJournalSummary + +## SYNOPSIS + +Retrieves journal historical statistics for a given VPG. + +## SYNTAX + +``` +Get-ZAJournalSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves journal historical statistics for a given VPG. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalSummary -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal Summary information for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalSummary -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Summary information for VPG with identifier "9876-5432-1098" between the dates specified. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Summary](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_summary) From 6ab9a2dae66b351fa9b511515e8efde18726ab71 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:32:50 -0400 Subject: [PATCH 083/479] Create Get-ZAJournalStorage Stat and Docs --- .../Public/Get-ZAJournalStorageStat.Tests.ps1 | 19 ++++ .../Public/Get-ZAJournalStorageStat.ps1 | 26 +++++ docs/Get-ZAJournalStorageStat.md | 101 ++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalStorageStat.ps1 create mode 100644 docs/Get-ZAJournalStorageStat.md diff --git a/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 b/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAJournalStorageStat.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalStorageStat.ps1 new file mode 100644 index 0000000..cf2f520 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalStorageStat.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalStorageStat { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/stats-journal-storage{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalStorageStat.md b/docs/Get-ZAJournalStorageStat.md new file mode 100644 index 0000000..6b806c8 --- /dev/null +++ b/docs/Get-ZAJournalStorageStat.md @@ -0,0 +1,101 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalStorageStat.md +schema: 2.0.0 +--- + +# Get-ZAJournalSummary + +## SYNOPSIS + +Retrieves Journal Storage minimum, maximum and average. Statistics over the selected timeframe. + +## SYNTAX + +``` +Get-ZAJournalSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves Journal Storage minimum, maximum and average. Statistics over the selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalStorageStat -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal Storage Stats for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalStorageStat -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Storage Stats for VPG with identifier "9876-5432-1098" between the dates specified. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Storage Stats](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_stats_journal_storage) From ced00662441c55361a098f85c1d1b2e6e961c3b6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:41:42 -0400 Subject: [PATCH 084/479] Create Get-ZAJournalBreach and Docs --- Tests/Public/Get-ZAJournalBreach.Tests.ps1 | 19 ++++ .../Public/Get-ZAJournalBreach.ps1 | 26 +++++ docs/Get-ZAJournalBreach.md | 101 ++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalBreach.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalBreach.ps1 create mode 100644 docs/Get-ZAJournalBreach.md diff --git a/Tests/Public/Get-ZAJournalBreach.Tests.ps1 b/Tests/Public/Get-ZAJournalBreach.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalBreach.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAJournalBreach.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalBreach.ps1 new file mode 100644 index 0000000..d4afbf6 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalBreach.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalBreach { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/journal-breach{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalBreach.md b/docs/Get-ZAJournalBreach.md new file mode 100644 index 0000000..c1e6253 --- /dev/null +++ b/docs/Get-ZAJournalBreach.md @@ -0,0 +1,101 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalBreach.md +schema: 2.0.0 +--- + +# Get-ZAJournalSummary + +## SYNOPSIS + +Retrieves the journal history breaches over the selected timeframe. + +## SYNTAX + +``` +Get-ZAJournalSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves the journal history breaches over the selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalSummary -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal Breach information for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalSummary -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Breach information for VPG with identifier "9876-5432-1098" between the dates specified. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Breach](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_breach) From b934e28657a50901b43869e0228c368fcea00425 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:41:55 -0400 Subject: [PATCH 085/479] Create Get-ZAJournalHistoryStat and Docs --- .../Public/Get-ZAJournalHistoryStat.Tests.ps1 | 19 ++++ .../Public/Get-ZAJournalHistoryStat.ps1 | 26 +++++ docs/Get-ZAJournalHistoryStat.md | 101 ++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalHistoryStat.ps1 create mode 100644 docs/Get-ZAJournalHistoryStat.md diff --git a/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 b/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAJournalHistoryStat.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalHistoryStat.ps1 new file mode 100644 index 0000000..d973aea --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalHistoryStat.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalHistoryStat { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/stats-journal-history{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalHistoryStat.md b/docs/Get-ZAJournalHistoryStat.md new file mode 100644 index 0000000..63b56e4 --- /dev/null +++ b/docs/Get-ZAJournalHistoryStat.md @@ -0,0 +1,101 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalHistoryStat.md +schema: 2.0.0 +--- + +# Get-ZAJournalSummary + +## SYNOPSIS + +Retrieves Journal history min, max and avg Statistics over the selected timeframe. + +## SYNTAX + +``` +Get-ZAJournalSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves Journal history min, max and avg Statistics over the selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalStorageStat -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal History Stats for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalStorageStat -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal History Stats for VPG with identifier "9876-5432-1098" between the dates specified. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal History Stats](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_stats_journal_history) From 0226fdd432f99111c5f102579824319831a09bd3 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:49:09 -0400 Subject: [PATCH 086/479] Fix Function Name Typos in Docs --- docs/Get-ZAJournalBreach.md | 8 ++++---- docs/Get-ZAJournalHistoryStat.md | 8 ++++---- docs/Get-ZAJournalStorageStat.md | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/Get-ZAJournalBreach.md b/docs/Get-ZAJournalBreach.md index c1e6253..03e25ba 100644 --- a/docs/Get-ZAJournalBreach.md +++ b/docs/Get-ZAJournalBreach.md @@ -5,7 +5,7 @@ online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/ schema: 2.0.0 --- -# Get-ZAJournalSummary +# Get-ZAJournalBreach ## SYNOPSIS @@ -14,7 +14,7 @@ Retrieves the journal history breaches over the selected timeframe. ## SYNTAX ``` -Get-ZAJournalSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] +Get-ZAJournalBreach [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] ``` @@ -26,14 +26,14 @@ Retrieves the journal history breaches over the selected timeframe. ### Example 1 ```powershell -PS C:\> Get-ZAJournalSummary -vpgIdentifier "9876-5432-1098" +PS C:\> Get-ZAJournalBreach -vpgIdentifier "9876-5432-1098" ``` Returns Journal Breach information for VPG with identifier "9876-5432-1098" ### Example 2 ```powershell -PS C:\> Get-ZAJournalSummary -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +PS C:\> Get-ZAJournalBreach -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" ``` Returns Journal Breach information for VPG with identifier "9876-5432-1098" between the dates specified. diff --git a/docs/Get-ZAJournalHistoryStat.md b/docs/Get-ZAJournalHistoryStat.md index 63b56e4..957ffc4 100644 --- a/docs/Get-ZAJournalHistoryStat.md +++ b/docs/Get-ZAJournalHistoryStat.md @@ -5,7 +5,7 @@ online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/ schema: 2.0.0 --- -# Get-ZAJournalSummary +# Get-ZAJournalHistoryStat ## SYNOPSIS @@ -14,7 +14,7 @@ Retrieves Journal history min, max and avg Statistics over the selected timefram ## SYNTAX ``` -Get-ZAJournalSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] +Get-ZAJournalHistoryStat [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] ``` @@ -26,14 +26,14 @@ Retrieves Journal history min, max and avg Statistics over the selected timefram ### Example 1 ```powershell -PS C:\> Get-ZAJournalStorageStat -vpgIdentifier "9876-5432-1098" +PS C:\> Get-ZAJournalHistoryStat -vpgIdentifier "9876-5432-1098" ``` Returns Journal History Stats for VPG with identifier "9876-5432-1098" ### Example 2 ```powershell -PS C:\> Get-ZAJournalStorageStat -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +PS C:\> Get-ZAJournalHistoryStat -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" ``` Returns Journal History Stats for VPG with identifier "9876-5432-1098" between the dates specified. diff --git a/docs/Get-ZAJournalStorageStat.md b/docs/Get-ZAJournalStorageStat.md index 6b806c8..625f650 100644 --- a/docs/Get-ZAJournalStorageStat.md +++ b/docs/Get-ZAJournalStorageStat.md @@ -5,7 +5,7 @@ online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/ schema: 2.0.0 --- -# Get-ZAJournalSummary +# Get-ZAJournalStorageStat ## SYNOPSIS @@ -14,7 +14,7 @@ Retrieves Journal Storage minimum, maximum and average. Statistics over the sele ## SYNTAX ``` -Get-ZAJournalSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] +Get-ZAJournalStorageStat [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] ``` From 0fda0c1e78fbe0ca164bdea6fe5f0aa4ad4e85b2 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 12:49:45 -0400 Subject: [PATCH 087/479] Create Function and Docs Get-ZAJournalStatusProportion --- .../Get-ZAJournalStatusProportion.Tests.ps1 | 19 ++++ .../Public/Get-ZAJournalStatusProportion.ps1 | 26 +++++ docs/Get-ZAJournalStatusProportion.md | 101 ++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalStatusProportion.ps1 create mode 100644 docs/Get-ZAJournalStatusProportion.md diff --git a/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 b/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAJournalStatusProportion.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalStatusProportion.ps1 new file mode 100644 index 0000000..9595675 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalStatusProportion.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalStatusProportion { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/journal-statuses-proportions{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalStatusProportion.md b/docs/Get-ZAJournalStatusProportion.md new file mode 100644 index 0000000..0e6ae7d --- /dev/null +++ b/docs/Get-ZAJournalStatusProportion.md @@ -0,0 +1,101 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalStatusProportion.md +schema: 2.0.0 +--- + +# Get-ZAJournalStatusProportion + +## SYNOPSIS + +Retrieves journal history SLA status distribution over selected timeframe. + +## SYNTAX + +``` +Get-ZAJournalStatusProportion [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves journal history SLA status distribution over selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalStatusProportion -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal history SLA status distribution for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalStatusProportion -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journalhistory SLA status distribution for VPG with identifier "9876-5432-1098" between the dates specified. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Statuses Proportions](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_statuses_proportions) From d46869353b57eace7d06da6ee92da49a364b64da Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 14:50:54 -0400 Subject: [PATCH 088/479] Create Function and Required Docs Get-ZAJournalAverageHistory --- .../Get-ZAJournalAverageHistory.Tests.ps1 | 19 +++ .../Public/Get-ZAJournalAverageHistory.ps1 | 31 +++++ docs/Get-ZAJournalAverageHistory.md | 123 ++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalAverageHistory.ps1 create mode 100644 docs/Get-ZAJournalAverageHistory.md diff --git a/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAJournalAverageHistory.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalAverageHistory.ps1 new file mode 100644 index 0000000..4dc0ca2 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalAverageHistory.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalAverageHistory { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/journal-history-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalAverageHistory.md b/docs/Get-ZAJournalAverageHistory.md new file mode 100644 index 0000000..de1aafe --- /dev/null +++ b/docs/Get-ZAJournalAverageHistory.md @@ -0,0 +1,123 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalAverageHistory.md +schema: 2.0.0 +--- + +# Get-ZAJournalAverageHistory + +## SYNOPSIS + +Retrieves the list of historical average journal history values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## SYNTAX + +``` +Get-ZAJournalAverageHistory [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Retrieves the list of historical average journal history values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalAverageHistory -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal Average History information for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalAverageHistory -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Average History for VPG with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalAverageHistory -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Average History for VPG with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Average History](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_history_average) From ca2620d9b588e047e7ac8083fec473a4abc5012e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 14:51:16 -0400 Subject: [PATCH 089/479] Create function and required docs Get-ZAJournalAverageSiteHistory --- .../Get-ZAJournalAverageSiteHistory.Tests.ps1 | 19 +++ .../Get-ZAJournalAverageSiteHistory.ps1 | 31 +++++ docs/Get-ZAJournalAverageSiteHistory.md | 123 ++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalAverageSiteHistory.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalAverageSiteHistory.ps1 create mode 100644 docs/Get-ZAJournalAverageSiteHistory.md diff --git a/Tests/Public/Get-ZAJournalAverageSiteHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageSiteHistory.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalAverageSiteHistory.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteHistory.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteHistory.ps1 new file mode 100644 index 0000000..b5942a3 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteHistory.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalAverageSiteHistory { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the recovery site. A site identification is required for at least one site.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$recoverySiteIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/site-journal-history-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalAverageSiteHistory.md b/docs/Get-ZAJournalAverageSiteHistory.md new file mode 100644 index 0000000..aed6665 --- /dev/null +++ b/docs/Get-ZAJournalAverageSiteHistory.md @@ -0,0 +1,123 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalAverageSiteHistory.md +schema: 2.0.0 +--- + +# Get-ZAJournalAverageSiteHistory + +## SYNOPSIS + +Get list of samples of average Journal History values for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the Journal History samples interval. + +## SYNTAX + +``` +Get-ZAJournalAverageSiteHistory [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get list of samples of average Journal History values for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the Journal History samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalAverageSiteHistory -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalAverageSiteHistory -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalAverageSiteHistory -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Average Site History](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_history_average) From 1110fcc56aed6ea4705f2273beb98ca013f4b2c8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 14:51:38 -0400 Subject: [PATCH 090/479] Create Function and required docs Get-JournalAverageSize --- .../Public/Get-ZAJournalAverageSize.Tests.ps1 | 19 +++ .../Public/Get-ZAJournalAverageSize.ps1 | 31 +++++ docs/Get-ZAJournalAverageSize.md | 123 ++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalAverageSize.ps1 create mode 100644 docs/Get-ZAJournalAverageSize.md diff --git a/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAJournalAverageSize.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalAverageSize.ps1 new file mode 100644 index 0000000..26f7955 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalAverageSize.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalAverageSize { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/journal-size-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalAverageSize.md b/docs/Get-ZAJournalAverageSize.md new file mode 100644 index 0000000..8517622 --- /dev/null +++ b/docs/Get-ZAJournalAverageSize.md @@ -0,0 +1,123 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalAverageSize.md +schema: 2.0.0 +--- + +# Get-ZAJournalAverageSize + +## SYNOPSIS + +Retrieves the list of historical average journal storage values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the journal storage samples interval. + +## SYNTAX + +``` +Get-ZAJournalAverageSize [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Retrieves the list of historical average journal storage values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the journal storage samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalAverageSize -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal Average Size information for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalAverageSize -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Average Size for VPG with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalAverageSize -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Average Size for VPG with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Average Size](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_size_average) From aeeaf73da0f29e72b9df0bfa4bf10bbda0a7f6e8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 14:57:38 -0400 Subject: [PATCH 091/479] Correct Parameter Error --- docs/Get-ZAJournalAverageSiteHistory.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Get-ZAJournalAverageSiteHistory.md b/docs/Get-ZAJournalAverageSiteHistory.md index aed6665..38b7133 100644 --- a/docs/Get-ZAJournalAverageSiteHistory.md +++ b/docs/Get-ZAJournalAverageSiteHistory.md @@ -14,7 +14,7 @@ Get list of samples of average Journal History values for all VPGs replicating t ## SYNTAX ``` -Get-ZAJournalAverageSiteHistory [-vpgIdentifier] [[-startDate] ] [[-endDate] ] +Get-ZAJournalAverageSiteHistory [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] [[-interval] ] [] ``` From eb528e3432a446c437061f2f87c2b209a9c478a9 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 14:58:04 -0400 Subject: [PATCH 092/479] Create Function and Required Docs Get-ZAJournalAverageSize --- .../Get-ZAJournalAverageSiteSize.Tests.ps1 | 19 +++ .../Public/Get-ZAJournalAverageSiteSize.ps1 | 31 +++++ docs/Get-ZAJournalAverageSiteSize.md | 123 ++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalAverageSiteSize.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalAverageSiteSize.ps1 create mode 100644 docs/Get-ZAJournalAverageSiteSize.md diff --git a/Tests/Public/Get-ZAJournalAverageSiteSize.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageSiteSize.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalAverageSiteSize.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteSize.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteSize.ps1 new file mode 100644 index 0000000..d1c31f6 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteSize.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalAverageSiteSize { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the recovery site. A site identification is required for at least one site.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$recoverySiteIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/site-journal-size-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalAverageSiteSize.md b/docs/Get-ZAJournalAverageSiteSize.md new file mode 100644 index 0000000..a8935a7 --- /dev/null +++ b/docs/Get-ZAJournalAverageSiteSize.md @@ -0,0 +1,123 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalAverageSiteSize.md +schema: 2.0.0 +--- + +# Get-ZAJournalAverageSiteSize + +## SYNOPSIS + +Get list of samples of total Journal Size of all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the Journal Size samples interval. + +## SYNTAX + +``` +Get-ZAJournalAverageSiteSize [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get list of samples of total Journal Size of all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the Journal Size samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalAverageSiteSize -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalAverageSiteSize -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalAverageSiteSize -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Average Site Size](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_size_average) From 5bd2d83cc898e1ab2c576f899ec8ada2300b21d1 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 15:07:40 -0400 Subject: [PATCH 093/479] Create function and associated docs Get-ZAJournalHistorySiteStat --- .../Get-ZAJournalHistorySiteStat.Tests.ps1 | 19 +++ .../Public/Get-ZAJournalHistorySiteStat.ps1 | 31 +++++ docs/Get-ZAJournalHistorySiteStat.md | 123 ++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalHistorySiteStat.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalHistorySiteStat.ps1 create mode 100644 docs/Get-ZAJournalHistorySiteStat.md diff --git a/Tests/Public/Get-ZAJournalHistorySiteStat.Tests.ps1 b/Tests/Public/Get-ZAJournalHistorySiteStat.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalHistorySiteStat.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAJournalHistorySiteStat.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalHistorySiteStat.ps1 new file mode 100644 index 0000000..43e3993 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalHistorySiteStat.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalHistorySiteStat { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/site-journal-history-stats{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalHistorySiteStat.md b/docs/Get-ZAJournalHistorySiteStat.md new file mode 100644 index 0000000..ffdb292 --- /dev/null +++ b/docs/Get-ZAJournalHistorySiteStat.md @@ -0,0 +1,123 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalHistorySiteStat.md +schema: 2.0.0 +--- + +# Get-ZAJournalHistorySiteStat + +## SYNOPSIS + +Get Max, Avg. and Min Journal History statistics for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## SYNTAX + +``` +Get-ZAJournalHistorySiteStat [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get Max, Avg. and Min Journal History statistics for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalHistorySiteStat -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalHistorySiteStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalHistorySiteStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Site History Stats](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_history_stats) From d2b559ec83d9110f90c19065014bd44a85aa67e5 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 15:25:36 -0400 Subject: [PATCH 094/479] Function Rename --- ...ps1 => Get-ZAJournalSiteAverageHistory.Tests.ps1} | 0 ...story.ps1 => Get-ZAJournalSiteAverageHistory.ps1} | 2 +- ...History.md => Get-ZAJournalSiteAverageHistory.md} | 12 ++++++------ 3 files changed, 7 insertions(+), 7 deletions(-) rename Tests/Public/{Get-ZAJournalAverageSiteHistory.Tests.ps1 => Get-ZAJournalSiteAverageHistory.Tests.ps1} (100%) rename ZertoApiWrapper/Public/{Get-ZAJournalAverageSiteHistory.ps1 => Get-ZAJournalSiteAverageHistory.ps1} (96%) rename docs/{Get-ZAJournalAverageSiteHistory.md => Get-ZAJournalSiteAverageHistory.md} (90%) diff --git a/Tests/Public/Get-ZAJournalAverageSiteHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 similarity index 100% rename from Tests/Public/Get-ZAJournalAverageSiteHistory.Tests.ps1 rename to Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteHistory.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSiteAverageHistory.ps1 similarity index 96% rename from ZertoApiWrapper/Public/Get-ZAJournalAverageSiteHistory.ps1 rename to ZertoApiWrapper/Public/Get-ZAJournalSiteAverageHistory.ps1 index b5942a3..a9a06f0 100644 --- a/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteHistory.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAJournalSiteAverageHistory.ps1 @@ -1,5 +1,5 @@ <# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> -function Get-ZAJournalAverageSiteHistory { +function Get-ZAJournalSiteAverageHistory { [CmdletBinding()] param ( [Parameter( diff --git a/docs/Get-ZAJournalAverageSiteHistory.md b/docs/Get-ZAJournalSiteAverageHistory.md similarity index 90% rename from docs/Get-ZAJournalAverageSiteHistory.md rename to docs/Get-ZAJournalSiteAverageHistory.md index 38b7133..13a0bb6 100644 --- a/docs/Get-ZAJournalAverageSiteHistory.md +++ b/docs/Get-ZAJournalSiteAverageHistory.md @@ -1,11 +1,11 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalAverageSiteHistory.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteAverageHistory.md schema: 2.0.0 --- -# Get-ZAJournalAverageSiteHistory +# Get-ZAJournalSiteAverageHistory ## SYNOPSIS @@ -14,7 +14,7 @@ Get list of samples of average Journal History values for all VPGs replicating t ## SYNTAX ``` -Get-ZAJournalAverageSiteHistory [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] +Get-ZAJournalSiteAverageHistory [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] [[-interval] ] [] ``` @@ -26,21 +26,21 @@ Get list of samples of average Journal History values for all VPGs replicating t ### Example 1 ```powershell -PS C:\> Get-ZAJournalAverageSiteHistory -recoverySiteIdentifier "9876-5432-1098" +PS C:\> Get-ZAJournalSiteAverageHistory -recoverySiteIdentifier "9876-5432-1098" ``` Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" ### Example 2 ```powershell -PS C:\> Get-ZAJournalAverageSiteHistory -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +PS C:\> Get-ZAJournalSiteAverageHistory -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" ``` Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified. ### Example 3 ```powershell -PS C:\> Get-ZAJournalAverageSiteHistory -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +PS C:\> Get-ZAJournalSiteAverageHistory -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 ``` Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. From 108cb12439ae2f304f14b87f1b8ac9b92e81ef77 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 15:26:14 -0400 Subject: [PATCH 095/479] Function Rename --- ...ts.ps1 => Get-ZAJournalSiteAverageSize.Tests.ps1} | 0 ...SiteSize.ps1 => Get-ZAJournalSiteAverageSize.ps1} | 2 +- ...geSiteSize.md => Get-ZAJournalSiteAverageSize.md} | 12 ++++++------ 3 files changed, 7 insertions(+), 7 deletions(-) rename Tests/Public/{Get-ZAJournalAverageSiteSize.Tests.ps1 => Get-ZAJournalSiteAverageSize.Tests.ps1} (100%) rename ZertoApiWrapper/Public/{Get-ZAJournalAverageSiteSize.ps1 => Get-ZAJournalSiteAverageSize.ps1} (97%) rename docs/{Get-ZAJournalAverageSiteSize.md => Get-ZAJournalSiteAverageSize.md} (90%) diff --git a/Tests/Public/Get-ZAJournalAverageSiteSize.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 similarity index 100% rename from Tests/Public/Get-ZAJournalAverageSiteSize.Tests.ps1 rename to Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteSize.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSiteAverageSize.ps1 similarity index 97% rename from ZertoApiWrapper/Public/Get-ZAJournalAverageSiteSize.ps1 rename to ZertoApiWrapper/Public/Get-ZAJournalSiteAverageSize.ps1 index d1c31f6..822f46f 100644 --- a/ZertoApiWrapper/Public/Get-ZAJournalAverageSiteSize.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAJournalSiteAverageSize.ps1 @@ -1,5 +1,5 @@ <# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> -function Get-ZAJournalAverageSiteSize { +function Get-ZAJournalSiteAverageSize { [CmdletBinding()] param ( [Parameter( diff --git a/docs/Get-ZAJournalAverageSiteSize.md b/docs/Get-ZAJournalSiteAverageSize.md similarity index 90% rename from docs/Get-ZAJournalAverageSiteSize.md rename to docs/Get-ZAJournalSiteAverageSize.md index a8935a7..dc1510c 100644 --- a/docs/Get-ZAJournalAverageSiteSize.md +++ b/docs/Get-ZAJournalSiteAverageSize.md @@ -1,11 +1,11 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalAverageSiteSize.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteAverageSize.md schema: 2.0.0 --- -# Get-ZAJournalAverageSiteSize +# Get-ZAJournalSiteAverageSize ## SYNOPSIS @@ -14,7 +14,7 @@ Get list of samples of total Journal Size of all VPGs replicating to a specified ## SYNTAX ``` -Get-ZAJournalAverageSiteSize [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] +Get-ZAJournalSiteAverageSize [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] [[-interval] ] [] ``` @@ -26,21 +26,21 @@ Get list of samples of total Journal Size of all VPGs replicating to a specified ### Example 1 ```powershell -PS C:\> Get-ZAJournalAverageSiteSize -recoverySiteIdentifier "9876-5432-1098" +PS C:\> Get-ZAJournalSiteAverageSize -recoverySiteIdentifier "9876-5432-1098" ``` Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" ### Example 2 ```powershell -PS C:\> Get-ZAJournalAverageSiteSize -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +PS C:\> Get-ZAJournalSiteAverageSize -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" ``` Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" between the dates specified. ### Example 3 ```powershell -PS C:\> Get-ZAJournalAverageSiteSize -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +PS C:\> Get-ZAJournalSiteAverageSize -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 ``` Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. From a74bc14e306b0dd60c74fd5d2e187cbfe41a2ca7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 15:26:28 -0400 Subject: [PATCH 096/479] Function Rename --- ...ts.ps1 => Get-ZAJournalSiteHistoryStat.Tests.ps1} | 0 ...SiteStat.ps1 => Get-ZAJournalSiteHistoryStat.ps1} | 2 +- ...rySiteStat.md => Get-ZAJournalSiteHistoryStat.md} | 12 ++++++------ 3 files changed, 7 insertions(+), 7 deletions(-) rename Tests/Public/{Get-ZAJournalHistorySiteStat.Tests.ps1 => Get-ZAJournalSiteHistoryStat.Tests.ps1} (100%) rename ZertoApiWrapper/Public/{Get-ZAJournalHistorySiteStat.ps1 => Get-ZAJournalSiteHistoryStat.ps1} (96%) rename docs/{Get-ZAJournalHistorySiteStat.md => Get-ZAJournalSiteHistoryStat.md} (90%) diff --git a/Tests/Public/Get-ZAJournalHistorySiteStat.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 similarity index 100% rename from Tests/Public/Get-ZAJournalHistorySiteStat.Tests.ps1 rename to Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZAJournalHistorySiteStat.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSiteHistoryStat.ps1 similarity index 96% rename from ZertoApiWrapper/Public/Get-ZAJournalHistorySiteStat.ps1 rename to ZertoApiWrapper/Public/Get-ZAJournalSiteHistoryStat.ps1 index 43e3993..98b5823 100644 --- a/ZertoApiWrapper/Public/Get-ZAJournalHistorySiteStat.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAJournalSiteHistoryStat.ps1 @@ -1,5 +1,5 @@ <# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> -function Get-ZAJournalHistorySiteStat { +function Get-ZAJournalSiteHistoryStat { [CmdletBinding()] param ( [Parameter( diff --git a/docs/Get-ZAJournalHistorySiteStat.md b/docs/Get-ZAJournalSiteHistoryStat.md similarity index 90% rename from docs/Get-ZAJournalHistorySiteStat.md rename to docs/Get-ZAJournalSiteHistoryStat.md index ffdb292..437cde4 100644 --- a/docs/Get-ZAJournalHistorySiteStat.md +++ b/docs/Get-ZAJournalSiteHistoryStat.md @@ -1,11 +1,11 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalHistorySiteStat.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteHistoryStat.md schema: 2.0.0 --- -# Get-ZAJournalHistorySiteStat +# Get-ZAJournalSiteHistoryStat ## SYNOPSIS @@ -14,7 +14,7 @@ Get Max, Avg. and Min Journal History statistics for all VPGs replicating to a s ## SYNTAX ``` -Get-ZAJournalHistorySiteStat [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] +Get-ZAJournalSiteHistoryStat [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] [[-interval] ] [] ``` @@ -26,21 +26,21 @@ Get Max, Avg. and Min Journal History statistics for all VPGs replicating to a s ### Example 1 ```powershell -PS C:\> Get-ZAJournalHistorySiteStat -recoverySiteIdentifier "9876-5432-1098" +PS C:\> Get-ZAJournalSiteHistoryStat -recoverySiteIdentifier "9876-5432-1098" ``` Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" ### Example 2 ```powershell -PS C:\> Get-ZAJournalHistorySiteStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +PS C:\> Get-ZAJournalSiteHistoryStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" ``` Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified. ### Example 3 ```powershell -PS C:\> Get-ZAJournalHistorySiteStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +PS C:\> Get-ZAJournalSiteHistoryStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 ``` Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. From 8b6f4999b2ffcb1a522386254f8603e237761de7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 15:27:02 -0400 Subject: [PATCH 097/479] Create Function and Required Docs Get-ZAJournalSiteSizeStat --- .../Get-ZAJournalSiteSizeStat.Tests.ps1 | 19 +++ .../Public/Get-ZAJournalSiteSizeStat.ps1 | 31 +++++ docs/Get-ZAJournalSiteSizeStat.md | 123 ++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 create mode 100644 docs/Get-ZAJournalSiteSizeStat.md diff --git a/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 new file mode 100644 index 0000000..4461d57 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalSiteSizeStat { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/site-journal-size-stats{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalSiteSizeStat.md b/docs/Get-ZAJournalSiteSizeStat.md new file mode 100644 index 0000000..35069c1 --- /dev/null +++ b/docs/Get-ZAJournalSiteSizeStat.md @@ -0,0 +1,123 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteSizeStat.md +schema: 2.0.0 +--- + +# Get-ZAJournalSiteSizeStat + +## SYNOPSIS + +Get Max, Avg. and Min of total Journal Size statistics for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## SYNTAX + +``` +Get-ZAJournalSiteSizeStat [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get Max, Avg. and Min of total Journal Size statistics for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalSiteSizeStat -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns Journal Size Statistics information for the recovery site with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalSiteSizeStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Size Statistics information for the recovery site with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalSiteSizeStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Size Statistics information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Site size Stats](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_size_stats) From 7a80131e950674cb5980eb105e8f54553bfd700c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 15:31:09 -0400 Subject: [PATCH 098/479] Create Function and required docs Get-ZAJournalSiteHistorySummary --- .../Get-ZAJournalSiteHistorySummary.Tests.ps1 | 19 +++ .../Get-ZAJournalSiteHistorySummary.ps1 | 31 +++++ docs/Get-ZAJournalSiteHistorySummary.md | 123 ++++++++++++++++++ 3 files changed, 173 insertions(+) create mode 100644 Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 create mode 100644 docs/Get-ZAJournalSiteHistorySummary.md diff --git a/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 new file mode 100644 index 0000000..c749572 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAJournalSiteHistorySummary { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The identifier of the VPG.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoApiFilter -filtertable $PSBoundParameters + $uri = "reports/site-journal-history-summary{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZAJournalSiteHistorySummary.md b/docs/Get-ZAJournalSiteHistorySummary.md new file mode 100644 index 0000000..e986549 --- /dev/null +++ b/docs/Get-ZAJournalSiteHistorySummary.md @@ -0,0 +1,123 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteHistorySummary.md +schema: 2.0.0 +--- + +# Get-ZAJournalSiteHistorySummary + +## SYNOPSIS + +Get a Journal History executive summary for all VPGs replicating to a specified recovery site. + +## SYNTAX + +``` +Get-ZAJournalSiteHistorySummary [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get a Journal History executive summary for all VPGs replicating to a specified recovery site. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalSiteHistorySummary -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns Journal History Executive Summary information for the recovery site with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalSiteHistorySummary -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal History Executive Summary information for the recovery site with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalSiteHistorySummary -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal History Executive Summary information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Site History Summary](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_history_summary) From 27c44056a52f64b8a10d6354fa1d1a10dfcbb2c0 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 16:02:16 -0400 Subject: [PATCH 099/479] Create Function and Associated Docs Get-ZASitePair --- Tests/Public/Get-ZASitePair.Tests.ps1 | 19 ++++ ZertoApiWrapper/Public/Get-ZASitePair.ps1 | 24 +++++ docs/Get-ZASitePair.md | 104 ++++++++++++++++++++++ 3 files changed, 147 insertions(+) create mode 100644 Tests/Public/Get-ZASitePair.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZASitePair.ps1 create mode 100644 docs/Get-ZASitePair.md diff --git a/Tests/Public/Get-ZASitePair.Tests.ps1 b/Tests/Public/Get-ZASitePair.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZASitePair.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZASitePair.ps1 b/ZertoApiWrapper/Public/Get-ZASitePair.ps1 new file mode 100644 index 0000000..1c3d724 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZASitePair.ps1 @@ -0,0 +1,24 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZASitePair { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the site list. If the ZORG identifier is omitted, a list of all sites is retrieved." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the start date is omitted, the default start date is 7 days before the end date." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the end date is omitted, the default endDate is the current date." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + $filter = Get-ZertoApiFilter -filterTable $PSBoundParameters + $uri = "reports/sites-list{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZASitePair.md b/docs/Get-ZASitePair.md new file mode 100644 index 0000000..f616f8b --- /dev/null +++ b/docs/Get-ZASitePair.md @@ -0,0 +1,104 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZASitePair.md +schema: 2.0.0 +--- + +# Get-ZASitePair + +## SYNOPSIS + +Get all the sites, protected and recovery, filtered by start date and end date. + +## SYNTAX + +``` +Get-ZASitePair [[-zOrgIdentifier] ] [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION + +Get all the sites, protected and recovery, filtered by start date and end date. +* When startDate is omitted, the default startDate is 7 days before the endDate. +* When endDate is ommited, the default endDate is the current date. +* When both startDate and endDate are omitted, the default date range is the last 7 days. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZASitePair +``` + +Returns all site pairings. + +### Example 1 +```powershell +PS C:\> Get-ZASitePair -zOrgIdentifier "9876-5432-1098" +``` + +Returns all site pairings belonging to zOrg with Identifier "9876-5432-1098". + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default endDate is the current date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the site list. +If the ZORG identifier is omitted, a list of all sites is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Site Pairs](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_list) From 58e948dfbce1dac03d6d6dccfe12072c1e48d7ae Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 16:03:02 -0400 Subject: [PATCH 100/479] Update Help Parameters --- docs/Get-ZAJournalSiteAverageHistory.md | 34 ++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/Get-ZAJournalSiteAverageHistory.md b/docs/Get-ZAJournalSiteAverageHistory.md index 13a0bb6..e514e06 100644 --- a/docs/Get-ZAJournalSiteAverageHistory.md +++ b/docs/Get-ZAJournalSiteAverageHistory.md @@ -14,8 +14,8 @@ Get list of samples of average Journal History values for all VPGs replicating t ## SYNTAX ``` -Get-ZAJournalSiteAverageHistory [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] - [[-interval] ] [] +Get-ZAJournalSiteAverageHistory [-recoverySiteIdentifier] [[-startDate] ] + [[-endDate] ] [[-interval] ] [] ``` ## DESCRIPTION @@ -78,6 +78,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -recoverySiteIdentifier +The identifier of the recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -startDate The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days. @@ -94,21 +109,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -recoverySiteIdentifier -The identifier of the VPG. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). From 1da569fa6acf0e9f4df948e9a905c1669cf0ca83 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 16:03:31 -0400 Subject: [PATCH 101/479] Correct Parameter in Help File --- docs/Get-ZAJournalSiteAverageSize.md | 30 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/Get-ZAJournalSiteAverageSize.md b/docs/Get-ZAJournalSiteAverageSize.md index dc1510c..7699b8c 100644 --- a/docs/Get-ZAJournalSiteAverageSize.md +++ b/docs/Get-ZAJournalSiteAverageSize.md @@ -78,6 +78,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -recoverySiteIdentifier +The identifier of the recovery Site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -startDate The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days. @@ -94,21 +109,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -recoverySiteIdentifier -The identifier of the VPG. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). From c6a53688ec7706f4b856c175680df9d55a69e908 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 16:04:57 -0400 Subject: [PATCH 102/479] Correct Parameter Variable Name --- ZertoApiWrapper/Public/Get-ZAJournalSiteHistoryStat.ps1 | 4 ++-- docs/Get-ZAJournalSiteHistoryStat.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZAJournalSiteHistoryStat.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSiteHistoryStat.ps1 index 98b5823..c911cd1 100644 --- a/ZertoApiWrapper/Public/Get-ZAJournalSiteHistoryStat.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAJournalSiteHistoryStat.ps1 @@ -3,11 +3,11 @@ function Get-ZAJournalSiteHistoryStat { [CmdletBinding()] param ( [Parameter( - HelpMessage = "The identifier of the VPG.", + HelpMessage = "The identifier of the recovery site.", Mandatory )] [ValidateNotNullOrEmpty()] - [string]$vpgIdentifier, + [string]$recoverySiteIdentifier, [Parameter( HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." )] diff --git a/docs/Get-ZAJournalSiteHistoryStat.md b/docs/Get-ZAJournalSiteHistoryStat.md index 437cde4..1b247a6 100644 --- a/docs/Get-ZAJournalSiteHistoryStat.md +++ b/docs/Get-ZAJournalSiteHistoryStat.md @@ -95,7 +95,7 @@ Accept wildcard characters: False ``` ### -recoverySiteIdentifier -The identifier of the VPG. +The identifier of the recovery site. ```yaml Type: String From d31b4ce995696abd1fd7d334ddc5de3fe0a39c8d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 16:05:47 -0400 Subject: [PATCH 103/479] Update Mis-named variable --- ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 | 4 ++-- docs/Get-ZAJournalSiteHistorySummary.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 index c749572..b8f2688 100644 --- a/ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAJournalSiteHistorySummary.ps1 @@ -3,11 +3,11 @@ function Get-ZAJournalSiteHistorySummary { [CmdletBinding()] param ( [Parameter( - HelpMessage = "The identifier of the VPG.", + HelpMessage = "The identifier of the recovery site.", Mandatory )] [ValidateNotNullOrEmpty()] - [string]$vpgIdentifier, + [string]$recoverySiteIdentifier, [Parameter( HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." )] diff --git a/docs/Get-ZAJournalSiteHistorySummary.md b/docs/Get-ZAJournalSiteHistorySummary.md index e986549..9f18690 100644 --- a/docs/Get-ZAJournalSiteHistorySummary.md +++ b/docs/Get-ZAJournalSiteHistorySummary.md @@ -95,7 +95,7 @@ Accept wildcard characters: False ``` ### -recoverySiteIdentifier -The identifier of the VPG. +The identifier of the recovery site. ```yaml Type: String From e33b45a274825ed0a990aa5c004816f9c6201c0b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 16:06:24 -0400 Subject: [PATCH 104/479] Correct mis-named variable --- ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 | 2 +- docs/Get-ZAJournalSiteSizeStat.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 b/ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 index 4461d57..0f1df3e 100644 --- a/ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAJournalSiteSizeStat.ps1 @@ -7,7 +7,7 @@ function Get-ZAJournalSiteSizeStat { Mandatory )] [ValidateNotNullOrEmpty()] - [string]$vpgIdentifier, + [string]$recoverySiteIdentifier, [Parameter( HelpMessage = "The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days." )] diff --git a/docs/Get-ZAJournalSiteSizeStat.md b/docs/Get-ZAJournalSiteSizeStat.md index 35069c1..2fada19 100644 --- a/docs/Get-ZAJournalSiteSizeStat.md +++ b/docs/Get-ZAJournalSiteSizeStat.md @@ -95,7 +95,7 @@ Accept wildcard characters: False ``` ### -recoverySiteIdentifier -The identifier of the VPG. +The identifier of the recovery site. ```yaml Type: String From fb7fd5abb80bae708065c9939f0ee9a88c4bc7eb Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 16:18:09 -0400 Subject: [PATCH 105/479] Update Parameter Information --- docs/Get-ZAJournalSiteHistoryStat.md | 30 +++++++++++----------- docs/Get-ZAJournalSiteHistorySummary.md | 34 ++++++++++++------------- docs/Get-ZAJournalSiteSizeStat.md | 30 +++++++++++----------- 3 files changed, 47 insertions(+), 47 deletions(-) diff --git a/docs/Get-ZAJournalSiteHistoryStat.md b/docs/Get-ZAJournalSiteHistoryStat.md index 1b247a6..d88a655 100644 --- a/docs/Get-ZAJournalSiteHistoryStat.md +++ b/docs/Get-ZAJournalSiteHistoryStat.md @@ -78,6 +78,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -recoverySiteIdentifier +The identifier of the recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -startDate The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days. @@ -94,21 +109,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -recoverySiteIdentifier -The identifier of the recovery site. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/docs/Get-ZAJournalSiteHistorySummary.md b/docs/Get-ZAJournalSiteHistorySummary.md index 9f18690..e5e6d36 100644 --- a/docs/Get-ZAJournalSiteHistorySummary.md +++ b/docs/Get-ZAJournalSiteHistorySummary.md @@ -14,8 +14,8 @@ Get a Journal History executive summary for all VPGs replicating to a specified ## SYNTAX ``` -Get-ZAJournalSiteHistorySummary [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] - [[-interval] ] [] +Get-ZAJournalSiteHistorySummary [-recoverySiteIdentifier] [[-startDate] ] + [[-endDate] ] [[-interval] ] [] ``` ## DESCRIPTION @@ -78,6 +78,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -recoverySiteIdentifier +The identifier of the recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -startDate The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days. @@ -94,21 +109,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -recoverySiteIdentifier -The identifier of the recovery site. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/docs/Get-ZAJournalSiteSizeStat.md b/docs/Get-ZAJournalSiteSizeStat.md index 2fada19..16bb3a0 100644 --- a/docs/Get-ZAJournalSiteSizeStat.md +++ b/docs/Get-ZAJournalSiteSizeStat.md @@ -78,6 +78,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -recoverySiteIdentifier +The identifier of the recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -startDate The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). If only the end date is added, the start date by default will be the end date minus 7 days. @@ -94,21 +109,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -recoverySiteIdentifier -The identifier of the recovery site. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). From 9a2e1c63add1452f934c5a9b22a7cfe77064aadb Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 9 Jun 2019 16:18:36 -0400 Subject: [PATCH 106/479] Create Function and Required Docs Get-ZANetworkSiteSummary --- .../Public/Get-ZANetworkSiteSummary.Tests.ps1 | 19 +++ .../Public/Get-ZANetworkSiteSummary.ps1 | 47 +++++ docs/Get-ZANetworkSiteSummary.md | 160 ++++++++++++++++++ 3 files changed, 226 insertions(+) create mode 100644 Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZANetworkSiteSummary.ps1 create mode 100644 docs/Get-ZANetworkSiteSummary.md diff --git a/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZANetworkSiteSummary.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkSiteSummary.ps1 new file mode 100644 index 0000000..c797e10 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZANetworkSiteSummary.ps1 @@ -0,0 +1,47 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZANetworkSiteSummary { + [CmdletBinding(DefaultParameterSetName = "ProtectedSite")] + param ( + [Parameter( + HelpMessage = "Protected site identifier. A site identification is required for at least one of the sites.", + ParameterSetName = "ProtectedSite", + Mandatory + )] + [Parameter( + HelpMessage = "Protected site identifier. A site identification is required for at least one of the sites.", + ParameterSetName = "RecoverySite" + )] + [ValidateNotNullOrEmpty()] + [string]$protectedSiteIdentifier, + [Parameter( + HelpMessage = "Recovery site identifier. If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites.", + ParameterSetName = "RecoverySite", + Mandatory + )] + [Parameter( + HelpMessage = "Recovery site identifier. If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites.", + ParameterSetName = "ProtectedSite" + )] + [ValidateNotNullOrEmpty()] + [string]$recoverySiteIdentifier, + [Parameter( + HelpMessage = "Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the start date is omitted, the default start date is 7 days before the end date." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the end date is ommitted, the default end date is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the excutive summary." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + + $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters + $uri = "reports/sites-network-summary{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZANetworkSiteSummary.md b/docs/Get-ZANetworkSiteSummary.md new file mode 100644 index 0000000..f7f40dc --- /dev/null +++ b/docs/Get-ZANetworkSiteSummary.md @@ -0,0 +1,160 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAMonitoring.md +schema: 2.0.0 +--- + +# Get-ZANetworkSiteSummary + +## SYNOPSIS + +Get a network executive summary for sites, filtered by start date and end date. + +## SYNTAX + +### ProtectedSite (Default) +``` +Get-ZANetworkSiteSummary -protectedSiteIdentifier [-recoverySiteIdentifier ] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +### RecoverySite +``` +Get-ZANetworkSiteSummary [-protectedSiteIdentifier ] -recoverySiteIdentifier + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +## DESCRIPTION + +Get a network executive summary for sites, filtered by start date and end date.The following options are available: + +* To view the network executive summary of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. +* To view the network executive summary between two sites, specifiy both the protected site identifier and the recovery site identifier. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is ommitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -protectedSiteIdentifier +Protected site identifier. +A site identification is required for at least one of the sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +Recovery site identifier. +If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the excutive summary. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network Site Summary](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_network_summary) From ff809b733fd7d090df8db17f3428c896816a5605 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 07:58:33 -0400 Subject: [PATCH 107/479] Correct spelling errors and Add Examples --- .../Public/Get-ZANetworkSiteSummary.ps1 | 2 +- docs/Get-ZANetworkSiteSummary.md | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZANetworkSiteSummary.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkSiteSummary.ps1 index c797e10..8257ae2 100644 --- a/ZertoApiWrapper/Public/Get-ZANetworkSiteSummary.ps1 +++ b/ZertoApiWrapper/Public/Get-ZANetworkSiteSummary.ps1 @@ -35,7 +35,7 @@ function Get-ZANetworkSiteSummary { [ValidateNotNullOrEmpty()] [string]$endDate, [Parameter( - HelpMessage = "The ZORG identifier by which to filter the excutive summary." + HelpMessage = "The ZORG identifier by which to filter the executive summary." )] [ValidateNotNullOrEmpty()] [string]$zOrgIdentifier diff --git a/docs/Get-ZANetworkSiteSummary.md b/docs/Get-ZANetworkSiteSummary.md index f7f40dc..a3050e9 100644 --- a/docs/Get-ZANetworkSiteSummary.md +++ b/docs/Get-ZANetworkSiteSummary.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAMonitoring.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkSiteSummary.md schema: 2.0.0 --- @@ -30,22 +30,29 @@ Get-ZANetworkSiteSummary [-protectedSiteIdentifier ] -recoverySiteIdenti Get a network executive summary for sites, filtered by start date and end date.The following options are available: * To view the network executive summary of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. -* To view the network executive summary between two sites, specifiy both the protected site identifier and the recovery site identifier. +* To view the network executive summary between two sites, specify both the protected site identifier and the recovery site identifier. ## EXAMPLES ### Example 1 ```powershell -PS C:\> {{ Add example code here }} +PS C:\> Get-ZANetworkSiteSummary -protectedSiteIdentifier "7890-1234-5678" ``` -{{ Add example description here }} +Returns outgoing networks summary from site with identifier "7890-1234-5678" + +### Example 2 +```powershell +PS C:\> Get-ZANetworkSiteSummary -protectedSiteIdentifier "7890-1234-5678" -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns network summary between sites with identifiers "7890-1234-5678" and "9876-5432-1098" ## PARAMETERS ### -endDate End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the end date is ommitted, the default end date is the current time. +If the end date is omitted, the default end date is the current time. ```yaml Type: String @@ -132,7 +139,7 @@ Accept wildcard characters: False ``` ### -zOrgIdentifier -The ZORG identifier by which to filter the excutive summary. +The ZORG identifier by which to filter the executive summary. ```yaml Type: String From d3dbc71a64805b4b2ba1d2f5dcd316b537524cc8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 07:58:57 -0400 Subject: [PATCH 108/479] Create function and associated docs Get-ZANetworkSiteStat --- Tests/Public/Get-ZANetworkSiteStat1.ps1 | 19 ++ .../Public/Get-ZANetworkSiteStat.ps1 | 47 +++++ docs/Get-ZANetworkSiteStat.md | 167 ++++++++++++++++++ 3 files changed, 233 insertions(+) create mode 100644 Tests/Public/Get-ZANetworkSiteStat1.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZANetworkSiteStat.ps1 create mode 100644 docs/Get-ZANetworkSiteStat.md diff --git a/Tests/Public/Get-ZANetworkSiteStat1.ps1 b/Tests/Public/Get-ZANetworkSiteStat1.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZANetworkSiteStat1.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZANetworkSiteStat.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkSiteStat.ps1 new file mode 100644 index 0000000..6762b4a --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZANetworkSiteStat.ps1 @@ -0,0 +1,47 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZANetworkSiteStat { + [CmdletBinding(DefaultParameterSetName = "ProtectedSite")] + param ( + [Parameter( + HelpMessage = "Protected site identifier. A site identification is required for at least one of the sites.", + ParameterSetName = "ProtectedSite", + Mandatory + )] + [Parameter( + HelpMessage = "Protected site identifier. A site identification is required for at least one of the sites.", + ParameterSetName = "RecoverySite" + )] + [ValidateNotNullOrEmpty()] + [string]$protectedSiteIdentifier, + [Parameter( + HelpMessage = "Recovery site identifier. If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites.", + ParameterSetName = "RecoverySite", + Mandatory + )] + [Parameter( + HelpMessage = "Recovery site identifier. If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites.", + ParameterSetName = "ProtectedSite" + )] + [ValidateNotNullOrEmpty()] + [string]$recoverySiteIdentifier, + [Parameter( + HelpMessage = "Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the start date is omitted, the default start date is 7 days before the end date." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the end date is omitted, the default end date is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the executive summary." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + + $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters + $uri = "reports/sites-network-stats{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZANetworkSiteStat.md b/docs/Get-ZANetworkSiteStat.md new file mode 100644 index 0000000..8bb0167 --- /dev/null +++ b/docs/Get-ZANetworkSiteStat.md @@ -0,0 +1,167 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAMonitoring.md +schema: 2.0.0 +--- + +# Get-ZANetworkSiteStat + +## SYNOPSIS + +Get Max, Avg. and Min network statistics for Throughput, Wan and IOPS traffic for sites, filtered by start date and end date. + +## SYNTAX + +### ProtectedSite (Default) +``` +Get-ZANetworkSiteStat -protectedSiteIdentifier [-recoverySiteIdentifier ] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +### RecoverySite +``` +Get-ZANetworkSiteStat [-protectedSiteIdentifier ] -recoverySiteIdentifier + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +## DESCRIPTION + +Get Max, Avg. and Min network statistics for Throughput, Wan and IOPS traffic for sites, filtered by start date and end date. The following options are available: + +* To view network stats of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. +* To view network stats between two sites, specify both the protected site identifier and the recovery site identifier. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkSiteStat -protectedSiteIdentifier "7890-1234-5678" +``` + +Returns all outgoing networks stats from site with identifier "7890-1234-5678" + +### Example 2 +```powershell +PS C:\> Get-ZANetworkSiteStat -protectedSiteIdentifier "7890-1234-5678" -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns all networks stats between sites with identifiers "7890-1234-5678" and "9876-5432-1098" + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -protectedSiteIdentifier +Protected site identifier. +A site identification is required for at least one of the sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +Recovery site identifier. +If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the executive summary. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network Site Summary](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_network_stats) From aaed38ee359e65cb06670fe31943b3125e81d3c8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 08:53:29 -0400 Subject: [PATCH 109/479] Fix filename typo --- ...Get-ZANetworkSiteStat1.ps1 => Get-ZANetworkSiteStat.Tests.ps1} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Tests/Public/{Get-ZANetworkSiteStat1.ps1 => Get-ZANetworkSiteStat.Tests.ps1} (100%) diff --git a/Tests/Public/Get-ZANetworkSiteStat1.ps1 b/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 similarity index 100% rename from Tests/Public/Get-ZANetworkSiteStat1.ps1 rename to Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 From dce6d688b7e1259402c42e001ba06837e9575b4f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 08:53:48 -0400 Subject: [PATCH 110/479] Create function and required docs Get-ZANetworkSiteAveragePerformance --- ...-ZANetworkSiteAveragePerformance.Tests.ps1 | 19 ++ .../Get-ZANetworkSiteAveragePerformance.ps1 | 47 +++++ docs/Get-ZANetworkSiteAveragePerformance.md | 168 ++++++++++++++++++ 3 files changed, 234 insertions(+) create mode 100644 Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZANetworkSiteAveragePerformance.ps1 create mode 100644 docs/Get-ZANetworkSiteAveragePerformance.md diff --git a/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZANetworkSiteAveragePerformance.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkSiteAveragePerformance.ps1 new file mode 100644 index 0000000..e055a04 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZANetworkSiteAveragePerformance.ps1 @@ -0,0 +1,47 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZANetworkSiteAveragePerformance { + [CmdletBinding(DefaultParameterSetName = "ProtectedSite")] + param ( + [Parameter( + HelpMessage = "Protected site identifier. A site identification is required for at least one of the sites.", + ParameterSetName = "ProtectedSite", + Mandatory + )] + [Parameter( + HelpMessage = "Protected site identifier. A site identification is required for at least one of the sites.", + ParameterSetName = "RecoverySite" + )] + [ValidateNotNullOrEmpty()] + [string]$protectedSiteIdentifier, + [Parameter( + HelpMessage = "Recovery site identifier. If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites.", + ParameterSetName = "RecoverySite", + Mandatory + )] + [Parameter( + HelpMessage = "Recovery site identifier. If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites.", + ParameterSetName = "ProtectedSite" + )] + [ValidateNotNullOrEmpty()] + [string]$recoverySiteIdentifier, + [Parameter( + HelpMessage = "Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the start date is omitted, the default start date is 7 days before the end date." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the end date is omitted, the default end date is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the executive summary." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + + $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters + $uri = "reports/sites-network-performance-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZANetworkSiteAveragePerformance.md b/docs/Get-ZANetworkSiteAveragePerformance.md new file mode 100644 index 0000000..e8eff40 --- /dev/null +++ b/docs/Get-ZANetworkSiteAveragePerformance.md @@ -0,0 +1,168 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkSiteAveragePerformance.md +schema: 2.0.0 +--- + +# Get-ZANetworkSiteAveragePerformance + +## SYNOPSIS + +Get list of samples of average and maximum network performance metrics (throughput and WAN traffic) for sites, filtered by start date and end date, and optional intervals. + +## SYNTAX + +### ProtectedSite (Default) +``` +Get-ZANetworkSiteAveragePerformance -protectedSiteIdentifier [-recoverySiteIdentifier ] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +### RecoverySite +``` +Get-ZANetworkSiteAveragePerformance [-protectedSiteIdentifier ] -recoverySiteIdentifier + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +## DESCRIPTION + +Get list of samples of average and maximum network performance metrics (throughput and WAN traffic) for sites, filtered by start date and end date, and optional intervals. +The following options are available: + +* To view average and maximum network performance of throughput vs. WAN traffic of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. +* To view average and maximum network performance of throughput and WAN traffic between two sites, specifiy both the protected site identifier and the recovery site identifier. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkSiteAveragePerformance -protectedSiteIdentifier "7890-1234-5678" +``` + +Returns outgoing networks performance average from site with identifier "7890-1234-5678" + +### Example 2 +```powershell +PS C:\> Get-ZANetworkSiteAveragePerformance -protectedSiteIdentifier "7890-1234-5678" -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns network performance average between sites with identifiers "7890-1234-5678" and "9876-5432-1098" + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -protectedSiteIdentifier +Protected site identifier. +A site identification is required for at least one of the sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +Recovery site identifier. +If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the executive summary. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network Site Average Performance](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_network_performance_average) From ee4419687a439357d095fbced70886c99bf84271 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 09:06:29 -0400 Subject: [PATCH 111/479] Fix Spelling Error --- docs/Get-ZANetworkSiteAveragePerformance.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Get-ZANetworkSiteAveragePerformance.md b/docs/Get-ZANetworkSiteAveragePerformance.md index e8eff40..3c11784 100644 --- a/docs/Get-ZANetworkSiteAveragePerformance.md +++ b/docs/Get-ZANetworkSiteAveragePerformance.md @@ -31,7 +31,7 @@ Get list of samples of average and maximum network performance metrics (throughp The following options are available: * To view average and maximum network performance of throughput vs. WAN traffic of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. -* To view average and maximum network performance of throughput and WAN traffic between two sites, specifiy both the protected site identifier and the recovery site identifier. +* To view average and maximum network performance of throughput and WAN traffic between two sites, specify both the protected site identifier and the recovery site identifier. ## EXAMPLES From 5447d1b4436f0340e5ad0beecb603a26b31663bb Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 09:06:52 -0400 Subject: [PATCH 112/479] Create Function and associated docs Get-ZANetworkSiteAverageIOPS --- .../Get-ZANetworkSiteAverageIOPS.Tests.ps1 | 19 ++ .../Public/Get-ZANetworkSiteAverageIOPS.ps1 | 47 +++++ docs/Get-ZANetworkSiteAverageIOPS.md | 168 ++++++++++++++++++ 3 files changed, 234 insertions(+) create mode 100644 Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZANetworkSiteAverageIOPS.ps1 create mode 100644 docs/Get-ZANetworkSiteAverageIOPS.md diff --git a/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZANetworkSiteAverageIOPS.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkSiteAverageIOPS.ps1 new file mode 100644 index 0000000..3c0cf78 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZANetworkSiteAverageIOPS.ps1 @@ -0,0 +1,47 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZANetworkSiteAverageIOPS { + [CmdletBinding(DefaultParameterSetName = "ProtectedSite")] + param ( + [Parameter( + HelpMessage = "Protected site identifier. A site identification is required for at least one of the sites.", + ParameterSetName = "ProtectedSite", + Mandatory + )] + [Parameter( + HelpMessage = "Protected site identifier. A site identification is required for at least one of the sites.", + ParameterSetName = "RecoverySite" + )] + [ValidateNotNullOrEmpty()] + [string]$protectedSiteIdentifier, + [Parameter( + HelpMessage = "Recovery site identifier. If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites.", + ParameterSetName = "RecoverySite", + Mandatory + )] + [Parameter( + HelpMessage = "Recovery site identifier. If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites.", + ParameterSetName = "ProtectedSite" + )] + [ValidateNotNullOrEmpty()] + [string]$recoverySiteIdentifier, + [Parameter( + HelpMessage = "Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the start date is omitted, the default start date is 7 days before the end date." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the end date is omitted, the default end date is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The ZORG identifier by which to filter the executive summary." + )] + [ValidateNotNullOrEmpty()] + [string]$zOrgIdentifier + ) + + $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters + $uri = "reports/sites-network-iops-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZANetworkSiteAverageIOPS.md b/docs/Get-ZANetworkSiteAverageIOPS.md new file mode 100644 index 0000000..458c8e5 --- /dev/null +++ b/docs/Get-ZANetworkSiteAverageIOPS.md @@ -0,0 +1,168 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkSiteAverageIOPS.md +schema: 2.0.0 +--- + +# Get-ZANetworkSiteAverageIOPS + +## SYNOPSIS + +Get average and maximum IOPS performance for sites, filtered by start date and end date, and optional intervals. + +## SYNTAX + +### ProtectedSite (Default) +``` +Get-ZANetworkSiteAverageIOPS -protectedSiteIdentifier [-recoverySiteIdentifier ] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +### RecoverySite +``` +Get-ZANetworkSiteAverageIOPS [-protectedSiteIdentifier ] -recoverySiteIdentifier + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +## DESCRIPTION + +Get average and maximum IOPS performance for sites, filtered by start date and end date, and optional intervals. +The following options are available: + +* To view average and maximum IOPS performance of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. +* To view average and maximum IOPS performance between two sites, specify both the protected site identifier and the recovery site identifier. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkSiteAverageIOPS -protectedSiteIdentifier "7890-1234-5678" +``` + +Returns outgoing networks IOPS average from site with identifier "7890-1234-5678" + +### Example 2 +```powershell +PS C:\> Get-ZANetworkSiteAverageIOPS -protectedSiteIdentifier "7890-1234-5678" -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns network IOPS average between sites with identifiers "7890-1234-5678" and "9876-5432-1098" + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -protectedSiteIdentifier +Protected site identifier. +A site identification is required for at least one of the sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +Recovery site identifier. +If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the executive summary. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network Site Average IOPS](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_network_iops_average) From b0763e965e85b4cf7c8c706c83501a8c607c8ac7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 09:39:36 -0400 Subject: [PATCH 113/479] Create Function and Required Docs Get-ZANetworkVpgStat --- Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 | 19 ++++ .../Public/Get-ZANetworkVpgStat.ps1 | 23 +++++ docs/Get-ZANetworkVpgStat.md | 94 +++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 create mode 100644 docs/Get-ZANetworkVpgStat.md diff --git a/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 new file mode 100644 index 0000000..55a6089 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 @@ -0,0 +1,23 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZANetworkVpgStat { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The VPG identifier.", + Mandatory + )] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the start date is omitted, the default start date is 7 days before the end date." + )] + [string]$startDate, + [Parameter( + HelpMessage = "End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the end date is omitted, the default end date is the current time." + )] + [string]$endDate + ) + + $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters + $uri = "reports/vpg-network-stats{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZANetworkVpgStat.md b/docs/Get-ZANetworkVpgStat.md new file mode 100644 index 0000000..4a66c98 --- /dev/null +++ b/docs/Get-ZANetworkVpgStat.md @@ -0,0 +1,94 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkVpgStat.md +schema: 2.0.0 +--- + +# Get-ZANetworkVpgStat + +## SYNOPSIS + +Get Max, Avg. and Min network statistics for Throughput, Wan and IOPS traffic for a given VPG, filtered by start date and end date. + +## SYNTAX + +``` +Get-ZANetworkVpgStat [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Get Max, Avg. and Min network statistics for Throughput, Wan and IOPS traffic for a given VPG, filtered by start date and end date. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkVpgStat -vpgIdentifier "3456-7890-1234" +``` + +Get Network VPG Stats for VPG with Identifier "3456-7890-1234" for the last 7 days. + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The VPG identifier. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network VPG Summary](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_vpg_network_summary) From 2ed0169a0087df646ee6db580e6684654f9f68bb Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 09:40:00 -0400 Subject: [PATCH 114/479] Create function and associated docs. Get-ZANetworkVpgSummary --- .../Public/Get-ZANetworkVpgSummary.Tests.ps1 | 19 ++++ .../Public/Get-ZANetworkVpgSummary.ps1 | 23 +++++ docs/Get-ZANetworkVpgSummary.md | 94 +++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 create mode 100644 docs/Get-ZANetworkVpgSummary.md diff --git a/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 new file mode 100644 index 0000000..5aeaed0 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 @@ -0,0 +1,23 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZANetworkVpgSummary { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The VPG identifier.", + Mandatory + )] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the start date is omitted, the default start date is 7 days before the end date." + )] + [string]$startDate, + [Parameter( + HelpMessage = "End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the end date is omitted, the default end date is the current time." + )] + [string]$endDate + ) + + $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters + $uri = "reports/vpg-network-summary{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZANetworkVpgSummary.md b/docs/Get-ZANetworkVpgSummary.md new file mode 100644 index 0000000..429c5d5 --- /dev/null +++ b/docs/Get-ZANetworkVpgSummary.md @@ -0,0 +1,94 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkVpgSummary.md +schema: 2.0.0 +--- + +# Get-ZANetworkVpgSummary + +## SYNOPSIS + +Get a network executive summary for a given VPG, filtered by start date and end date. + +## SYNTAX + +``` +Get-ZANetworkVpgSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Get a network executive summary for a given VPG, filtered by start date and end date. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkVpgSummary -vpgIdentifier "3456-7890-1234" +``` + +Get Network VPG Summary for VPG with Identifier "3456-7890-1234" for the last 7 days. + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The VPG identifier. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network VPG Summary](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_vpg_network_summary) From a0cc4214ca5ab0e090bc967f0f7d340551bb34e0 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 09:54:07 -0400 Subject: [PATCH 115/479] Add parameter validation --- ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 | 3 +++ ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 index 55a6089..c135c6f 100644 --- a/ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 +++ b/ZertoApiWrapper/Public/Get-ZANetworkVpgStat.ps1 @@ -6,14 +6,17 @@ function Get-ZANetworkVpgStat { HelpMessage = "The VPG identifier.", Mandatory )] + [ValidateNotNullOrEmpty()] [string]$vpgIdentifier, [Parameter( HelpMessage = "Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the start date is omitted, the default start date is 7 days before the end date." )] + [ValidateNotNullOrEmpty()] [string]$startDate, [Parameter( HelpMessage = "End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the end date is omitted, the default end date is the current time." )] + [ValidateNotNullOrEmpty()] [string]$endDate ) diff --git a/ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 index 5aeaed0..3654fcd 100644 --- a/ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 +++ b/ZertoApiWrapper/Public/Get-ZANetworkVpgSummary.ps1 @@ -6,14 +6,17 @@ function Get-ZANetworkVpgSummary { HelpMessage = "The VPG identifier.", Mandatory )] + [ValidateNotNullOrEmpty()] [string]$vpgIdentifier, [Parameter( HelpMessage = "Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the start date is omitted, the default start date is 7 days before the end date." )] + [ValidateNotNullOrEmpty()] [string]$startDate, [Parameter( HelpMessage = "End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the end date is omitted, the default end date is the current time." )] + [ValidateNotNullOrEmpty()] [string]$endDate ) From 1ad528c11416052e08b01abe4135a6ee5ab5682f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 09:54:33 -0400 Subject: [PATCH 116/479] Create function and associated docs Get-ZANetwrokVpgAverageIOPS --- .../Get-ZANetworkVpgAverageIOPS.Tests.ps1 | 19 +++ .../Public/Get-ZANetworkVpgAverageIOPS.ps1 | 31 +++++ docs/Get-ZANetworkVpgAverageIOPS.md | 109 ++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZANetworkVpgAverageIOPS.ps1 create mode 100644 docs/Get-ZANetworkVpgAverageIOPS.md diff --git a/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZANetworkVpgAverageIOPS.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkVpgAverageIOPS.ps1 new file mode 100644 index 0000000..b8eb8eb --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZANetworkVpgAverageIOPS.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZANetworkVpgAverageIOPS { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The VPG identifier.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the start date is omitted, the default start date is 7 days before the end date." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the end date is omitted, the default end date is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per minute - for up to 6 hours, per hour - for 6 hours to 15 days, or per day - for 15 days up to 30 days. If an interval is not specified, the default is 60 seconds. Submit value in Seconds." + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters + $uri = "reports/vpg-network-iops-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZANetworkVpgAverageIOPS.md b/docs/Get-ZANetworkVpgAverageIOPS.md new file mode 100644 index 0000000..72dc7c5 --- /dev/null +++ b/docs/Get-ZANetworkVpgAverageIOPS.md @@ -0,0 +1,109 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkVpgAverageIOPS.md +schema: 2.0.0 +--- + +# Get-ZANetworkVpgAverageIOPS + +## SYNOPSIS + +Get average and maximum IOPS performance for a specific VPG, filtered by start date and end date, and optional intervals. + +## SYNTAX + +``` +Get-ZANetworkVpgAverageIOPS [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get average and maximum IOPS performance for a specific VPG, filtered by start date and end date, and optional intervals. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkVpgAverageIOPS -vpgIdentifier "3456-7890-1234" -interval 3600 +``` + +Get Network VPG Average IOPS for VPG with Identifier "3456-7890-1234" for the last 7 days at an interval of 1 hour. + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per minute - for up to 6 hours, per hour - for 6 hours to 15 days, or per day - for 15 days up to 30 days. If an interval is not specified, the default is 60 seconds. Submit value in Seconds. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The VPG identifier. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network VPG Average IOPS](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_vpg_network_iops_average) From 8edfb97b1f959bb138a0dd898b6e659e4b95b73f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 10:07:13 -0400 Subject: [PATCH 117/479] Create function and related docs Get-ZANetworkVpgAveragePerformance --- ...t-ZANetworkVpgAveragePerformance.Tests.ps1 | 19 +++ .../Get-ZANetworkVpgAveragePerformance.ps1 | 31 +++++ docs/Get-ZANetworkVpgAveragePerformance.md | 109 ++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Get-ZANetworkVpgAveragePerformance.ps1 create mode 100644 docs/Get-ZANetworkVpgAveragePerformance.md diff --git a/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Get-ZANetworkVpgAveragePerformance.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkVpgAveragePerformance.ps1 new file mode 100644 index 0000000..0485cdb --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZANetworkVpgAveragePerformance.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZANetworkVpgAveragePerformance { + [CmdletBinding()] + param ( + [Parameter( + HelpMessage = "The VPG identifier.", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string]$vpgIdentifier, + [Parameter( + HelpMessage = "Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the start date is omitted, the default start date is 7 days before the end date." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). If the end date is omitted, the default end date is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per minute - for up to 6 hours, per hour - for 6 hours to 15 days, or per day - for 15 days up to 30 days. If an interval is not specified, the default is 60 seconds. Submit value in Seconds." + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) + + $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters + $uri = "reports/vpg-network-performance-average{0}" -f $filter + Invoke-ZARestRequest -uri $uri +} diff --git a/docs/Get-ZANetworkVpgAveragePerformance.md b/docs/Get-ZANetworkVpgAveragePerformance.md new file mode 100644 index 0000000..b781da5 --- /dev/null +++ b/docs/Get-ZANetworkVpgAveragePerformance.md @@ -0,0 +1,109 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkVpgAveragePerformance.md +schema: 2.0.0 +--- + +# Get-ZANetworkVpgAveragePerformance + +## SYNOPSIS + +Get average and maximum network performance of throughput vs. WAN traffic for a specific VPG filtered by start date and end date, and optional intervals. + +## SYNTAX + +``` +Get-ZANetworkVpgAveragePerformance [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get average and maximum network performance of throughput vs. WAN traffic for a specific VPG filtered by start date and end date, and optional intervals + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkVpgAveragePerformance -vpgIdentifier "3456-7890-1234" -interval 3600 +``` + +Get Network VPG Average Performance for VPG with Identifier "3456-7890-1234" for the last 7 days at an interval of 1 hour. + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per minute - for up to 6 hours, per hour - for 6 hours to 15 days, or per day - for 15 days up to 30 days. If an interval is not specified, the default is 60 seconds. Submit value in Seconds. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The VPG identifier. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network VPG Average Performance](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_vpg_network_performance_average) From 598b9027a660db623dde62f1a0d3509a2df66b71 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 11:38:36 -0400 Subject: [PATCH 118/479] Add Interval Parameter --- .../Public/Get-ZANetworkSiteAverageIOPS.ps1 | 8 +++++++- .../Get-ZANetworkSiteAveragePerformance.ps1 | 7 ++++++- docs/Get-ZANetworkSiteAverageIOPS.md | 19 +++++++++++++++++-- docs/Get-ZANetworkSiteAveragePerformance.md | 19 +++++++++++++++++-- 4 files changed, 47 insertions(+), 6 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZANetworkSiteAverageIOPS.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkSiteAverageIOPS.ps1 index 3c0cf78..e329788 100644 --- a/ZertoApiWrapper/Public/Get-ZANetworkSiteAverageIOPS.ps1 +++ b/ZertoApiWrapper/Public/Get-ZANetworkSiteAverageIOPS.ps1 @@ -38,7 +38,13 @@ function Get-ZANetworkSiteAverageIOPS { HelpMessage = "The ZORG identifier by which to filter the executive summary." )] [ValidateNotNullOrEmpty()] - [string]$zOrgIdentifier + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval + ) $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters diff --git a/ZertoApiWrapper/Public/Get-ZANetworkSiteAveragePerformance.ps1 b/ZertoApiWrapper/Public/Get-ZANetworkSiteAveragePerformance.ps1 index e055a04..ad8addc 100644 --- a/ZertoApiWrapper/Public/Get-ZANetworkSiteAveragePerformance.ps1 +++ b/ZertoApiWrapper/Public/Get-ZANetworkSiteAveragePerformance.ps1 @@ -38,7 +38,12 @@ function Get-ZANetworkSiteAveragePerformance { HelpMessage = "The ZORG identifier by which to filter the executive summary." )] [ValidateNotNullOrEmpty()] - [string]$zOrgIdentifier + [string]$zOrgIdentifier, + [Parameter( + HelpMessage = "The interval selected within the duration of the report. The interval can be per hour, for up to 15 days’ time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds" + )] + [ValidateRange(60, 2678400)] + [Int32]$interval ) $filter = Get-ZertoAPIFilter -filtertable $PSBoundParameters diff --git a/docs/Get-ZANetworkSiteAverageIOPS.md b/docs/Get-ZANetworkSiteAverageIOPS.md index 458c8e5..5cbe8e5 100644 --- a/docs/Get-ZANetworkSiteAverageIOPS.md +++ b/docs/Get-ZANetworkSiteAverageIOPS.md @@ -16,13 +16,13 @@ Get average and maximum IOPS performance for sites, filtered by start date and e ### ProtectedSite (Default) ``` Get-ZANetworkSiteAverageIOPS -protectedSiteIdentifier [-recoverySiteIdentifier ] - [-startDate ] [-endDate ] [-zOrgIdentifier ] [] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [-interval ] [] ``` ### RecoverySite ``` Get-ZANetworkSiteAverageIOPS [-protectedSiteIdentifier ] -recoverySiteIdentifier - [-startDate ] [-endDate ] [-zOrgIdentifier ] [] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [-interval ] [] ``` ## DESCRIPTION @@ -67,6 +67,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -protectedSiteIdentifier Protected site identifier. A site identification is required for at least one of the sites. diff --git a/docs/Get-ZANetworkSiteAveragePerformance.md b/docs/Get-ZANetworkSiteAveragePerformance.md index 3c11784..ff5da43 100644 --- a/docs/Get-ZANetworkSiteAveragePerformance.md +++ b/docs/Get-ZANetworkSiteAveragePerformance.md @@ -16,13 +16,13 @@ Get list of samples of average and maximum network performance metrics (throughp ### ProtectedSite (Default) ``` Get-ZANetworkSiteAveragePerformance -protectedSiteIdentifier [-recoverySiteIdentifier ] - [-startDate ] [-endDate ] [-zOrgIdentifier ] [] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [-interval ] [] ``` ### RecoverySite ``` Get-ZANetworkSiteAveragePerformance [-protectedSiteIdentifier ] -recoverySiteIdentifier - [-startDate ] [-endDate ] [-zOrgIdentifier ] [] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [-interval ] [] ``` ## DESCRIPTION @@ -67,6 +67,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -protectedSiteIdentifier Protected site identifier. A site identification is required for at least one of the sites. From c70e0a6701d14132eb06e1edfdad19ab43682817 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 17:54:32 -0400 Subject: [PATCH 119/479] Update README.md --- README.md | 55 +++++++++++++------------------------------------------ 1 file changed, 13 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 42e6b22..38f8fb9 100644 --- a/README.md +++ b/README.md @@ -19,51 +19,22 @@ This code is still under development!! USE AT YOUR OWN RISK AND ONLY IF YOU KNOW ## Getting Started -Place the folder and contents on your hard drive in a location known to you. From there run the following command to import the module into your session: - -```PowerShell -PS C:\>Import-Module \ZertoApiWrapper\ZertoApiWrapper\ZertoApiWrapper.psm1 -force -``` - -This will import the module into your current session and make the function available to you use and test. - -### Connecting to a ZVM - -Before any of the functions will work, you will need to connect to a Zerto Virtual Manager server. To do this you will use the `Connect-ZertoServer` function passing in a Server Name or IP address of the Zerto Virtual Manager. If you are using a non-standard port, you will need to provide that as well with the `-zertoPort` parameter. You will also need to supply credentials to authenticate against the Zerto Virtual Manager. If credentials are not provided, the user will be prompted for a username and password. - -```PowerShell -PS C:\>$credential = Get-Credential -PS C:\>Connect-ZertoServer -zertoServer "192.168.222.20" -credential $credential -``` - -After successful execution, a few Module level variables are set that are not currently exposed. These variables keep track of the Zerto Server connection information such as Server Name and Port information along with the authentication headers. A "Last Action" variable is also set to keep track of when the last call was made to the API to determine if the authentication information has expired or not. Should this command be run again with a different server, the old information will be overwritten and all commands from that point will be executed against the new server information. - -### Using the Module - -A help system is currently under development. While each command has a help page, it may not be fully fleshed out yet. To see all possible functions you can use the following command after the module has been imported: - -```PowerShell -PS C:\>Get-Command -module ZertoApiWrapper -``` - -Once you have found the command that you want to know about you can call `Get-Help ` to take a look at the help page, or if you want to see syntax, `Get-Command -syntax`. - -### Ending the Session - -If you are using this as part of a larger script, I highly suggest explicitly ending your session with the `Disconnect-ZertoSession` command. This will delete the token authorization from the Zerto Virtual Manager as well as clear all Module scoped variables. +* [Getting Started with Zerto Virtual Manager and the ZertoApiWrapper](https://github.com/ZertoPublic/ZertoApiWrapper/wiki/Getting-Stated-with-Zerto-Virtual-Manager) +* [Getting Started with Zerto Analytics and the ZertoApiWrapper](https://github.com/ZertoPublic/ZertoApiWrapper/wiki/Getting-Started-with-Zerto-Analytics) ## Recent Updates -- May 31st, 2019: Implement logic to allow use of this module in both Windows PowerShell 5.1 and PowerShell Core. -- March 15th, 2019: Implement Export and Import Functionality. Please See [Export-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Export-ZertoVpg.md) and [Import-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVpg.md) for assistance. No current pre-seed support. -- March 11th, 2019: Create basic VPG completed. Please see [New-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md) +* June 10th, 2019: Added functionality for Zerto Analytics. +* May 31st, 2019: Implement logic to allow use of this module in both Windows PowerShell 5.1 and PowerShell Core. +* March 15th, 2019: Implement Export and Import Functionality. Please See [Export-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Export-ZertoVpg.md) and [Import-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVpg.md) for assistance. No current pre-seed support. +* March 11th, 2019: Create basic VPG completed. Please see [New-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md) ## TODO -- Complete Help Markdown Files -- JFLR Functionality -- Create VPG (Per-VM modification and Backup Settings) -- Edit VPG -- Delete Zerto License -- Flesh out Pester Tests -- Complete Automated Build Process +* Complete Help Markdown Files +* JFLR Functionality +* Create VPG (Per-VM modification and Backup Settings) +* Edit VPG +* Delete Zerto License +* Flesh out Pester Tests +* Complete Automated Build Process From 59a0112f2c107be22c26c46b383886e732d65352 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 17:54:36 -0400 Subject: [PATCH 120/479] Update RELEASENOTES.md --- RELEASENOTES.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 3b4868a..3178e32 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,4 +1,11 @@ -* Initial Release -* Updated 'Invoke-ZertoRestRequest' to work in Powershell 5.1 as well as Powershell core +## Initial Release + +### Zerto Virtual Manager + +* Updated `Invoke-ZertoRestRequest` to work in Powershell 5.1 as well as Powershell core + +### Zerto Analytics + +* Implemented Zerto Analytics Functionality. Please see [Getting Started with Zerto Analytics](https://github.com/ZertoPublic/ZertoApiWrapper/wiki/Getting-Started-with-Zerto-Analytics) From 82df93143b36d8780a9624d5a6d2651725cf9b09 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 10 Jun 2019 17:54:53 -0400 Subject: [PATCH 121/479] Cleaning InvokeBuild Script --- ZertoApiWrapper.build.ps1 | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 69d0b3e..5674577 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -1,12 +1,5 @@ #Requires -Modules 'InvokeBuild' -. '.\ZertoApiWrapper.settings.ps1' -# import-module "$BuildRoot\ZertoApiWrapper\ZertoApiWrapper.psd1" -Verbose -Force - -<# [CmdletBinding()] -param([switch]$Install, - [string]$Configuration = (property Configuration Release)) -$targetDir = "temp/$Configuration/ZertoApiWrapper" #> $version = "{0}.{1}" -f $(Get-Content .\version.txt), $(get-date -format 'yyyyMMdd') task . CreateArtifacts @@ -54,7 +47,7 @@ task AnalyzeBuiltFiles CheckPSScriptAnalyzerInstalled, CreatePsm1ForRelease, { Severity = @('Error', 'Warning') Recurse = $true Verbose = $false - ExcludeRule = @() + ExcludeRule = @("PSUseBOMForUnicodeEncodedFile") } $saresults = Invoke-ScriptAnalyzer @scriptAnalyzerParams From c08df4c1a0f78cc1ee3d22fb3f77f1121906a399 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 17 Jun 2019 08:58:23 -0400 Subject: [PATCH 122/479] Update for Release --- README.md | 9 +++++++-- version.txt | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 38f8fb9..eb5dfe1 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,12 @@ In no event shall Zerto, its authors or anyone else involved in the creation, pr ## Disclaimer -This code is still under development!! USE AT YOUR OWN RISK AND ONLY IF YOU KNOW WHAT YOU ARE DOING!! +This code is still under development! Please use carefully and if you encounter any issues or have an idea, please submit an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues). Along the same lines, should you be proficient in PowerShell, please feel free to submit any [Pull Requests](https://github.com/ZertoPublic/ZertoApiWrapper/pulls) with enhancements and bug fixes. + +## Installing the Module + +This module can be installed directly from the [PowerShell Gallery](https://www.powershellgallery.com/packages/ZertoApiWrapper) with the following command. +`PS> Install-Module -name ZertoApiWrapper ## Getting Started @@ -24,7 +29,7 @@ This code is still under development!! USE AT YOUR OWN RISK AND ONLY IF YOU KNOW ## Recent Updates -* June 10th, 2019: Added functionality for Zerto Analytics. +* June 16th, 2019: Added functionality for Zerto Analytics. * May 31st, 2019: Implement logic to allow use of this module in both Windows PowerShell 5.1 and PowerShell Core. * March 15th, 2019: Implement Export and Import Functionality. Please See [Export-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Export-ZertoVpg.md) and [Import-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVpg.md) for assistance. No current pre-seed support. * March 11th, 2019: Create basic VPG completed. Please see [New-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md) diff --git a/version.txt b/version.txt index 3eefcb9..9084fa2 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.0.0 +1.1.0 From e94c2b66e1db7bc519e4bdcfe9a1861862324f34 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 17 Jun 2019 09:07:45 -0400 Subject: [PATCH 123/479] Ignore Plural Nouns In PSSA --- ZertoApiWrapper.build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 5674577..e36079a 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -47,7 +47,7 @@ task AnalyzeBuiltFiles CheckPSScriptAnalyzerInstalled, CreatePsm1ForRelease, { Severity = @('Error', 'Warning') Recurse = $true Verbose = $false - ExcludeRule = @("PSUseBOMForUnicodeEncodedFile") + ExcludeRule = @("PSUseBOMForUnicodeEncodedFile", "PSUseSingularNouns") } $saresults = Invoke-ScriptAnalyzer @scriptAnalyzerParams From 9c16c2c6e201c29cffd6b75a08cbfc66e1c8d880 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 17 Jun 2019 09:14:10 -0400 Subject: [PATCH 124/479] Fix CodeBlock Formatting --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eb5dfe1..1d7b083 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,9 @@ This code is still under development! Please use carefully and if you encounter ## Installing the Module This module can be installed directly from the [PowerShell Gallery](https://www.powershellgallery.com/packages/ZertoApiWrapper) with the following command. -`PS> Install-Module -name ZertoApiWrapper +``` +PS> Install-Module -name ZertoApiWrapper +``` ## Getting Started From a8025f4be1eead73d0855e59f4ed011c00b400da Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 17 Jun 2019 09:18:04 -0400 Subject: [PATCH 125/479] Fix Install CodeBlock --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d7b083..042daa0 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,8 @@ This code is still under development! Please use carefully and if you encounter ## Installing the Module This module can be installed directly from the [PowerShell Gallery](https://www.powershellgallery.com/packages/ZertoApiWrapper) with the following command. -``` + +```PowerShell PS> Install-Module -name ZertoApiWrapper ``` From 148b33c1e39b0d6f34450172bfc4733eba9e9414 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 19 Jun 2019 17:03:23 -0400 Subject: [PATCH 126/479] Add Issue and PR Templates --- .github/CONTRIBUTING.md | 62 ++++++++++++++++++++++++++++++++ .github/ISSUE_TEMPLATE.md | 31 ++++++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 37 +++++++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..4006efc --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,62 @@ +# How to contribute + +Contributions to ZertoApiWrapper are highly encouraged and desired. +Below are some guidelines that will help make the process as smooth as possible. + +## Getting Started + +- Make sure you have a [GitHub account](https://github.com/signup/free) +- Submit a new issue, assuming one does not already exist. + - Clearly describe the issue including steps to reproduce when it is a bug. + - Make sure you fill in the earliest version that you know has the issue. +- Fork the repository on GitHub + +## Suggesting Enhancements + +I want to know what you think is missing from ZertoApiWrapper and how it can be made better. + +- When submitting an issue for an enhancement, please be as clear as possible about why you think the enhancement is needed and what the benefit of it would be. + +## Making Changes + +- From your fork of the repository, create a topic branch where work on your change will take place. +- To quickly create a topic branch based on master; `git checkout -b my_contribution master`. + Please avoid working directly on the `master` branch. +- Make commits of logical units. +- Check for unnecessary whitespace with `git diff --check` before committing. +- Please follow the prevailing code conventions in the repository. + Differences in style make the code harder to understand for everyone. +- Make sure your commit messages are in the proper format. + +``` + Add more cowbell to Get-Something.ps1 + + The functionality of Get-Something would be greatly improved if there was a little + more 'pizzazz' added to it. I propose a cowbell. Adding more cowbell has been + shown in studies to both increase one's mojo, and cement one's status + as a rock legend. +``` + +- Make sure you have added all the necessary Pester tests for your changes. +- Run _all_ Pester tests in the module to assure nothing else was accidentally broken. + +## Documentation + +I am infallible and as such my documenation needs no corectoin. +In the highly unlikely event that that is _not_ the case, commits to update or add documentation are highly apprecaited. + +## Submitting Changes + +- Push your changes to a topic branch in your fork of the repository. +- Submit a pull request to the main repository. +- Once the pull request has been reviewed and accepted, it will be merged with the master branch. +- Celebrate + +## Additional Resources + +- [General GitHub documentation](https://help.github.com/) +- [GitHub forking documentation](https://guides.github.com/activities/forking/) +- [GitHub pull request documentation](https://help.github.com/send-pull-requests/) +- [GitHub Flow guide](https://guides.github.com/introduction/flow/) +- [GitHub's guide to contributing to open source projects](https://guides.github.com/activities/contributing-to-open-source/) + diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..28202e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,31 @@ + + +## Expected Behavior + + + +## Current Behavior + + + +## Possible Solution + + + +## Steps to Reproduce (for bugs) + + +1. +2. +3. +4. + +## Context + + + +## Your Environment + +* Module version used: +* Operating System and PowerShell version: +* Zerto Virtual Manager Version: diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..52edb2a --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,37 @@ + + +## Description + + +## Related Issue + + + + + +## Motivation and Context + + +## How Has This Been Tested? + + + + +## Screenshots (if appropriate): + +## Types of changes + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to change) + +## Checklist: + + +- [ ] My code follows the code style of this project. +- [ ] My change requires a change to the documentation. +- [ ] I have updated the documentation accordingly. +- [ ] I have read the **CONTRIBUTING** document. +- [ ] I have added tests to cover my changes. +- [ ] All new and existing tests passed. + From ad8f06c6e1870e727e83b15b9becd4e64fe305ae Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 24 Jun 2019 12:42:10 -0400 Subject: [PATCH 127/479] Add Logic for token tests --- .../Private/Invoke-ZARestRequest.ps1 | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 index 599bad8..70e8951 100644 --- a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 +++ b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 @@ -7,14 +7,26 @@ function Invoke-ZARestRequest { [string]$contentType = "application/json" ) - $submittedUri = "https://analytics.api.zerto.com/v2/{0}" -f $uri - if ($PSVersionTable.PSVersion.Major -ge 6) { - Invoke-RestMethod -Uri $submittedUri -Method $method -Body $body -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 + # Check to see if the required variables are present and currently valid + if ( -not ((Test-Path variable:script:zaLastActionTime) -and (Test-Path variable:script:zaHeaders)) ) { + Write-Error -Message "Zerto Analytics Connection does not Exist. Please run Connect-ZertoAnalytics first to establish a connection" + break + } elseif ( (Test-Path variable:script:zaHeaders) -and $([datetime]$script:zaLastAction).addMinutes(60) -lt $(get-date) ) { + Write-Error -Message "Authorization Token has Expired. Please re-authorize to the Zerto Virtual Manager" + break } else { - if ([String]::IsNullOrEmpty($body)) { - Invoke-RestMethod -Uri $submittedUri -Method $method -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 + # Update the last action time and submit the request based on PS Version. + Set-Variable -Name zaLastActionTime -Scope Script -Value $(Get-date).Ticks + $submittedUri = "https://analytics.api.zerto.com/v2/{0}" -f $uri + if ($PSVersionTable.PSVersion.Major -ge 6) { + Invoke-RestMethod -Uri $submittedUri -Method $method -Body $body -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 } else { - Invoke-RestMethod -Uri $submittedUri -Method $method -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 -Body $body + # With PS 5, you cannot ship a $null body, check for $body variable and select correct Invoke request. + if ([String]::IsNullOrEmpty($body)) { + Invoke-RestMethod -Uri $submittedUri -Method $method -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 + } else { + Invoke-RestMethod -Uri $submittedUri -Method $method -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 -Body $body + } } } -} \ No newline at end of file +} From 9d579a5785906512694024a83810d17af5fd505d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 24 Jun 2019 12:42:23 -0400 Subject: [PATCH 128/479] Update VSCode settings --- .vscode/settings.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index d6dea32..77c8224 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,8 @@ { "files.trimTrailingWhitespace": true, + "files.insertFinalNewline": true, + "editor.insertSpaces": true, + "editor.tabSize": 4, + "powershell.codeFormatting.preset": "OTBS", "terminal.integrated.shell.windows": "c:/Program Files/PowerShell/6/pwsh.exe" } From 83649fb72a582da6138f6ace665350f46ccfb267 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 24 Jun 2019 12:47:50 -0400 Subject: [PATCH 129/479] Add information to release notes. --- RELEASENOTES.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 3178e32..4e5cafc 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,11 +1,9 @@ -## Initial Release - ### Zerto Virtual Manager -* Updated `Invoke-ZertoRestRequest` to work in Powershell 5.1 as well as Powershell core +* ### Zerto Analytics -* Implemented Zerto Analytics Functionality. Please see [Getting Started with Zerto Analytics](https://github.com/ZertoPublic/ZertoApiWrapper/wiki/Getting-Started-with-Zerto-Analytics) +* Fixed an issue where the Zerto Analytics Rest Request function was not checking for the token before attempting a connection. From 44ed5767ea00bcab0782379d4c803b080beaf47d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 25 Jun 2019 08:30:54 -0400 Subject: [PATCH 130/479] Update Expired Token Error Message --- ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 index 70e8951..8581a2f 100644 --- a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 +++ b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 @@ -12,7 +12,7 @@ function Invoke-ZARestRequest { Write-Error -Message "Zerto Analytics Connection does not Exist. Please run Connect-ZertoAnalytics first to establish a connection" break } elseif ( (Test-Path variable:script:zaHeaders) -and $([datetime]$script:zaLastAction).addMinutes(60) -lt $(get-date) ) { - Write-Error -Message "Authorization Token has Expired. Please re-authorize to the Zerto Virtual Manager" + Write-Error -Message "Authorization Token has Expired. Please re-authorize to the Zerto Analytics Portal" break } else { # Update the last action time and submit the request based on PS Version. From b7d4664d6b6cb92c4fc9307cd32e2c3060f0503c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 25 Jun 2019 14:00:40 -0400 Subject: [PATCH 131/479] Correct Last Action Variable Name --- ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 index 8581a2f..1e35829 100644 --- a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 +++ b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 @@ -11,7 +11,7 @@ function Invoke-ZARestRequest { if ( -not ((Test-Path variable:script:zaLastActionTime) -and (Test-Path variable:script:zaHeaders)) ) { Write-Error -Message "Zerto Analytics Connection does not Exist. Please run Connect-ZertoAnalytics first to establish a connection" break - } elseif ( (Test-Path variable:script:zaHeaders) -and $([datetime]$script:zaLastAction).addMinutes(60) -lt $(get-date) ) { + } elseif ( (Test-Path variable:script:zaHeaders) -and $([datetime]$script:zaLastActionTime).addMinutes(60) -lt $(get-date) ) { Write-Error -Message "Authorization Token has Expired. Please re-authorize to the Zerto Analytics Portal" break } else { From 0b1f2c4d1b1933c00b07d815996391ecfd789968 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 25 Jun 2019 14:02:07 -0400 Subject: [PATCH 132/479] Update psd1 to export all functions This will not happen in built releases, but just for in-house testing scenarios. --- ZertoApiWrapper/ZertoApiWrapper.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/ZertoApiWrapper.psd1 b/ZertoApiWrapper/ZertoApiWrapper.psd1 index af87c16..44754ec 100644 --- a/ZertoApiWrapper/ZertoApiWrapper.psd1 +++ b/ZertoApiWrapper/ZertoApiWrapper.psd1 @@ -69,7 +69,7 @@ # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. - FunctionsToExport = 'Add-ZertoPeerSite', 'Checkpoint-ZertoVpg', 'Connect-ZertoServer', 'Disconnect-ZertoServer', 'Edit-ZertoVra', 'Export-ZertoVpg', 'Get-ZertoAlert', 'Get-ZertoDatastore', 'Get-ZertoEvent', 'Get-ZertoLicense', 'Get-ZertoLocalSite', 'Get-ZertoPeerSite', 'Get-ZertoProtectedVm', 'Get-ZertoRecoveryReport', 'Get-ZertoResourcesReport', 'Get-ZertoServiceProfile', 'Get-ZertoTask', 'Get-ZertoUnprotectedVm', 'Get-ZertoVirtualizationSite', 'Get-ZertoVolume', 'Get-ZertoVpg', 'Get-ZertoVpgSetting', 'Get-ZertoVra', 'Get-ZertoZorg', 'Get-ZertoZsspSession', 'Import-ZertoVpg', 'Install-ZertoVra', 'Invoke-ZertoFailover', 'Invoke-ZertoFailoverCommit', 'Invoke-ZertoFailoverRollback', 'Invoke-ZertoForceSync', 'Invoke-ZertoMove', 'Invoke-ZertoMoveCommit', 'Invoke-ZertoMoveRollback', 'New-ZertoVpg', 'New-ZertoVpgSettingsIdentifier', 'Remove-ZertoPeerSite', 'Remove-ZertoVpg', 'Resume-ZertoVpg', 'Save-ZertoVpgSettings', 'Set-ZertoAlert', 'Set-ZertoLicense', 'Start-ZertoCloneVpg', 'Start-ZertoFailoverTest', 'Stop-ZertoCloneVpg', 'Stop-ZertoFailoverTest', 'Suspend-ZertoVpg', 'Uninstall-ZertoVra' + FunctionsToExport = '*' # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = @() From 0a2e6974f018524c4fa13202d1a94bdcd757ad4e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 8 Jul 2019 11:59:50 -0400 Subject: [PATCH 133/479] Create Function and related files Remove-ZertoVpgSettingsIdentifier --- ...emove-ZertoVpgSettingsIdentifier.Tests.ps1 | 19 ++++ .../Remove-ZertoVpgSettingsIdentifier.ps1 | 26 ++++++ docs/Remove-ZertoVpgSettingsIdentifier.md | 89 +++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Remove-ZertoVpgSettingsIdentifier.ps1 create mode 100644 docs/Remove-ZertoVpgSettingsIdentifier.md diff --git a/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 b/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 new file mode 100644 index 0000000..f5816b6 --- /dev/null +++ b/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 @@ -0,0 +1,19 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } +} diff --git a/ZertoApiWrapper/Public/Remove-ZertoVpgSettingsIdentifier.ps1 b/ZertoApiWrapper/Public/Remove-ZertoVpgSettingsIdentifier.ps1 new file mode 100644 index 0000000..186e477 --- /dev/null +++ b/ZertoApiWrapper/Public/Remove-ZertoVpgSettingsIdentifier.ps1 @@ -0,0 +1,26 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Remove-ZertoVpgSettingsIdentifier { + [CmdletBinding(SupportsShouldProcess = $true)] + param ( + # Settings Identifier to Remove + [Parameter(HelpMessage = "VpgSettingsIdentifier to Delete", Mandatory)] + [ValidateNotNullOrEmpty()] + [string[]] + $vpgSettingsIdentifier + ) + + begin { + } + + process { + foreach ($id in $vpgSettingsIdentifier) { + if ($PSCmdlet.ShouldProcess($id)) { + $uri = "vpgSettings/{0}" -f $id + Invoke-ZertoRestRequest -uri $uri -method "DELETE" + } + } + } + + end { + } +} diff --git a/docs/Remove-ZertoVpgSettingsIdentifier.md b/docs/Remove-ZertoVpgSettingsIdentifier.md new file mode 100644 index 0000000..0077fae --- /dev/null +++ b/docs/Remove-ZertoVpgSettingsIdentifier.md @@ -0,0 +1,89 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Resume-ZertoVpgSettingsIdentifier.md +schema: 2.0.0 +--- + +# Remove-ZertoVpgSettingsIdentifier + +## SYNOPSIS +When a new VpgSettingsIdentifier is created, all the settings sit in memory for 30 minutes after the last change. This operation will delete the settings from memory and discard any changes. This is akin to clicking cancel on the VPG Edit Wizard screen. + +## SYNTAX + +``` +Remove-ZertoVpgSettingsIdentifier [-vpgSettingsIdentifier] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +When a new VpgSettingsIdentifier is created, all the settings sit in memory for 30 minutes after the last change. This operation will delete the settings from memory and discard any changes. This is akin to clicking cancel on the VPG Edit Wizard screen. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Remove-ZertoVpgSettingsIdentifier -vpgSettingsIdentifier "1234-7890-5678" +``` + +Removes VPG Settings Identifier "1234-7890-5678" from the Zerto Virtual Manager without applying any settings that may have changed. + +## PARAMETERS + +### -vpgSettingsIdentifier +Settings Identifier to Remove + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS +[Zerto Rest API VPG Settings End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.118.html%23) From 1fd92008ac971116080648e85a75f1cd76d9b2b3 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 8 Jul 2019 12:55:31 -0400 Subject: [PATCH 134/479] Update Remove-ZertoVpgSettingsIdentifier.md --- docs/Remove-ZertoVpgSettingsIdentifier.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Remove-ZertoVpgSettingsIdentifier.md b/docs/Remove-ZertoVpgSettingsIdentifier.md index 0077fae..0a8faf6 100644 --- a/docs/Remove-ZertoVpgSettingsIdentifier.md +++ b/docs/Remove-ZertoVpgSettingsIdentifier.md @@ -86,4 +86,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES ## RELATED LINKS + [Zerto Rest API VPG Settings End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.118.html%23) From ef1584032e20bef8b8ed80e3a65bbaf21f9ba0e6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 8 Jul 2019 13:22:18 -0400 Subject: [PATCH 135/479] Create function and required associated docs Export-ZertoVmNicSetting --- .../Public/Export-ZertoVmNicSetting.Tests.ps1 | 42 +++++++++ .../Public/Export-ZertoVmNicSetting.ps1 | 85 +++++++++++++++++++ docs/Export-ZertoVmNicSetting.md | 79 +++++++++++++++++ 3 files changed, 206 insertions(+) create mode 100644 Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 create mode 100644 docs/Export-ZertoVmNicSetting.md diff --git a/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 b/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 new file mode 100644 index 0000000..7e63113 --- /dev/null +++ b/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 @@ -0,0 +1,42 @@ +#Requires -Modules Pester +#Region - Test Setup +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force +#EndRegion + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } + + Context "$($file.BaseName)::Parameter Unit Tests" { + It "has a mantatory string parameter for the output file" { + Get-Command $file.BaseName | Should -HaveParameter OutputFile -Type String -Mandatory + } + + It "has a non-mandatory string array parameter for vpgName(s) to export" { + Get-Command $file.BaseName | Should -HaveParameter vpgName -Type String[] + Get-Command $file.BaseName | Should -HaveParameter vpgName -Not -Mandatory + } + + It "Output File does not take null or empty string" { + { Export-ZertoVpg -outputFile "" } | Should -Throw + { Export-ZertoVpg -outputFile $null } | Should -Throw + } + + It "Vpg Name parameter does not take null or empty string" { + { Export-ZertoVpg -outputFile ".\ExportedInfo.csv" -vpgName = "" } | Should -Throw + { Export-ZertoVpg -outputFile ".\ExportedInfo.csv" -vpgName = $null } | Should -Throw + } + } +} diff --git a/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 b/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 new file mode 100644 index 0000000..cace80a --- /dev/null +++ b/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 @@ -0,0 +1,85 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Export-ZertoVmNicSetting { + [CmdletBinding()] + param ( + # Vpg(s) to export. If no VPG was named, all data will be exported. + [Parameter( + Helpmessage = "VPG(s) to export" + )] + [ValidateNotNullOrEmpty()] + [string[]] + $VpgName, + # Output file information + [Parameter( + Helpmessage = "File to export the data to. This MUST be a CSV. If a CSV filename is not specified, the file will be forced into a CSV", + Mandatory + )] + [ValidateNotNullOrEmpty()] + [string] + $OutputFile + ) + + begin { + } + + process { + if (($OutputFile.Split('.')[-1]) -ne 'csv') { + $OutputFile += '.csv' + } + if ( "VpgName" -in $PSBoundParameters.Keys ) { + $vpgs = Get-ZertoVpg | Where-Object { $_.VpgName -in $VpgName } + foreach ($group in $VpgName) { + if ($group -notin $vpgs.VpgName) { + Write-Error "$group VPG not found. Skipping." -ErrorAction Continue + } + } + } else { + $vpgs = Get-ZertoVpg + } + $nicSettings = foreach ($group in $vpgs) { + $protectedVms = Get-ZertoProtectedVm -vpgName ($group.vpgname) + $vmMap = @{ } + foreach ($vm in $protectedVms) { + $vmMap["$($vm.vmIdentifier)"] = $vm.vmName + } + $settingsId = New-ZertoVpgSettingsIdentifier -vpgIdentifier $group.vpgIdentifier + $vmSettings = Get-ZertoVpgSetting -vpgSettingsIdentifier $settingsId -vms + $networks = Get-ZertoVirtualizationSite -siteIdentifier $group.RecoverySite.identifier -networks + $null = Remove-ZertoVpgSettingsIdentifier -vpgSettingsIdentifier $settingsId + $networkMap = @{ } + foreach ($network in $networks) { + $networkMap[$network.NetworkIdentifier] = $network.VirtualizationNetworkName + } + foreach ($vm in $vmSettings) { + $nicInfo = [PSCustomObject]@{ + VPGName = $group.VPGName + VMName = $vmMap[$($vm.vmIdentifier)] + NicIdentifier = $vm.nics.NicIdentifier + LiveNetwork = $networkMap[$vm.nics.failover.Hypervisor.NetworkIdentifier] + LiveShouldReplaceMac = $vm.nics.failover.Hypervisor.ShouldReplaceMacAddress + LiveIsDHCP = $vm.Nics.failover.Hypervisor.IpConfig.IsDhcp + LiveIpAddress = $vm.nics.failover.Hypervisor.IpConfig.StaticIp + LiveIpSubnetMask = $vm.nics.failover.Hypervisor.IpConfig.SubnetMask + LiveIpDefaultGateway = $vm.nics.failover.Hypervisor.IpConfig.Gateway + LivePrimaryDns = $vm.nics.failover.Hypervisor.IpConfig.PrimaryDns + LiveSecondayDns = $vm.nics.failover.Hypervisor.IpConfig.SecondaryDns + LiveDnsSuffix = $vm.nics.failover.Hypervisor.DnsSuffix + TestNetwork = $networkMap[$vm.nics.failoverTest.Hypervisor.NetworkIdentifier] + TestShouldReplaceMac = $vm.nics.failoverTest.Hypervisor.ShouldReplaceMacAddress + TestIsDHCP = $vm.Nics.failoverTest.Hypervisor.IpConfig.IsDhcp + TestIpAddress = $vm.nics.failoverTest.Hypervisor.IpConfig.StaticIp + TestIpSubnetMask = $vm.nics.failoverTest.Hypervisor.IpConfig.SubnetMask + TestIpDefaultGateway = $vm.nics.failoverTest.Hypervisor.IpConfig.Gateway + TestPrimaryDns = $vm.nics.failoverTest.Hypervisor.IpConfig.PrimaryDns + TestSecondayDns = $vm.nics.failoverTest.Hypervisor.IpConfig.SecondaryDns + TestDnsSuffix = $vm.nics.failoverTest.Hypervisor.DnsSuffix + } + $nicInfo + } + } + $nicSettings | ConvertTo-Csv | Out-File $OutputFile + } + + end { + } +} diff --git a/docs/Export-ZertoVmNicSetting.md b/docs/Export-ZertoVmNicSetting.md new file mode 100644 index 0000000..7e8ce10 --- /dev/null +++ b/docs/Export-ZertoVmNicSetting.md @@ -0,0 +1,79 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Export-ZertoVmNicSettings.md +schema: 2.0.0 +--- + +# Export-ZertoVmNicSetting + +## SYNOPSIS +Queries VPGs and associated Virtual Machines to export all protected virtual machine NIC settings to a Comma Separated Value (CSV) file. + +## SYNTAX + +``` +Export-ZertoVmNicSetting [[-VpgName] ] [-OutputFile] [] +``` + +## DESCRIPTION +Queries VPGs and associated Virtual Machines to export all protected virtual machine NIC settings to a Comma Separated Value (CSV) file. This file can be used with the Import-ZertoVmNicSetting function to bulk update. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Export-ZertoVmNicSetting -OutputFile "C:\ZertoInfo\VMNicSettings.csv" +``` + +Exports VM Nic Settings for ALL Virtual Protection Groups to a file located at "C:\ZertoInfo\VMNicSettings.csv" + +### Example 2 +```powershell +PS C:\> Export-ZertoVmNicSetting -OutputFile "C:\ZertoInfo\VMNicSettings.csv" -VpgName "Exchange", "Support Forum" +``` + +Exports VM Nic Settings for Exchange and Support Forum Virtual Protection Groups to a file located at "C:\ZertoInfo\VMNicSettings.csv" + +## PARAMETERS + +### -OutputFile +Output file information + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VpgName +Vpg(s) to export. If no VPG was named, all data will be exported. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS From 90cf88b5cbd43349204b543bf86d373fc35351f1 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 8 Jul 2019 13:38:48 -0400 Subject: [PATCH 136/479] Update ZertoApiWrapper.build.ps1 --- ZertoApiWrapper.build.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index e36079a..1219dfd 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -1,6 +1,6 @@ #Requires -Modules 'InvokeBuild' -$version = "{0}.{1}" -f $(Get-Content .\version.txt), $(get-date -format 'yyyyMMdd') +$version = "{0}.{1}" -f $(Get-Content .\version.txt), $(Get-Date -format 'yyyyMMdd') task . CreateArtifacts @@ -59,9 +59,9 @@ task AnalyzeBuiltFiles CheckPSScriptAnalyzerInstalled, CreatePsm1ForRelease, { task FileTests CheckPesterInstalled, { $testResultsFile = "$BuildRoot\Tests\TestResults.xml" - $script:results = Invoke-Pester -Script "$BuildRoot" -Tag Unit -OutputFile $testResultsFile -PassThru + $script:results = Invoke-Pester -Script "$BuildRoot" -Tag Unit -OutputFile $testResultsFile -PassThru -Show Fails $FailureMessage = '{0} Unit test(s) failed. Aborting build' -f $results.FailedCount - assert ($results.FailedCount -eq 0) $FailureMessage + Assert ($results.FailedCount -eq 0) $FailureMessage } $buildMamlParams = @{ @@ -77,15 +77,15 @@ task BuildMamlHelp CheckPlatyPSInstalled, { } task UpdateMarkdownHelp CheckPlatyPSInstalled, { - remove-module ZertoApiWrapper -force -ErrorAction SilentlyContinue + Remove-Module ZertoApiWrapper -force -ErrorAction SilentlyContinue Import-Module .\ZertoApiWrapper\ZertoApiWrapper.psm1 -Force - Update-MarkDownHelp -Path docs -AlphabeticParamsOrder + Update-MarkdownHelp -Path docs -AlphabeticParamsOrder } task UpdateMarkdownHelpModule CheckPlatyPSInstalled, { - remove-module ZertoApiWrapper -force -ErrorAction SilentlyContinue + Remove-Module ZertoApiWrapper -force -ErrorAction SilentlyContinue Import-Module .\ZertoApiWrapper\ZertoApiWrapper.psm1 -Force - Update-MarkDownHelpModule -Path docs -AlphabeticParamsOrder + Update-MarkdownHelpModule -Path docs -AlphabeticParamsOrder } task CreatePsd1ForRelease CleanTemp, { From 80c82b99e08953f3b8a104ca450fba0960eb73da Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 9 Jul 2019 11:48:21 -0400 Subject: [PATCH 137/479] Update to use Export-CSV --- ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 b/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 index cace80a..6846145 100644 --- a/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 +++ b/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 @@ -77,7 +77,7 @@ function Export-ZertoVmNicSetting { $nicInfo } } - $nicSettings | ConvertTo-Csv | Out-File $OutputFile + $nicSettings | Export-Csv -Path $OutputFile } end { From cb991b3d0c3e7fb6f197eaa8787eac67b6a6f3aa Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 9 Jul 2019 12:38:02 -0400 Subject: [PATCH 138/479] Correct On-line Help Link URI --- docs/Get-ZertoZsspSession.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Get-ZertoZsspSession.md b/docs/Get-ZertoZsspSession.md index 9c698a9..487e2eb 100644 --- a/docs/Get-ZertoZsspSession.md +++ b/docs/Get-ZertoZsspSession.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertpZsspSession.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoZsspSession.md schema: 2.0.0 --- From 4d7d1391ff07a17329654a61540cf64c60864e07 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 9 Jul 2019 13:12:22 -0400 Subject: [PATCH 139/479] Create function and required supporting docs Import-ZertoVmNicSetting --- .../Public/Import-ZertoVmNicSetting.Tests.ps1 | 39 ++++++ .../Public/Import-ZertoVmNicSetting.ps1 | 125 ++++++++++++++++++ docs/Import-ZertoVmNicSetting.md | 60 +++++++++ 3 files changed, 224 insertions(+) create mode 100644 Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 create mode 100644 ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 create mode 100644 docs/Import-ZertoVmNicSetting.md diff --git a/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 b/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 new file mode 100644 index 0000000..5647976 --- /dev/null +++ b/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 @@ -0,0 +1,39 @@ +#Requires -Modules Pester +$moduleFileName = "ZertoApiWrapper.psd1" +$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") +$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") +$file = Get-ChildItem "$here\$sut" +$modulePath = $here -replace "Public", "" +$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" +Get-Module -Name ZertoApiWrapper | Remove-Module -Force +Import-Module $moduleFile -Force + +Describe $file.BaseName -Tag 'Unit' { + + It "is valid Powershell (Has no script errors)" { + $contents = Get-Content -Path $file -ErrorAction Stop + $errors = $null + $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) + $errors | Should -HaveCount 0 + } + + Context "$($file.BaseName)::Parameter Unit Tests" { + + It "Has a mandatory string array parameter for the settings file to import" { + Get-Command $file.BaseName | Should -HaveParameter InputFile + Get-Command $file.BaseName | Should -HaveParameter InputFile -Mandatory + Get-Command $file.BaseName | Should -HaveParameter InputFile -Type String + } + + It "Will not accecpt a Null or Empty string for the settings file" { + { Import-ZertoVpg -InputFile $null } | Should -Throw + { Import-ZertoVpg -InputFile "" } | Should -Throw + { Import-ZertoVpg -InputFile @() } | Should -Throw + } + + } + + Context "$($file.BaseName)::Function Unit Tests" { + + } +} diff --git a/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 b/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 new file mode 100644 index 0000000..8a24dec --- /dev/null +++ b/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 @@ -0,0 +1,125 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Import-ZertoVmNicSetting { + [CmdletBinding(SupportsShouldProcess)] + param( + # File to process for import + [Parameter(Helpmessage = "CSV file containing the required VM NIC settings", Mandatory)] + [ValidateNotNullOrEmpty()] + [string] + $InputFile + ) + + begin { + } + + process { + if (-not (Test-Path $InputFile)) { + Write-Error "Unable to find $InputFile. Please check the name and path and try again." -ErrorAction Stop + } elseif ((Get-Item $InputFile).Extension -notmatch '.csv') { + Write-Error "$InputFile does not have a 'csv' extension. Please check the name and path and try again." -ErrorAction Stop + } + $ExpectedHeaders = "VPGName", "VMName", "NicIdentifier", "LiveNetwork", "LiveShouldReplaceMac", "LiveIsDHCP", "LiveIpAddress", "LiveIpSubnetMask", "LiveIpDefaultGateway", "LivePrimaryDns", "LiveSecondayDns", "LiveDnsSuffix", "TestNetwork", "TestShouldReplaceMac", "TestIsDHCP", "TestIpAddress", "TestIpSubnetMask", "TestIpDefaultGateway", "TestPrimaryDns", "TestSecondayDns", "TestDnsSuffix" + $HeaderLine = ((Get-Content -Path $InputFile -First 1).Replace('"', '')).Split(',') + foreach ($header in $ExpectedHeaders) { + if ($header -notin $HeaderLine) { + Write-Error "$InputFile is malformed. Please ensure all headers are present." -ErrorAction Stop + } + } + $ImportData = Import-Csv -Path $InputFile + $VpgsToUpdate = $ImportData.VPGName | Select-Object -Unique + foreach ($Vpg in $VpgsToUpdate) { + $VpgInfo = Get-ZertoVpg -vpgName $Vpg + $VpgIdentifier = $VpgInfo.VpgIdentifier + $RecoveryNetworks = Get-ZertoVirtualizationSite -siteIdentifier $VpgInfo.RecoverySite.Identifier -networks + $NetworkMap = @{ } + foreach ($Network in $RecoveryNetworks) { + $NetworkMap[$Network.VirtualizationNetworkName] = $Network.NetworkIdentifier + } + $VpgVms = Get-ZertoProtectedVm -vpgName $Vpg + $VmMap = @{ } + foreach ($Vm in $VpgVms) { + $VmMap[$Vm.vmName] = $Vm.vmIdentifier + } + $VpgSettingsId = New-ZertoVpgSettingsIdentifier -vpgIdentifier $VpgIdentifier + $VmsToUpdate = $ImportData | Where-Object { $_.VPGName -eq $Vpg } + foreach ($vm in $VmsToUpdate) { + if ([string]::IsNullOrWhiteSpace($vm.VpgName) -or + [string]::IsNullOrWhiteSpace($Vm.VMName) -or + [string]::IsNullOrWhiteSpace($Vm.NicIdentifier) -or + [string]::IsNullOrWhiteSpace($Vm.LiveNetwork) -or + [string]::IsNullOrWhiteSpace($Vm.LiveShouldReplaceMac) -or + [string]::IsNullOrWhiteSpace($Vm.TestNetwork) -or + [string]::IsNullOrWhiteSpace($Vm.TestShouldReplaceMac)) { + Write-Error "$($Vm.VMName) does not contain all the required data. Please check the CSV entry for this item and try again." -ErrorAction Continue + } else { + $uri = "vpgSettings/{0}/vms/{1}" -f $vpgSettingsId, $vmMap[$vm.VMName] + $VmNicSettings = Get-ZertoVpgSetting -vpgSettingsIdentifier $vpgSettingsId -vmIdentifier $vmMap[$vm.VMName] + foreach ($nic in $VmNicSettings.nics) { + if ($nic.NicIdentifier -eq $vm.NicIdentifier) { + $nic.failover.Hypervisor.NetworkIdentifier = $NetworkMap[$vm.LiveNetwork] + $nic.failover.Hypervisor.ShouldReplaceMacAddress = $vm.LiveShouldReplaceMac + if ($null -eq $nic.failover.Hypervisor.IpConfig -and ($null -ne $vm.LiveIsDHCP -or $null -ne $vm.LiveIpAddress)) { + $IpConfig = [PSCustomObject]@{ + IsDhcp = $vm.LiveIsDHCP + StaticIp = $vm.LiveIpAddress + SubnetMask = $vm.LiveIpSubnetMask + Gateway = $vm.LiveIpDefaultGateway + PrimaryDns = $vm.LivePrimaryDns + SecondaryDns = $vm.LiveSecondayDns + } + $nic.failover.Hypervisor.IpConfig = $IpConfig + } elseif ($null -eq $nic.failover.Hypervisor.IpConfig -and $null -eq $vm.LiveIsDHCP -and $null -eq $vm.LiveIpAddress) { + $nic.failover.Hypervisor.IpConfig = $null + } else { + $nic.failover.Hypervisor.IpConfig.IsDhcp = $vm.LiveIsDHCP + $nic.failover.Hypervisor.IpConfig.StaticIp = $vm.LiveIpAddress + $nic.failover.Hypervisor.IpConfig.SubnetMask = $vm.LiveIpSubnetMask + $nic.failover.Hypervisor.IpConfig.Gateway = $vm.LiveIpDefaultGateway + $nic.failover.Hypervisor.IpConfig.PrimaryDns = $vm.LivePrimaryDns + $nic.failover.Hypervisor.IpConfig.SecondaryDns = $vm.LiveSecondayDns + } + $nic.failover.Hypervisor.DnsSuffix = $vm.LiveDnsSuffix + $nic.failoverTest.Hypervisor.NetworkIdentifier = $NetworkMap[$vm.TestNetwork] + $nic.failoverTest.Hypervisor.ShouldReplaceMacAddress = $vm.TestShouldReplaceMac + if ($null -eq $nic.failoverTest.Hypervisor.IpConfig -and ($null -ne $vm.TestIsDHCP -or $null -ne $vm.TestIpAddress)) { + $IpConfig = [PsCustomObject]@{ + IsDhcp = $vm.TestIsDHCP + StaticIp = $vm.TestIpAddress + SubnetMask = $vm.TestIpSubnetMask + Gateway = $vm.TestIpDefaultGateway + PrimaryDns = $vm.TestPrimaryDns + SecondaryDns = $vm.TestSecondayDns + } + $nic.failoverTest.Hypervisor.IpConfig = $IpConfig + } elseif ($null -eq $nic.failoverTest.Hypervisor.IpConfig -and $null -eq $vm.TestIsDHCP -and $null -eq $vm.TestIpAddress) { + $nic.failoverTest.Hypervisor.IpConfig = $null + } else { + $nic.failoverTest.Hypervisor.IpConfig.IsDhcp = $vm.TestIsDHCP + $nic.failoverTest.Hypervisor.IpConfig.StaticIp = $vm.TestIpAddress + $nic.failoverTest.Hypervisor.IpConfig.SubnetMask = $vm.TestIpSubnetMask + $nic.failoverTest.Hypervisor.IpConfig.Gateway = $vm.TestIpDefaultGateway + $nic.failoverTest.Hypervisor.IpConfig.PrimaryDns = $vm.TestPrimaryDns + $nic.failoverTest.Hypervisor.IpConfig.SecondaryDns = $vm.TestSecondayDns + } + $nic.failoverTest.Hypervisor.DnsSuffix = $vm.TestDnsSuffix + } + } + Write-Verbose "Putting Updated Config for VM: $($vm.vmname) in Vpg: $Vpg" + if ($PSCmdlet.ShouldProcess($vm.NicIdentifier, "Updating Nic")) { + Invoke-ZertoRestRequest -uri $uri -Method "PUT" -Body ($VmNicSettings | ConvertTo-Json -Depth 10) > $null + } + } + } + Write-Verbose "Saving updated configuration for VPG: $Vpg" + if ($PSCmdlet.ShouldProcess($Vpg, "Saving Changes")) { + Save-ZertoVpgSetting -vpgSettingsIdentifier $vpgSettingsId + } + Write-Verbose "Waiting 5 Seconds for Next VPG Update" + Start-Sleep 5 + } + } + + + end { + } +} diff --git a/docs/Import-ZertoVmNicSetting.md b/docs/Import-ZertoVmNicSetting.md new file mode 100644 index 0000000..f2a8d62 --- /dev/null +++ b/docs/Import-ZertoVmNicSetting.md @@ -0,0 +1,60 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoZsspSession.md +schema: 2.0.0 +--- + +# Import-ZertoVmNicSetting + +## SYNOPSIS +Using a CSV file, will import updated Live and Test network settings for protected virtual machines. + +## SYNTAX + +``` +Import-ZertoVmNicSetting [-InputFile] [] +``` + +## DESCRIPTION +Using a CSV file, will import updated Live and Test network settings for protected virtual machines. This function will read the provided CSV file and only update VMs defined in the file. + +It should be noted, due to current API limitations once a NIC is defined to update to either a Static IP address or use a DHCP address, it is not possible to remove that configuration via the API. Should you require this functionality, you will need to manually update via the GUI to set the option to "No" + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Import-ZertoVmNicSetting -InputFile 'C:\ZertoScripts\UpdatedNicInformation.csv' +``` + +Imports the data in the CSV located at 'C:\ZertoScripts\UpdatedNicInformation.csv' and updates each VM and each NIC as defined in the CSV file. + +## PARAMETERS + +### -InputFile +File to process for import + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS +[Zerto Virtual Manager REST API VpgSettings end point documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.110.html%23) From ddb639ad6b122b2623114b61baf0a027f0153956 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 9 Jul 2019 13:29:31 -0400 Subject: [PATCH 140/479] Update RELEASENOTES.md --- RELEASENOTES.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 4e5cafc..e4df1d1 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -2,8 +2,10 @@ ### Zerto Virtual Manager -* +* Added two functions to aid in bulk updating of NIC information for protected VMs. ([Issue 38](https://github.com/ZertoPublic/ZertoApiWrapper/issues/38)) + * [Export-ZertoVmNicSetting](https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Export-ZertoVmNicSettings.md) + * [Import-ZertoVmNicSetting](https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Import-ZertoVmNicSettings.md) ### Zerto Analytics -* Fixed an issue where the Zerto Analytics Rest Request function was not checking for the token before attempting a connection. +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/36) where the Zerto Analytics Rest Request function was not checking for the token before attempting a connection. From 46951b76ba4cf2fd1f5c188512825bbfa476114f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 26 Jul 2019 08:33:41 -0400 Subject: [PATCH 141/479] Add missing formatting variable to the Get-ZAVpg function (#41) * Add missing formatting variable * Update ReleaseNotes --- RELEASENOTES.md | 1 + ZertoApiWrapper/Public/Get-ZAVpg.ps1 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index e4df1d1..33751db 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -9,3 +9,4 @@ ### Zerto Analytics * Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/36) where the Zerto Analytics Rest Request function was not checking for the token before attempting a connection. +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/40) where the `Get-ZAVpg` method would return a 404 error when a `-vpgIdentifier` parameter was specified. diff --git a/ZertoApiWrapper/Public/Get-ZAVpg.ps1 b/ZertoApiWrapper/Public/Get-ZAVpg.ps1 index 3b31e20..a105390 100644 --- a/ZertoApiWrapper/Public/Get-ZAVpg.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAVpg.ps1 @@ -28,7 +28,7 @@ function Get-ZAVpg { } vpg { - $uri = "{0}/$vpgIdentifier" + $uri = "{0}/$vpgIdentifier" -f $uri } } From 7f5fb6c1ac3a0155ce054a0d4f9f7caaec8978d4 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 10 Jul 2019 21:10:13 -0400 Subject: [PATCH 142/479] Update Build Process Versions and Steps --- ZertoApiWrapper.Depend.psd1 | 6 +- ZertoApiWrapper.build.ps1 | 106 +++++++++++++++++++++++------------- 2 files changed, 72 insertions(+), 40 deletions(-) diff --git a/ZertoApiWrapper.Depend.psd1 b/ZertoApiWrapper.Depend.psd1 index 196f108..cb3f97d 100644 --- a/ZertoApiWrapper.Depend.psd1 +++ b/ZertoApiWrapper.Depend.psd1 @@ -7,7 +7,7 @@ SkipPublisherCheck = $true } Target = 'CurrentUser' - Version = '5.5.1' + Version = '5.5.2' Tags = 'Bootstrap' } @@ -19,7 +19,7 @@ SkipPublisherCheck = $true } Target = 'CurrentUser' - Version = '4.7.3' + Version = '4.8.1' Tags = 'Bootstrap' } @@ -31,7 +31,7 @@ SkipPublisherCheck = $true } Target = 'CurrentUser' - Version = '1.18.0' + Version = '1.18.1' Tags = 'Bootstrap' } diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 1219dfd..96af513 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -2,8 +2,26 @@ $version = "{0}.{1}" -f $(Get-Content .\version.txt), $(Get-Date -format 'yyyyMMdd') +#Define the default task task . CreateArtifacts +#Region - Helper Functions +function ImportRawModule() { + If (Get-Module -Name ZertoApiWrapper) { + Remove-Module -Name ZertoApiWrapper -Force -ErrorAction Stop + } + Import-Module "$BuildRoot\ZertoApiWrapper\ZertoApiWrapper.psd1" -ErrorAction Stop +} + +function ImportBuiltModule() { + If (Get-Module -Name ZertoApiWrapper) { + Remove-Module -Name ZertoApiWrapper -Force -ErrorAction Stop + } + Import-Module "$BuildRoot\temp\ZertoApiWrapper.psd1" -ErrorAction Stop +} +#EndRegion + +#Region - Module Checks <# Synopsis: Ensure platyPS is installed #> task CheckPlatyPSInstalled { if ($null -eq (Get-Module -List platyPS)) { @@ -24,7 +42,9 @@ task CheckPSScriptAnalyzerInstalled { Install-Module -Scope CurrentUser -Repository PSGallery -Name PSScriptAnalyzer } } +#EndRegion +#Region - PSSA Tasks <# Synopsis: Analyze ZertoApiWrapper functions for Code Violations #> task AnalyzeSourceFiles CheckPSScriptAnalyzerInstalled, { $scriptAnalyzerParams = @{ @@ -56,14 +76,42 @@ task AnalyzeBuiltFiles CheckPSScriptAnalyzerInstalled, CreatePsm1ForRelease, { throw "One or more PSScriptAnalyzer errors/warnings were found" } } +#EndRegion -task FileTests CheckPesterInstalled, { - $testResultsFile = "$BuildRoot\Tests\TestResults.xml" +#Region - Clean Operations +task CleanTemp { + if (-not $(Test-Path "$BuildRoot\temp")) { + New-Item -Path $BuildRoot -Name "temp" -ItemType "Directory" + } + Remove-Item -Recurse -Path "$BuildRoot\temp\*" +} + +task CleanPublish { + if ($(Test-Path "$BuildRoot\publish")) { + Remove-Item -Recurse -Path "$BuildRoot\publish\*" + } +} +#EndRegion + +#Region - Pester Tests +task RawFileTests CheckPesterInstalled, { + ImportRawModule + $testResultsFile = "$BuildRoot\Tests\RawTestResults.xml" $script:results = Invoke-Pester -Script "$BuildRoot" -Tag Unit -OutputFile $testResultsFile -PassThru -Show Fails $FailureMessage = '{0} Unit test(s) failed. Aborting build' -f $results.FailedCount Assert ($results.FailedCount -eq 0) $FailureMessage } +task BuiltFileTests CheckPesterInstalled, { + ImportBuiltModule + $testResultsFile = "$BuildRoot\Tests\BuiltTestResults.xml" + $script:results = Invoke-Pester -Script "$BuildRoot" -Tag Unit -OutputFile $testResultsFile -PassThru -Show Fails + $FailureMessage = '{0} Unit test(s) failed. Aborting build' -f $results.FailedCount + Assert ($results.FailedCount -eq 0) $FailureMessage +} +#EndRegion + +#Region - Build Help System $buildMamlParams = @{ Inputs = { Get-ChildItem docs\*.md } Outputs = "$BuildRoot\temp\en-us\ZertoApiWrapper-help.xml" @@ -77,17 +125,12 @@ task BuildMamlHelp CheckPlatyPSInstalled, { } task UpdateMarkdownHelp CheckPlatyPSInstalled, { - Remove-Module ZertoApiWrapper -force -ErrorAction SilentlyContinue - Import-Module .\ZertoApiWrapper\ZertoApiWrapper.psm1 -Force - Update-MarkdownHelp -Path docs -AlphabeticParamsOrder -} - -task UpdateMarkdownHelpModule CheckPlatyPSInstalled, { - Remove-Module ZertoApiWrapper -force -ErrorAction SilentlyContinue - Import-Module .\ZertoApiWrapper\ZertoApiWrapper.psm1 -Force + ImportRawModule Update-MarkdownHelpModule -Path docs -AlphabeticParamsOrder } +#EndRegion +#Region - Build Module Files task CreatePsd1ForRelease CleanTemp, { $functionsToExport = Get-ChildItem -Path 'ZertoApiWrapper\Public\*.ps1' | ForEach-Object { $_.BaseName } $releaseNotes = "# {0}{1}" -f $version, $(Get-Content .\RELEASENOTES.md -Raw) @@ -114,20 +157,14 @@ task CreatePsd1ForRelease CleanTemp, { New-ModuleManifest @ManifestParams } -task CleanTemp { - if (-not $(Test-Path "$BuildRoot\temp")) { - New-Item -Path $BuildRoot -Name "temp" -ItemType "Directory" - } - Remove-Item -Recurse -Path "$BuildRoot\temp\*" -} - task CreatePsm1ForRelease CreatePsd1ForRelease, { $emptyLine = "" $psm1Path = "$BuildRoot\temp\ZertoApiWrapper.psm1" $lines = '#------------------------------------------------------------#' - $Public = @( Get-ChildItem -Path $BuildRoot\ZertoApiWrapper\Public\*.ps1 -ErrorAction SilentlyContinue ) - $functionCount = 0 - $exportString = "" + $Private = @( Get-ChildItem -Path $BuildRoot\ZertoApiWrapper\Private\*.ps1 -ErrorAction Stop ) + $Public = @( Get-ChildItem -Path $BuildRoot\ZertoApiWrapper\Public\*.ps1 -ErrorAction Stop ) + <# $functionCount = 0 + $exportString = "" foreach ($file in $Public) { if ($functionCount -eq 0) { $functionCount++ @@ -136,8 +173,7 @@ task CreatePsm1ForRelease CreatePsd1ForRelease, { $functionCount++ $exportString = "{0}, {1}" -f $exportString, $file.BaseName } - } - $Private = @( Get-ChildItem -Path $BuildRoot\ZertoApiWrapper\Private\*.ps1 -ErrorAction SilentlyContinue ) + } #> Add-Content -Path $psm1Path -Value $lines Add-Content -Path $psm1Path -Value "#---------------------Private Functions----------------------#" Add-Content -Path $psm1Path -Value $lines @@ -154,27 +190,23 @@ task CreatePsm1ForRelease CreatePsd1ForRelease, { Add-Content -Path $psm1Path -Value $(Get-Content -Path $file.Fullname -Raw) Add-Content -Path $psm1Path -Value $emptyLine } - Add-Content -Path $psm1Path -Value $emptyLine - Add-Content -Path $psm1Path -Value "Export-ModuleMember -Function $exportString" + # Add-Content -Path $psm1Path -Value $emptyLine + # Add-Content -Path $psm1Path -Value "Export-ModuleMember -Function $exportString" } +#EndRegion -task CreateArtifacts CleanPublish, CreateModule, { +#Region - Artifacts \ Publish +# Full Build Process - No Publishing +task CreateArtifacts CleanPublish, CleanTemp, AnalyzeSourceFiles, RawFileTests, AnalyzeBuiltFiles, BuiltFileTests, BuildMamlHelp, { if (-not $(Test-Path "$BuildRoot\publish")) { New-Item -Path $BuildRoot -Name "publish" -ItemType Directory } Compress-Archive -Path .\temp\* -DestinationPath .\publish\ZertoApiWrapper.zip - Get-Module -Name ZertoApiWrapper | Remove-Module -Force - Import-Module .\temp\ZertoApiWrapper.psd1 -Force + ImportBuiltModule (Get-Module ZertoApiWrapper).ReleaseNotes | Add-Content .\publish\release-notes.txt (Get-Module ZertoApiWrapper).Version.ToString() | Add-Content .\publish\release-version.txt + Copy-Item "$BuildRoot\ZertoApiWrapper.build.ps1" "$BuildRoot\publish\ZertoApiWrapper.build.ps1" + Copy-Item "$BuildRoot\ZertoApiWrapper.Depend.psd1" "$BuildRoot\publish\ZertoApiWrapper.Depend.psd1" + Copy-Item "$BuildRoot\build.ps1" "$BuildRoot\publish\build.ps1" } - -task CleanPublish { - if ($(Test-Path "$BuildRoot\publish")) { - Remove-Item -Recurse -Path "$BuildRoot\publish\*" - } -} - -task CreateModule CleanTemp, FileTests, AnalyzeBuiltFiles, BuildMamlHelp, { - -} +#EndRegion From 7339366f7d8aeb4426c8036b757630a5ed4ee8df Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 10 Jul 2019 21:19:48 -0400 Subject: [PATCH 143/479] Update Build Pipeline for Additional Tests --- azure-pipelines.yml | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e1f7ae8..de9b562 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,10 +32,18 @@ jobs: - task: PublishTestResults@2 inputs: testRunner: 'NUnit' - testResultsFiles: '**/TestResults.xml' - testRunTitle: 'PS_Win2016' + testResultsFiles: '**/RawTestResults.xml' + testRunTitle: 'PS_Win2016_Raw' displayName: 'Publish Test Results' condition: always() + - task: PublishTestResults@2 + inputs: + testRunner: 'NUnit' + testResultsFiles: '**/BuiltTestResults.xml' + testRunTitle: 'PS_Win2016_Built' + displayName: 'Publish Test Results' + condition: always() + # Windows PowerShell Core Build Job - job: Build_PSCore_Win2016 @@ -52,8 +60,15 @@ jobs: - task: PublishTestResults@2 inputs: testRunner: 'NUnit' - testResultsFiles: '**/TestResults.xml' - testRunTitle: 'PS_Win2016' + testResultsFiles: '**/RawTestResults.xml' + testRunTitle: 'PSCore_Win2016_Raw' + displayName: 'Publish Test Results' + condition: always() + - task: PublishTestResults@2 + inputs: + testRunner: 'NUnit' + testResultsFiles: '**/BuiltTestResults.xml' + testRunTitle: 'PSCore_Win2016_Built' displayName: 'Publish Test Results' condition: always() @@ -72,8 +87,15 @@ jobs: - task: PublishTestResults@2 inputs: testRunner: 'NUnit' - testResultsFiles: '**/TestResults.xml' - testRunTitle: 'PSCore_Ubuntu1604' + testResultsFiles: '**/RawTestResults.xml' + testRunTitle: 'PSCore_Ubuntu_Raw' + displayName: 'Publish Test Results' + condition: always() + - task: PublishTestResults@2 + inputs: + testRunner: 'NUnit' + testResultsFiles: '**/BuiltTestResults.xml' + testRunTitle: 'PSCore_Ubuntu_Built' displayName: 'Publish Test Results' condition: always() - task: PublishPipelineArtifact@0 @@ -104,7 +126,14 @@ jobs: - task: PublishTestResults@2 inputs: testRunner: 'NUnit' - testResultsFiles: '**/TestResults.xml' - testRunTitle: 'PSCore_MacOS1013' + testResultsFiles: '**/RawTestResults.xml' + testRunTitle: 'PSCore_MacOS1013_Raw' + displayName: 'Publish Test Results' + condition: always() + - task: PublishTestResults@2 + inputs: + testRunner: 'NUnit' + testResultsFiles: '**/BuiltTestResults.xml' + testRunTitle: 'PSCore_MacOS1013_Built' displayName: 'Publish Test Results' condition: always() From 9a010244b492e6feeb7aad5402d997f441738e46 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 11 Jul 2019 07:55:47 -0400 Subject: [PATCH 144/479] Update to paths --- ZertoApiWrapper.build.ps1 | 12 ++++++------ azure-pipelines.yml | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 96af513..b823443 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -6,7 +6,7 @@ $version = "{0}.{1}" -f $(Get-Content .\version.txt), $(Get-Date -format 'yyyyMM task . CreateArtifacts #Region - Helper Functions -function ImportRawModule() { +function ImportSourceModule() { If (Get-Module -Name ZertoApiWrapper) { Remove-Module -Name ZertoApiWrapper -Force -ErrorAction Stop } @@ -94,9 +94,9 @@ task CleanPublish { #EndRegion #Region - Pester Tests -task RawFileTests CheckPesterInstalled, { - ImportRawModule - $testResultsFile = "$BuildRoot\Tests\RawTestResults.xml" +task SourceFileTests CheckPesterInstalled, { + ImportSourceModule + $testResultsFile = "$BuildRoot\Tests\SourceTestResults.xml" $script:results = Invoke-Pester -Script "$BuildRoot" -Tag Unit -OutputFile $testResultsFile -PassThru -Show Fails $FailureMessage = '{0} Unit test(s) failed. Aborting build' -f $results.FailedCount Assert ($results.FailedCount -eq 0) $FailureMessage @@ -125,7 +125,7 @@ task BuildMamlHelp CheckPlatyPSInstalled, { } task UpdateMarkdownHelp CheckPlatyPSInstalled, { - ImportRawModule + ImportSourceModule Update-MarkdownHelpModule -Path docs -AlphabeticParamsOrder } #EndRegion @@ -197,7 +197,7 @@ task CreatePsm1ForRelease CreatePsd1ForRelease, { #Region - Artifacts \ Publish # Full Build Process - No Publishing -task CreateArtifacts CleanPublish, CleanTemp, AnalyzeSourceFiles, RawFileTests, AnalyzeBuiltFiles, BuiltFileTests, BuildMamlHelp, { +task CreateArtifacts CleanPublish, CleanTemp, AnalyzeSourceFiles, SourceFileTests, AnalyzeBuiltFiles, BuiltFileTests, BuildMamlHelp, { if (-not $(Test-Path "$BuildRoot\publish")) { New-Item -Path $BuildRoot -Name "publish" -ItemType Directory } diff --git a/azure-pipelines.yml b/azure-pipelines.yml index de9b562..9a6cd9e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -32,8 +32,8 @@ jobs: - task: PublishTestResults@2 inputs: testRunner: 'NUnit' - testResultsFiles: '**/RawTestResults.xml' - testRunTitle: 'PS_Win2016_Raw' + testResultsFiles: '**/SourceTestResults.xml' + testRunTitle: 'PS_Win2016_Source' displayName: 'Publish Test Results' condition: always() - task: PublishTestResults@2 @@ -60,8 +60,8 @@ jobs: - task: PublishTestResults@2 inputs: testRunner: 'NUnit' - testResultsFiles: '**/RawTestResults.xml' - testRunTitle: 'PSCore_Win2016_Raw' + testResultsFiles: '**/SourceTestResults.xml' + testRunTitle: 'PSCore_Win2016_Source' displayName: 'Publish Test Results' condition: always() - task: PublishTestResults@2 @@ -87,8 +87,8 @@ jobs: - task: PublishTestResults@2 inputs: testRunner: 'NUnit' - testResultsFiles: '**/RawTestResults.xml' - testRunTitle: 'PSCore_Ubuntu_Raw' + testResultsFiles: '**/SourceTestResults.xml' + testRunTitle: 'PSCore_Ubuntu_Source' displayName: 'Publish Test Results' condition: always() - task: PublishTestResults@2 @@ -126,8 +126,8 @@ jobs: - task: PublishTestResults@2 inputs: testRunner: 'NUnit' - testResultsFiles: '**/RawTestResults.xml' - testRunTitle: 'PSCore_MacOS1013_Raw' + testResultsFiles: '**/SourceTestResults.xml' + testRunTitle: 'PSCore_MacOS1013_Source' displayName: 'Publish Test Results' condition: always() - task: PublishTestResults@2 From e930f996d656c515de848e50ac114a7c5b6939fb Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 11 Jul 2019 18:05:53 -0400 Subject: [PATCH 145/479] Add mock files for testing --- Tests/Public/Mocks/AuthHeaders.json | 23 ++++++++ Tests/Public/Mocks/LocalSiteInfo.json | 20 +++++++ Tests/Public/Mocks/TaskId.txt | 1 + Tests/Public/Mocks/VPGInfo.json | 75 +++++++++++++++++++++++++++ Tests/Public/Mocks/ZAToken.json | 4 ++ 5 files changed, 123 insertions(+) create mode 100644 Tests/Public/Mocks/AuthHeaders.json create mode 100644 Tests/Public/Mocks/LocalSiteInfo.json create mode 100644 Tests/Public/Mocks/TaskId.txt create mode 100644 Tests/Public/Mocks/VPGInfo.json create mode 100644 Tests/Public/Mocks/ZAToken.json diff --git a/Tests/Public/Mocks/AuthHeaders.json b/Tests/Public/Mocks/AuthHeaders.json new file mode 100644 index 0000000..6f904f8 --- /dev/null +++ b/Tests/Public/Mocks/AuthHeaders.json @@ -0,0 +1,23 @@ +{ + "apiRequestResults": "", + "Headers": { + "Cache-Control": [ + "no-cache" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-zerto-session": [ + "e34da0b0-4bc2-4cda-b316-0384e35bdca5" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 11 Jul 2019 19:05:40 GMT" + ], + "Content-Length": [ + "0" + ] + } +} diff --git a/Tests/Public/Mocks/LocalSiteInfo.json b/Tests/Public/Mocks/LocalSiteInfo.json new file mode 100644 index 0000000..8fe97a2 --- /dev/null +++ b/Tests/Public/Mocks/LocalSiteInfo.json @@ -0,0 +1,20 @@ +{ + "BandwidthThrottlingInMBs": -1, + "ContactEmail": "vSphere-Site01@zerto.com", + "ContactName": "vSphere-Site01@zerto.com", + "ContactPhone": "066-6666666", + "IpAddress": "192.168.200.1", + "IsReplicationToSelfEnabled": true, + "Link": { + "href": "https://192.168.222.1:7669/v1/localsite", + "identifier": "63a62dc2-ef6f-45aa-809f-9dbaeb8c06cf", + "rel": null, + "type": "LocalSiteApi" + }, + "Location": "vSphere-Site01", + "SiteIdentifier": "63a62dc2-ef6f-45aa-809f-9dbaeb8c06cf", + "SiteName": "vSphere-Site01 at Zerto", + "SiteType": "VCenter", + "UtcOffsetInMinutes": -240, + "Version": "7.0.0" +} diff --git a/Tests/Public/Mocks/TaskId.txt b/Tests/Public/Mocks/TaskId.txt new file mode 100644 index 0000000..6c7b99c --- /dev/null +++ b/Tests/Public/Mocks/TaskId.txt @@ -0,0 +1 @@ +7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a diff --git a/Tests/Public/Mocks/VPGInfo.json b/Tests/Public/Mocks/VPGInfo.json new file mode 100644 index 0000000..f2fae5e --- /dev/null +++ b/Tests/Public/Mocks/VPGInfo.json @@ -0,0 +1,75 @@ +{ + "ActiveProcessesApi": { + "RunningFailOverTestApi": null + }, + "ActualRPO": 6, + "BackupEnabled": false, + "ConfiguredRpoSeconds": 300, + "Entities": { + "Protected": 0, + "Recovery": 0, + "Source": 0, + "Target": 0 + }, + "FailSafeHistory": { + "ActualFailSafeHistory": 60, + "ConfiguredFailSafeHistory": 60, + "FailSafeDescription": "" + }, + "HistoryStatusApi": { + "ActualHistoryInMinutes": 225, + "ConfiguredHistoryInMinutes": 60, + "EarliestCheckpoint": { + "CheckpointIdentifier": "166834", + "Tag": null, + "TimeStamp": "2019-07-11T13:47:23Z" + } + }, + "IOPs": 8, + "LastTest": "2019-07-11T16:51:07.022Z", + "Link": { + "href": "https://192.168.222.1:7669/v1/vpgs/99c460c1-a4ec-48dd-8921-bbcca9cd29b9", + "identifier": "99c460c1-a4ec-48dd-8921-bbcca9cd29b9", + "rel": null, + "type": "VpgApi" + }, + "Link_{0}": { + "href": "https://192.168.222.1:7669/v1/vpgs/99c460c1-a4ec-48dd-8921-bbcca9cd29b9", + "rel": "self", + "type": "VpgApi" + }, + "OrganizationName": "", + "Priority": 1, + "ProgressPercentage": 0, + "ProtectedSite": { + "href": "https://192.168.222.1:7669/v1/localsite", + "identifier": "63a62dc2-ef6f-45aa-809f-9dbaeb8c06cf", + "rel": null, + "type": "LocalSiteApi" + }, + "ProvisionedStorageInMB": 400, + "RecoverySite": { + "href": "https://192.168.222.1:7669/v1/peersites/3e4cdd0d-1064-4022-921f-6265ad6d335a", + "identifier": "3e4cdd0d-1064-4022-921f-6265ad6d335a", + "rel": null, + "type": "PeerSiteApi" + }, + "ServiceProfile": null, + "ServiceProfileIdentifier": null, + "ServiceProfileName": "", + "SourceSite": "vSphere-Site01 at Zerto", + "Status": 1, + "SubStatus": 0, + "TargetSite": "vSphere-Site02 at Zerto", + "ThroughputInMB": 58.55859375, + "UsedStorageInMB": 400, + "VmsCount": 4, + "VpgIdentifier": "99c460c1-a4ec-48dd-8921-bbcca9cd29b9", + "VpgName": "Exchange", + "Zorg": { + "href": "https://192.168.222.1:7669/v1/zorgs/00000000-0000-0000-0000-000000000000", + "identifier": "00000000-0000-0000-0000-000000000000", + "rel": null, + "type": "ZorgApi" + } +} diff --git a/Tests/Public/Mocks/ZAToken.json b/Tests/Public/Mocks/ZAToken.json new file mode 100644 index 0000000..335aa89 --- /dev/null +++ b/Tests/Public/Mocks/ZAToken.json @@ -0,0 +1,4 @@ +{ + "type": "Bearer", + "token": "N074r34l70k3n" +} From 5eae4857cf3b854805c5e73bcf74491a8e6d26fa Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 11 Jul 2019 18:14:32 -0400 Subject: [PATCH 146/479] Updating tests for multiuse --- Tests/Public/Add-ZertoPeerSite.Tests.ps1 | 92 ++++---- Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 | 78 +++---- Tests/Public/Connect-ZertoAnalytics.Tests.ps1 | 85 ++++++-- Tests/Public/Connect-ZertoServer.Tests.ps1 | 205 ++++++------------ Tests/Public/Disconnect-ZertoServer.Tests.ps1 | 53 ++--- 5 files changed, 247 insertions(+), 266 deletions(-) diff --git a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 index a55ee59..39fd439 100644 --- a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 @@ -1,76 +1,70 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$script:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { - - It "Is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 +Describe $script:function -Tag 'Unit', 'Source', 'Built' { + BeforeAll { + $script:ScriptBlock = (Get-Command $script:function).ScriptBlock } - Context "$($file.BaseName)::Parameter Unit Tests" { + Context "$script:function::Parameter Unit Tests" { - it "Has a mandatory string parameter for the target host" { - Get-Command $file.BaseName | Should -HaveParameter TargetHost -Mandatory -Type String + It "Has a mandatory string parameter for the target host" { + Get-Command $script:function | Should -HaveParameter TargetHost -Mandatory -Type String } - it "Will not take a non-ip address as a 'TargetHost'" { - {Add-ZertoPeerSite -targetHost 'MyZVMHost' -targetPort '9081'} | should -Throw - {Add-ZertoPeerSite -targetHost '192.168.1.266' -targetPort '9081'} | should -Throw - {Add-ZertoPeerSite -targetHost '192.168.1' -targetPort '9081'} | should -Throw - {Add-ZertoPeerSite -targetHost $null -targetPort '9081'} | should -Throw + It "Will not take a non-ip address as a 'TargetHost'" { + { Add-ZertoPeerSite -targetHost 'MyZVMHost' -targetPort '9081' } | Should -Throw + { Add-ZertoPeerSite -targetHost '192.168.1.266' -targetPort '9081' } | Should -Throw + { Add-ZertoPeerSite -targetHost '192.168.1' -targetPort '9081' } | Should -Throw + { Add-ZertoPeerSite -targetHost $null -targetPort '9081' } | Should -Throw } - it "Has a non-mandatory string parameter for the target port with default value of 9081" { - Get-Command $file.BaseName | Should -HaveParameter TargetPort -Not -Mandatory - Get-Command $file.BaseName | Should -HaveParameter TargetPort -Type Int32 - Get-Command $file.BaseName | Should -HaveParameter TargetPort -DefaultValue 9081 + It "Has a non-mandatory string parameter for the target port with default value of 9081" { + Get-Command Add-ZertoPeerSite | Should -HaveParameter TargetPort -Not -Mandatory + Get-Command Add-ZertoPeerSite | Should -HaveParameter TargetPort -Type Int32 + Get-Command Add-ZertoPeerSite | Should -HaveParameter TargetPort -DefaultValue 9081 } - it "Will not take a non-int as a port" { - {Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort 'string'} | should -Throw - {Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort $true} | should -Throw - {Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort $null} | should -Throw + It "Will not take a non-int as a port" { + { Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort 'string' } | Should -Throw + { Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort $true } | Should -Throw + { Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort $null } | Should -Throw } It "Will fail if the specified port is outside of the range 1024 - 65535" { - {Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort 1023} | Should -Throw - {Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort 65536} | Should -Throw - {Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort 0} | Should -Throw - {Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort -1} | Should -Throw + { Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort 1023 } | Should -Throw + { Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort 65536 } | Should -Throw + { Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort 0 } | Should -Throw + { Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort -1 } | Should -Throw } - it "Supports 'SupportsShouldProcess'" { - Get-Command $file.BaseName | Should -HaveParameter WhatIf - Get-Command $file.BaseName | Should -HaveParameter Confirm - $file | Should -FileContentMatch 'SupportsShouldProcess' - $file | Should -FileContentMatch '\$PSCmdlet\.ShouldProcess\(.+\)' + It "Supports 'SupportsShouldProcess'" { + Get-Command $script:function | Should -HaveParameter WhatIf + Get-Command $script:function | Should -HaveParameter Confirm + $script:ScriptBlock | Should -match 'SupportsShouldProcess' + $script:ScriptBlock | Should -match '\$PSCmdlet\.ShouldProcess\(.+\)' } } - Context "$($file.BaseName)::Function Unit Tests" { - - Mock -ModuleName ZertoApiWrapper Invoke-ZertoRestRequest { - return "9a49f42e-2bbd-4bf8-b571-77908a2e5e98.928a122b-1763-4664-ad37-cc00bb883f2f" + Context "Add-ZertoPeerSite::Functional Unit Tests" { + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest { + return (Get-Content "$global:here\Mocks\TaskId.txt") } - it "Returns a string value" { + It "Returns a string value" { $results = Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort '9081' - $results | should -Not -BeNullOrEmpty - $results | should -BeOfType "String" - $results | Should -BeExactly "9a49f42e-2bbd-4bf8-b571-77908a2e5e98.928a122b-1763-4664-ad37-cc00bb883f2f" + $results | Should -Not -BeNullOrEmpty + $results | Should -BeOfType "String" + $results | Should -BeExactly "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a" } - Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest + It "Does not return a taskId if '-whatif' is used" { + $results = Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort '9081' -WhatIf + $results | Should -BeNullOrEmpty + } + + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -Exactly 1 } } diff --git a/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 b/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 index f07f347..3cc79e4 100644 --- a/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 @@ -1,66 +1,60 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$script:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { - - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 +Describe $script:function -Tag 'Unit', 'Source', 'Built' { + BeforeAll { + $script:ScriptBlock = (Get-Command $script:function).ScriptBlock } Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest { - return "3b687246-ac63-40da-9a59-b99863769eb0.928a122b-1763-4664-ad37-cc00bb883f2f" + return (Get-Content "$global:here\Mocks\TaskId.txt") } - Mock -ModuleName ZertoApiWrapper -CommandName get-zertovpg { - return @{vpgIdentifier = "dddf2fa8-79e2-4e4f-a83b-f66676afea64"} + Mock -ModuleName ZertoApiWrapper -CommandName get-zertovpg -ParameterFilter { $VpgName -eq "MyVpg" } { + return (Get-Content "$global:here\Mocks\VPGInfo.json" -Raw | ConvertFrom-Json) } - Context "$($file.BaseName)::Parameter Unit Tests" { - it "Has a parameter for the VpgName that is Mandatory" { - Get-Command $file.BaseName | Should -HaveParameter vpgName -Mandatory -Type String + Context "$($script:function)::Parameter Unit Tests" { + It "Has a parameter for the VpgName that is Mandatory" { + Get-Command $script:function | Should -HaveParameter vpgName -Mandatory -Type String } - it "Has a parameter for the CheckpointName that is Mandatory" { - Get-Command $file.BaseName | Should -HaveParameter CheckpointName -Mandatory -Type String + It "Has a parameter for the CheckpointName that is Mandatory" { + Get-Command $script:function | Should -HaveParameter CheckpointName -Mandatory -Type String } - it "Throws and error when an empty or null checkpointName is specified" { - {Checkpoint-ZertoVpg -vpgName "MyVpg" -checkpointName ""} | Should -Throw - {Checkpoint-ZertoVpg -vpgName "MyVpg" -checkpointName $null} | Should -Throw + It "Throws and error when an empty or null checkpointName is specified" { + { Checkpoint-ZertoVpg -vpgName "MyVpg" -checkpointName "" } | Should -Throw + { Checkpoint-ZertoVpg -vpgName "MyVpg" -checkpointName $null } | Should -Throw } - it "Throws an error when an empty or null vpgName is specified" { - {Checkpoint-ZertoVpg -vpgName "" -checkpointName "MyCheckPoint"} | Should -Throw - {Checkpoint-ZertoVpg -vpgName $null -checkpointName "MyCheckPoint"} | Should -Throw + It "Throws an error when an empty or null vpgName is specified" { + { Checkpoint-ZertoVpg -vpgName "" -checkpointName "MyCheckPoint" } | Should -Throw + { Checkpoint-ZertoVpg -vpgName $null -checkpointName "MyCheckPoint" } | Should -Throw } - it "Does not support 'SupportsShouldProcess'" { - Get-Command $file.BaseName | Should -Not -HaveParameter WhatIf - Get-Command $file.BaseName | Should -Not -HaveParameter Confirm - $file | Should -Not -FileContentMatch 'SupportsShouldProcess' - $file | Should -Not -FileContentMatch '\$PSCmdlet\.ShouldProcess\(.+\)' + It "Does not support 'SupportsShouldProcess'" { + Get-Command $script:function | Should -Not -HaveParameter WhatIf + Get-Command $script:function | Should -Not -HaveParameter Confirm + $script:ScriptBlock | Should -not -match 'SupportsShouldProcess' + $script:ScriptBlock | Should -not -match '\$PSCmdlet\.ShouldProcess\(.+\)' } } - Context "$($file.BaseName)::Function Unit Tests" { + Context "$($script:function)::Function Unit Tests" { - it "should return a not null or empty string" { + It "should return a not null or empty string" { $results = Checkpoint-ZertoVpg -vpgName "MyVpg" -checkpointName "My Checkpoint Name" - $results | should -not -BeNullOrEmpty - $results | should -BeOfType "String" - $results | should -BeExactly "3b687246-ac63-40da-9a59-b99863769eb0.928a122b-1763-4664-ad37-cc00bb883f2f" + $results | Should -not -BeNullOrEmpty + $results | Should -BeOfType "String" + $results | Should -BeExactly "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a" + } + It "does not return anything when a invalid VPG is defined" { + $results = Checkpoint-ZertoVpg -vpgName "DoesNotExist" -checkpointName "My Checkpoint Name" + $results | Should -Be "Cannot find VPG named DoesNotExist. Please check the name and try again." } - Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest - Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Get-ZertoVpg + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -Exactly 2 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Get-ZertoVpg -Exactly 1 } -} \ No newline at end of file +} diff --git a/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 index 50d2f9d..fcfd65a 100644 --- a/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 +++ b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 @@ -1,19 +1,72 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$script:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { - - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 +Describe $script:function -Tag 'Unit', 'Source', 'Built' { + BeforeAll { + $script:ScriptBlock = (Get-Command $script:function).ScriptBlock } -} \ No newline at end of file + + Context "$($script:function)::Parameter Unit Tests" { + It "Has a parameter for the Required Credentials that is Mandatory" { + Get-Command $script:function | Should -HaveParameter credential -Mandatory -Type PSCredential + } + } + + + + Context "$($script:function)::Function Unit Tests" { + + InModuleScope -ModuleName ZertoApiWrapper { + Mock -CommandName Invoke-ZARestRequest { + return (Get-Content "$global:here\Mocks\ZAToken.json"-Raw | ConvertFrom-Json) + } + + $password = 'NotARealPassword' | ConvertTo-SecureString -AsPlainText -Force + $cred = New-Object pscredential('NotARealUser', $password) + + $results = Connect-ZertoAnalytics -credential $cred + + It "Creates a Script Level Hashtable Variable for the ZertoAnalytics Headers" { + $script:zaHeaders | Should -BeOfType Hashtable + } + + It "the ZertoAnalytics Headers variable contains 2 items" { + $script:zaHeaders.keys | Should -HaveCount 2 + } + + It "the ZertoAnalytics Headers variable has an 'Accept' key" { + $script:zaHeaders.keys | Should -Contain 'Accept' + } + + It "thh ZertoAnalytics headers variable 'Accept' key should be JSON" { + $script:zaHeaders['Accept'] | Should -match 'application/json' + } + + It "the ZertoAnalytics Headers variable has an 'Authorization' key" { + $script:zaHeaders.keys | Should -Contain 'Authorization' + } + + It "the ZertoAnalytics Headers variable 'Authorization' key should start with 'Bearer'" { + $script:zaHeaders['Authorization'] | Should -Match '^Bearer ' + } + + It "Creates a Script Level Variable for the LastActionTime" { + $script:zaLastActionTime | Should -BeOfType Long + } + + It "LastActionTime Variable should be in the past" { + $script:zaLastActionTime | Should -BeLessThan (Get-Date).Ticks + } + + It "Returns Header Information" { + $results | Should -not -BeNullOrEmpty + $results['Authorization'] | Should -MatchExactly 'Bearer N074r34l70k3n' + $results['Accept'] | Should -Match 'application/json' + } + } + + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZARestRequest -Exactly 1 + } + +} diff --git a/Tests/Public/Connect-ZertoServer.Tests.ps1 b/Tests/Public/Connect-ZertoServer.Tests.ps1 index 59c5e8b..de54536 100644 --- a/Tests/Public/Connect-ZertoServer.Tests.ps1 +++ b/Tests/Public/Connect-ZertoServer.Tests.ps1 @@ -1,128 +1,94 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force -$userName = "zerto\build" -$password = ConvertTo-SecureString -String "ZertoBuild" -AsPlainText -Force -$credential = New-Object -TypeName System.Management.Automation.PSCredential($userName, $password) -$Server = "192.168.1.100" -$zertoPort = "7669" +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$script:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag Unit { - - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 +Describe $script:function -Tag 'Unit', 'Source', 'Built' { + BeforeAll { + $script:ScriptBlock = (Get-Command $script:function).ScriptBlock } - Context "$($file.BaseName)::Parameter Unit Tests" { + Context "$($script:function)::Parameter Unit Tests" { - it "server vairable has a mandatory String parameter" { - Get-Command $file.BaseName | Should -HaveParameter zertoserver -Mandatory -Type String + It "server vairable has a mandatory String parameter" { + Get-Command $script:function | Should -HaveParameter zertoserver -Mandatory -Type String } - it "server variable does not accecpt an empty or null input" { - {Connect-ZertoServer -zertoServer $null -credential $credential} | Should -Throw - {Connect-ZertoServer -zertoServer "" -credential $credential} | Should -Throw + It "server variable does not accecpt an empty or null input" { + { Connect-ZertoServer -zertoServer $null -credential $credential } | Should -Throw + { Connect-ZertoServer -zertoServer "" -credential $credential } | Should -Throw } - it "port variable has a non-mandatory String parameter" { - Get-Command $file.BaseName | Should -HaveParameter zertoPort -Not -Mandatory - Get-Command $file.BaseName | Should -HaveParameter zertoPort -Type String - Get-Command $file.BaseName | Should -HaveParameter zertoPort -DefaultValue "9669" + It "port variable has a non-mandatory String parameter" { + Get-Command $script:function | Should -HaveParameter zertoPort -Not -Mandatory + Get-Command $script:function | Should -HaveParameter zertoPort -Type String + Get-Command $script:function | Should -HaveParameter zertoPort -DefaultValue "9669" } - it "port variable does not accecpt an empty or null input" { - {Connect-ZertoServer -zertoServer "192.168.1.100" -zertoPort "" -credential $credential} | Should -Throw - {Connect-ZertoServer -zertoServer "192.168.1.100" -zertoPort $null -credential $credential} | Should -Throw + It "port variable does not accecpt an empty or null input" { + { Connect-ZertoServer -zertoServer "192.168.1.100" -zertoPort "" -credential $credential } | Should -Throw + { Connect-ZertoServer -zertoServer "192.168.1.100" -zertoPort $null -credential $credential } | Should -Throw } - it "port variable should fall between 1024 and 65535" { - {Connect-ZertoServer -zertoServer $Server -zertoPort 1023 -credential $credential} | Should -Throw - {Connect-ZertoServer -zertoServer $Server -zertoPort 65536 -credential $credential} | Should -Throw - {Connect-ZertoServer -zertoServer $Server -zertoPort 0 -credential $credential} | Should -Throw - {Connect-ZertoServer -zertoServer $Server -zertoPort -1 -credential $credential} | Should -Throw + It "port variable should fall between 1024 and 65535" { + { Connect-ZertoServer -zertoServer $Server -zertoPort 1023 -credential $credential } | Should -Throw + { Connect-ZertoServer -zertoServer $Server -zertoPort 65536 -credential $credential } | Should -Throw + { Connect-ZertoServer -zertoServer $Server -zertoPort 0 -credential $credential } | Should -Throw + { Connect-ZertoServer -zertoServer $Server -zertoPort -1 -credential $credential } | Should -Throw } - it "has a mandatory PSCredential parameter for the credential vairable" { - Get-Command $file.BaseName | Should -HaveParameter credential -Mandatory -Type PSCredential + It "has a mandatory PSCredential parameter for the credential vairable" { + Get-Command $script:function | Should -HaveParameter credential -Mandatory -Type PSCredential } - it "should require a PSCredentialObject for the credentials" { - {Connect-ZertoServer -zertoServer -credential "MyUsername"} | Should -Throw - {Connect-ZertoServer -zertoServer -credential 1234} | Should -Throw - {Connect-ZertoServer -zertoServer -credential $(@{Username = "zerto\build"; Password = 'SecureString'})} | Should -Throw + It "should require a PSCredentialObject for the credentials" { + { Connect-ZertoServer -zertoServer -credential "MyUsername" } | Should -Throw + { Connect-ZertoServer -zertoServer -credential 1234 } | Should -Throw + { Connect-ZertoServer -zertoServer -credential $(@{Username = "zerto\build"; Password = 'SecureString' }) } | Should -Throw } } - InModuleScope ZertoApiWrapper { - Context "$($file.BaseName)::InModuleScope Function Unit Tests" { + InModuleScope -ModuleName ZertoApiWrapper { + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest { + # Attempted to Mock this per the Mock Below and it blew up. Auth Headers Returns a Dictionary + # and does not index the same way when imported from a JSON file. Need addtional investigation. + $xZertoSession = @("e34da0b0-4bc2-4cda-b316-0384e35bdca5") + $Headers = @{'x-zerto-session' = $xZertoSession } + $results = @{'Headers' = $Headers } + return $results + } - $server = '192.168.1.100' - $userName = "zerto\build" - $password = ConvertTo-SecureString -String "ZertoBuild" -AsPlainText -Force - $credential = New-Object -TypeName System.Management.Automation.PSCredential($userName, $password) + Mock -ModuleName ZertoApiWrapper -CommandName Get-ZertoLocalSite { + return (Get-Content -Path "$global:here\Mocks\LocalSiteInfo.json" -Raw | ConvertFrom-Json) + } + Context "$($script:function)::InModuleScope Function Unit Tests" { - Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest { - $xZertoSession = @("7ecf544d-e7ed-4108-86f3-fb355c51cdfa") - $Headers = @{'x-zerto-session' = $xZertoSession} - $results = @{'Headers' = $Headers} - return $results + BeforeAll { + $server = '192.168.1.100' + $password = ConvertTo-SecureString -String "NotARealPassword" -AsPlainText -Force + $credential = New-Object pscredential('NotARealUser', $password) + $now = $(Get-Date).ticks + Connect-ZertoServer -zertoServer $server -credential $credential } - Mock -ModuleName ZertoApiWrapper -CommandName Get-ZertoLocalSite { - $results = @{ - BandwidthThrottlingInMBs = -1 - ContactEmail = "vSphere-Site01@zerto.com" - ContactName = "vSphere-Site01@zerto.com" - ContactPhone = "066-6666666" - IpAddress = "192.168.200.1" - IsReplicationToSelfEnabled = $True - Link = @{ - href = "https://192.168.24.1:7669/v1/localsite" - identifier = "928a122b-1763-4664-ad37-cc00bb883f2f" - rel = $null - type = "LocalSiteApi" - } - Location = "vSphere-Site01" - SiteName = "vSphere-Site01 at Zerto" - SiteType = "VCenter" - UtcOffsetInMinutes = -240 - Version = "7.0.0" - SiteIdentifier = "928a122b-1763-4664-ad37-cc00bb883f2f" - } - return $results - } - - $now = $(Get-Date).ticks - Connect-ZertoServer -zertoServer $server -credential $credential - - it "Module Scope zvmServer variable tests" { + It "Module Scope zvmServer variable tests" { $script:zvmServer | Should -Not -BeNullOrEmpty $script:zvmServer | Should -Be $server } - it "Module Scope zvmPort variable tests" { + It "Module Scope zvmPort variable tests" { $script:zvmPort | Should -Not -BeNullOrEmpty $script:zvmPort | Should -Be '9669' } - it "Module Scope zvmLastAction variable tests" { + It "Module Scope zvmLastAction variable tests" { $script:zvmLastAction | Should -Not -BeNullOrEmpty $script:zvmLastAction | Should -BeGreaterOrEqual $now } - it "Module Scope zvmHeaders variable tests" { + It "Module Scope zvmHeaders variable tests" { $script:zvmHeaders | Should -Not -BeNullOrEmpty - $script:zvmHeaders | Should -BeOfType Hashtable + $script:zvmHeaders | Should -BeOfType PSCustomObject $script:zvmHeaders.keys.count | Should -BeExactly 2 $script:zvmHeaders.ContainsKey('x-zerto-session') | Should -BeTrue $script:zvmHeaders.ContainsKey('Accept') | Should -BeTrue @@ -130,74 +96,45 @@ Describe $file.BaseName -Tag Unit { $script:zvmHeaders['Accept'] | Should -BeOfType String } - it "Module Scope zvmLocalInfo variable tests" { + It "Module Scope zvmLocalInfo variable tests" { $script:zvmLocalInfo | Should -Not -BeNullOrEmpty - $script:zvmLocalInfo | Should -BeOfType Hashtable - $script:zvmLocalInfo['SiteIdentifier'] | Should -BeOfType String - $script:zvmLocalInfo.ContainsKey('SiteIdentifier') | Should -BeTrue - $script:zvmLocalInfo['SiteIdentifier'] | Should -BeOfType String + $script:zvmLocalInfo | Should -BeOfType PSCustomObject + $script:zvmLocalInfo.SiteIdentifier | Should -BeOfType String } $headers = Connect-ZertoServer -zertoServer $Server -credential $credential -returnHeaders - it "returns a Hashtable with 2 keys" { + It "returns a Hashtable with 2 keys" { $headers | Should -BeOfType Hashtable - $headers.keys.count | should be 2 + $headers.keys.count | Should be 2 } - it "return value has a key called 'x-zerto-session'" { - $headers.ContainsKey('x-zerto-session') | should be $true + It "return value has a key called 'x-zerto-session'" { + $headers.ContainsKey('x-zerto-session') | Should be $true } - it "return key 'x-zerto-session' value should be a string" { - $headers['x-zerto-session'] | should -BeOfType "String" - $headers['x-zerto-session'] | Should -BeExactly "7ecf544d-e7ed-4108-86f3-fb355c51cdfa" + It "return key 'x-zerto-session' value should be a string" { + $headers['x-zerto-session'] | Should -BeOfType "String" + $headers['x-zerto-session'] | Should -BeExactly "e34da0b0-4bc2-4cda-b316-0384e35bdca5" } - it "return value has a key called 'accept'" { - $headers.ContainsKey('accept') | should be $true + It "return value has a key called 'accept'" { + $headers.ContainsKey('accept') | Should be $true } - it "return key 'accept' value should be 'application/json'" { - $headers['accept'] | should be 'application/json' + It "return key 'accept' value should be 'application/json'" { + $headers['accept'] | Should be 'application/json' } - it "should not require a port to be specified" { + It "should not require a port to be specified" { Connect-ZertoServer -zertoServer $Server -credential $credential } - it "returns null when -ReturnHeaders is not used" { + It "returns null when -ReturnHeaders is not used" { Connect-ZertoServer -zertoServer $Server -credential $credential | Should -BeNullOrEmpty } - Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest - Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Get-ZertoLocalSite + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -Exactly 4 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Get-ZertoLocalSite -Exactly 4 } } } -<# -Describe "Connect-ZertoServer" -Tag Integration { - it "file should exist" { - "$filePath\$fileName" | should exist - } - it "has a function called Connect-ZertoServer" { - get-command Connect-ZertoServer | should be $true - } - $headers = Connect-ZertoServer -zertoServer $Server -zertoPort $zertoPort -credential $credential -returnHeaders - it "returns a Hashtable with 2 keys" { - $headers.keys.count | should be 2 - } - it "return value has a key called 'x-zerto-session'" { - $headers.ContainsKey('x-zerto-session') | should be $true - } - it "return key 'x-zerto-session' value should be a string" { - $headers['x-zerto-session'].gettype().name | should be "String" - } - it "return value has a key called 'accept'" { - $headers.ContainsKey('accept') | should be $true - } - it "return key 'accept' value should be 'application/json'" { - $headers['accept'] | should be 'application/json' - } - Disconnect-ZertoServer -} - #> diff --git a/Tests/Public/Disconnect-ZertoServer.Tests.ps1 b/Tests/Public/Disconnect-ZertoServer.Tests.ps1 index 5be178d..9b0c57b 100644 --- a/Tests/Public/Disconnect-ZertoServer.Tests.ps1 +++ b/Tests/Public/Disconnect-ZertoServer.Tests.ps1 @@ -1,37 +1,40 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force - -Describe $file.BaseName -Tag 'Unit' { - Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest { - $null - } - Mock -ModuleName ZertoApiWrapper -CommandName Remove-Variable { +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$script:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +Describe $script:function -Tag 'Unit', 'Source', 'Built' { + BeforeAll { + $script:ScriptBlock = (Get-Command $script:function).ScriptBlock } - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 - } - - Context "$($file.BaseName)::Parameter Unit Tests" { + Context "$($script:function)::Parameter Unit Tests" { it "Does not take any parameters" { (get-command disconnect-zertoserver).parameters.count | Should -BeExactly 11 } } - Context "$($file.BaseName)::Function Unit Tests" { - it "Does not return anything" { - Disconnect-ZertoServer | Should -BeNullOrEmpty + Context "$($script:function)::Function Unit Tests" { + InModuleScope -ModuleName ZertoApiWrapper { + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest { + # Attempted to Mock this per the Mock Below and it blew up. Auth Headers Returns a Dictionary + # and does not index the same way when imported from a JSON file. Need addtional investigation. + $xZertoSession = @("e34da0b0-4bc2-4cda-b316-0384e35bdca5") + $Headers = @{'x-zerto-session' = $xZertoSession } + $results = @{'Headers' = $Headers } + return $results + } + + Mock -ModuleName ZertoApiWrapper -CommandName Get-ZertoLocalSite { + return (Get-Content -Path "$global:here\Mocks\LocalSiteInfo.json" -Raw | ConvertFrom-Json) + } + + BeforeAll { + Connect-ZertoServer + } + + It "Does not return anything" { + Disconnect-ZertoServer | Should -BeNullOrEmpty + } } } } From f1afbe6748d133d6f6f5b2b103575d07bf70a4b1 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 14 Jul 2019 20:34:26 -0400 Subject: [PATCH 147/479] Create private helper function New-Map --- Tests/Private/New-Map.Tests.ps1 | 70 +++++++++++++++++++++++++++++ ZertoApiWrapper/Private/New-Map.ps1 | 21 +++++++++ 2 files changed, 91 insertions(+) create mode 100644 Tests/Private/New-Map.Tests.ps1 create mode 100644 ZertoApiWrapper/Private/New-Map.ps1 diff --git a/Tests/Private/New-Map.Tests.ps1 b/Tests/Private/New-Map.Tests.ps1 new file mode 100644 index 0000000..6134a02 --- /dev/null +++ b/Tests/Private/New-Map.Tests.ps1 @@ -0,0 +1,70 @@ +#Requires -Modules Pester +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] + +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + InModuleScope -ModuleName ZertoApiWrapper { + Context "$global:function::Parameter Unit Tests" { + it "have a mandatory parameter for the Input Object" { + Get-Command $global:function | Should -HaveParameter InputObject -Mandatory -Type PSCustomObject + } + + it "Input Object should not accecpt a Null or Empty value" { + $myObj = [PSCustomObject]@{ } + { New-Map -InputObject $myObj -Key "Key" -Value "Value" } | Should Throw + { New-Map -InputObject $null -Key "Key" -Value "Value" } | Should Throw + { New-Map -InputObject "" -Key "Key" -Value "Value" } | Should Throw + } + + it "have a mandatory string parameter for the Map Key" { + Get-Command $global:function | Should -HaveParameter Key -Mandatory -Type String + } + + it "The Map variable should not accecpt a Null or Empty value" { + $myObj = [PSCustomObject]@{one = 1; two = 2 } + { New-Map -InputObject $myObj -Key "" -Value "Value" } | Should Throw + { New-Map -InputObject $null -Key $null -Value "Value" } | Should Throw + { New-Map -InputObject $myObj -Key 1 -Value "Value" } | Should Throw + } + + it "The Value variable should not accecpt a Null or Empty value" { + $myObj = [PSCustomObject]@{one = 1; two = 2 } + { New-Map -InputObject $myObj -Key "Key" -Value "" } | Should Throw + { New-Map -InputObject $myObj -Key "Key" -Value $null } | Should Throw + { New-Map -InputObject $myObj -Key "Key" -Value 1 } | Should Throw + } + + it "have a mandatory string parameter for the Map Value" { + Get-Command $global:function | Should -HaveParameter Value -Mandatory -Type String + } + + it "should have an Output type of Hashtable" { + (Get-Command $global:function).OutputType.Name | Should -Match "Hashtable" + } + } + + Context "$global:function::Function Tests" { + $myObj = Get-Content "$global:here/Mocks/ProtectedVMs.json" | ConvertFrom-Json + BeforeEach { + $MyMap = New-Map -InputObject $MyObj -Key "vmIdentifier" -Value "vmName" + } + it "Returned object should be a hashtable" { + $myMap | Should -BeOfType Hashtable + } + + it "should return a hashtable with 3 entries" { + $myMap.count | should -Be 3 + } + + it "should be properly mapped" { + $myMap["vmid.12"] | Should -Be "ExchangeMailbox" + $myMap["vmid.13"] | Should -Be "ExchangeApplication" + $myMap["vmid.14"] | Should -Be "ExchangeWeb" + } + } + } +} + +Remove-Variable -Name function -Scope Global +Remove-Variable -Name here -Scope Global diff --git a/ZertoApiWrapper/Private/New-Map.ps1 b/ZertoApiWrapper/Private/New-Map.ps1 new file mode 100644 index 0000000..085078d --- /dev/null +++ b/ZertoApiWrapper/Private/New-Map.ps1 @@ -0,0 +1,21 @@ +function New-Map { + [CmdletBinding()] + [OutputType([Hashtable])] + param( + [Parameter(Mandatory)] + [ValidateNotNullOrEmpty()] + $inputObject, + [Parameter(Mandatory)] + [ValidateNotNullOrEmpty()] + [string]$key, + [Parameter(Mandatory)] + [ValidateNotNullOrEmpty()] + [string]$value + ) + + $returnMap = @{ } + foreach ($item in $inputObject) { + $returnMap[$item.$key] = $item.$value + } + $returnMap +} From 4fee466cc8a2d4407bc0a952734e0b5ad7e8071d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 14 Jul 2019 20:34:53 -0400 Subject: [PATCH 148/479] Add Mocks for New-Map --- Tests/Private/Mocks/ProtectedVMs.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Tests/Private/Mocks/ProtectedVMs.json diff --git a/Tests/Private/Mocks/ProtectedVMs.json b/Tests/Private/Mocks/ProtectedVMs.json new file mode 100644 index 0000000..cf4924b --- /dev/null +++ b/Tests/Private/Mocks/ProtectedVMs.json @@ -0,0 +1,15 @@ +[ + { + "VMname": "ExchangeMailbox", + "VMIdentifier": "vmid.12" + }, + { + "VMName": "ExchangeApplication", + "VmIdentifier": "vmid.13" + }, + { + "VMName": "ExchangeWeb", + "VmIdentifier": "vmid.14" + } +] + From dd144d3c477dc038d61be9ead38fe670ac1b9565 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 14 Jul 2019 20:35:47 -0400 Subject: [PATCH 149/479] Update to use New-Map helper function --- ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 | 10 ++-------- ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 b/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 index 6846145..6de8852 100644 --- a/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 +++ b/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 @@ -38,18 +38,12 @@ function Export-ZertoVmNicSetting { } $nicSettings = foreach ($group in $vpgs) { $protectedVms = Get-ZertoProtectedVm -vpgName ($group.vpgname) - $vmMap = @{ } - foreach ($vm in $protectedVms) { - $vmMap["$($vm.vmIdentifier)"] = $vm.vmName - } + $vmMap = New-Map -InputObject $protectedVms -key "vmIdentifier" -value "vmName" $settingsId = New-ZertoVpgSettingsIdentifier -vpgIdentifier $group.vpgIdentifier $vmSettings = Get-ZertoVpgSetting -vpgSettingsIdentifier $settingsId -vms $networks = Get-ZertoVirtualizationSite -siteIdentifier $group.RecoverySite.identifier -networks $null = Remove-ZertoVpgSettingsIdentifier -vpgSettingsIdentifier $settingsId - $networkMap = @{ } - foreach ($network in $networks) { - $networkMap[$network.NetworkIdentifier] = $network.VirtualizationNetworkName - } + $networkMap = New-Map -InputObject $networks -key "NetworkIdentifier" -value "VirtualizationNetworkName" foreach ($vm in $vmSettings) { $nicInfo = [PSCustomObject]@{ VPGName = $group.VPGName diff --git a/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 b/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 index 8a24dec..3cdf766 100644 --- a/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 +++ b/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 @@ -31,15 +31,9 @@ function Import-ZertoVmNicSetting { $VpgInfo = Get-ZertoVpg -vpgName $Vpg $VpgIdentifier = $VpgInfo.VpgIdentifier $RecoveryNetworks = Get-ZertoVirtualizationSite -siteIdentifier $VpgInfo.RecoverySite.Identifier -networks - $NetworkMap = @{ } - foreach ($Network in $RecoveryNetworks) { - $NetworkMap[$Network.VirtualizationNetworkName] = $Network.NetworkIdentifier - } + $NetworkMap = New-Map -InputObject $RecoveryNetworks -key "VirtualizationNetworkName" -value "NetworkIdentifier" $VpgVms = Get-ZertoProtectedVm -vpgName $Vpg - $VmMap = @{ } - foreach ($Vm in $VpgVms) { - $VmMap[$Vm.vmName] = $Vm.vmIdentifier - } + $VmMap = New-Map -InputObject $VpgVms -key "vmName" -value "vmIdentifier" $VpgSettingsId = New-ZertoVpgSettingsIdentifier -vpgIdentifier $VpgIdentifier $VmsToUpdate = $ImportData | Where-Object { $_.VPGName -eq $Vpg } foreach ($vm in $VmsToUpdate) { From 235434fe2042fecd7f0b5780d06e8b768d40ec98 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 14 Jul 2019 20:36:32 -0400 Subject: [PATCH 150/479] Update function to global variable --- Tests/Public/Add-ZertoPeerSite.Tests.ps1 | 17 +++++++------- Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 | 21 +++++++++-------- Tests/Public/Connect-ZertoAnalytics.Tests.ps1 | 15 +++++++----- Tests/Public/Connect-ZertoServer.Tests.ps1 | 23 +++++++++++-------- Tests/Public/Disconnect-ZertoServer.Tests.ps1 | 13 +++++++---- 5 files changed, 51 insertions(+), 38 deletions(-) diff --git a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 index 39fd439..35927f8 100644 --- a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 @@ -1,16 +1,16 @@ #Requires -Modules Pester $global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$script:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $script:function -Tag 'Unit', 'Source', 'Built' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { - $script:ScriptBlock = (Get-Command $script:function).ScriptBlock + $script:ScriptBlock = (Get-Command $global:function).ScriptBlock } - Context "$script:function::Parameter Unit Tests" { + Context "$global:function::Parameter Unit Tests" { It "Has a mandatory string parameter for the target host" { - Get-Command $script:function | Should -HaveParameter TargetHost -Mandatory -Type String + Get-Command $global:function | Should -HaveParameter TargetHost -Mandatory -Type String } It "Will not take a non-ip address as a 'TargetHost'" { @@ -40,8 +40,8 @@ Describe $script:function -Tag 'Unit', 'Source', 'Built' { } It "Supports 'SupportsShouldProcess'" { - Get-Command $script:function | Should -HaveParameter WhatIf - Get-Command $script:function | Should -HaveParameter Confirm + Get-Command $global:function | Should -HaveParameter WhatIf + Get-Command $global:function | Should -HaveParameter Confirm $script:ScriptBlock | Should -match 'SupportsShouldProcess' $script:ScriptBlock | Should -match '\$PSCmdlet\.ShouldProcess\(.+\)' } @@ -67,4 +67,5 @@ Describe $script:function -Tag 'Unit', 'Source', 'Built' { Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -Exactly 1 } } - +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 b/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 index 3cc79e4..f580a6f 100644 --- a/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 @@ -1,10 +1,10 @@ #Requires -Modules Pester $global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$script:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $script:function -Tag 'Unit', 'Source', 'Built' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { - $script:ScriptBlock = (Get-Command $script:function).ScriptBlock + $script:ScriptBlock = (Get-Command $global:function).ScriptBlock } Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest { @@ -14,13 +14,13 @@ Describe $script:function -Tag 'Unit', 'Source', 'Built' { return (Get-Content "$global:here\Mocks\VPGInfo.json" -Raw | ConvertFrom-Json) } - Context "$($script:function)::Parameter Unit Tests" { + Context "$($global:function)::Parameter Unit Tests" { It "Has a parameter for the VpgName that is Mandatory" { - Get-Command $script:function | Should -HaveParameter vpgName -Mandatory -Type String + Get-Command $global:function | Should -HaveParameter vpgName -Mandatory -Type String } It "Has a parameter for the CheckpointName that is Mandatory" { - Get-Command $script:function | Should -HaveParameter CheckpointName -Mandatory -Type String + Get-Command $global:function | Should -HaveParameter CheckpointName -Mandatory -Type String } It "Throws and error when an empty or null checkpointName is specified" { @@ -34,14 +34,14 @@ Describe $script:function -Tag 'Unit', 'Source', 'Built' { } It "Does not support 'SupportsShouldProcess'" { - Get-Command $script:function | Should -Not -HaveParameter WhatIf - Get-Command $script:function | Should -Not -HaveParameter Confirm + Get-Command $global:function | Should -Not -HaveParameter WhatIf + Get-Command $global:function | Should -Not -HaveParameter Confirm $script:ScriptBlock | Should -not -match 'SupportsShouldProcess' $script:ScriptBlock | Should -not -match '\$PSCmdlet\.ShouldProcess\(.+\)' } } - Context "$($script:function)::Function Unit Tests" { + Context "$($global:function)::Function Unit Tests" { It "should return a not null or empty string" { $results = Checkpoint-ZertoVpg -vpgName "MyVpg" -checkpointName "My Checkpoint Name" @@ -58,3 +58,6 @@ Describe $script:function -Tag 'Unit', 'Source', 'Built' { Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Get-ZertoVpg -Exactly 1 } } + +Remove-Variable -Name function -Scope Global +Remove-Variable -Name here -Scope Global diff --git a/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 index fcfd65a..661e985 100644 --- a/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 +++ b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 @@ -1,21 +1,21 @@ #Requires -Modules Pester $global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$script:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $script:function -Tag 'Unit', 'Source', 'Built' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { - $script:ScriptBlock = (Get-Command $script:function).ScriptBlock + $script:ScriptBlock = (Get-Command $global:function).ScriptBlock } - Context "$($script:function)::Parameter Unit Tests" { + Context "$($global:function)::Parameter Unit Tests" { It "Has a parameter for the Required Credentials that is Mandatory" { - Get-Command $script:function | Should -HaveParameter credential -Mandatory -Type PSCredential + Get-Command $global:function | Should -HaveParameter credential -Mandatory -Type PSCredential } } - Context "$($script:function)::Function Unit Tests" { + Context "$($global:function)::Function Unit Tests" { InModuleScope -ModuleName ZertoApiWrapper { Mock -CommandName Invoke-ZARestRequest { @@ -70,3 +70,6 @@ Describe $script:function -Tag 'Unit', 'Source', 'Built' { } } + +Remove-Variable -Name function -Scope Global +Remove-Variable -Name here -Scope Global diff --git a/Tests/Public/Connect-ZertoServer.Tests.ps1 b/Tests/Public/Connect-ZertoServer.Tests.ps1 index de54536..1cdc5b6 100644 --- a/Tests/Public/Connect-ZertoServer.Tests.ps1 +++ b/Tests/Public/Connect-ZertoServer.Tests.ps1 @@ -1,16 +1,16 @@ #Requires -Modules Pester $global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$script:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $script:function -Tag 'Unit', 'Source', 'Built' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { - $script:ScriptBlock = (Get-Command $script:function).ScriptBlock + $script:ScriptBlock = (Get-Command $global:function).ScriptBlock } - Context "$($script:function)::Parameter Unit Tests" { + Context "$($global:function)::Parameter Unit Tests" { It "server vairable has a mandatory String parameter" { - Get-Command $script:function | Should -HaveParameter zertoserver -Mandatory -Type String + Get-Command $global:function | Should -HaveParameter zertoserver -Mandatory -Type String } It "server variable does not accecpt an empty or null input" { @@ -19,9 +19,9 @@ Describe $script:function -Tag 'Unit', 'Source', 'Built' { } It "port variable has a non-mandatory String parameter" { - Get-Command $script:function | Should -HaveParameter zertoPort -Not -Mandatory - Get-Command $script:function | Should -HaveParameter zertoPort -Type String - Get-Command $script:function | Should -HaveParameter zertoPort -DefaultValue "9669" + Get-Command $global:function | Should -HaveParameter zertoPort -Not -Mandatory + Get-Command $global:function | Should -HaveParameter zertoPort -Type String + Get-Command $global:function | Should -HaveParameter zertoPort -DefaultValue "9669" } It "port variable does not accecpt an empty or null input" { @@ -37,7 +37,7 @@ Describe $script:function -Tag 'Unit', 'Source', 'Built' { } It "has a mandatory PSCredential parameter for the credential vairable" { - Get-Command $script:function | Should -HaveParameter credential -Mandatory -Type PSCredential + Get-Command $global:function | Should -HaveParameter credential -Mandatory -Type PSCredential } It "should require a PSCredentialObject for the credentials" { @@ -61,7 +61,7 @@ Describe $script:function -Tag 'Unit', 'Source', 'Built' { return (Get-Content -Path "$global:here\Mocks\LocalSiteInfo.json" -Raw | ConvertFrom-Json) } - Context "$($script:function)::InModuleScope Function Unit Tests" { + Context "$($global:function)::InModuleScope Function Unit Tests" { BeforeAll { $server = '192.168.1.100' @@ -138,3 +138,6 @@ Describe $script:function -Tag 'Unit', 'Source', 'Built' { } } } + +Remove-Variable -Name function -Scope Global +Remove-Variable -Name here -Scope Global diff --git a/Tests/Public/Disconnect-ZertoServer.Tests.ps1 b/Tests/Public/Disconnect-ZertoServer.Tests.ps1 index 9b0c57b..4fe92ac 100644 --- a/Tests/Public/Disconnect-ZertoServer.Tests.ps1 +++ b/Tests/Public/Disconnect-ZertoServer.Tests.ps1 @@ -1,19 +1,19 @@ #Requires -Modules Pester $global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$script:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $script:function -Tag 'Unit', 'Source', 'Built' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { - $script:ScriptBlock = (Get-Command $script:function).ScriptBlock + $script:ScriptBlock = (Get-Command $global:function).ScriptBlock } - Context "$($script:function)::Parameter Unit Tests" { + Context "$($global:function)::Parameter Unit Tests" { it "Does not take any parameters" { (get-command disconnect-zertoserver).parameters.count | Should -BeExactly 11 } } - Context "$($script:function)::Function Unit Tests" { + Context "$($global:function)::Function Unit Tests" { InModuleScope -ModuleName ZertoApiWrapper { Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest { # Attempted to Mock this per the Mock Below and it blew up. Auth Headers Returns a Dictionary @@ -38,3 +38,6 @@ Describe $script:function -Tag 'Unit', 'Source', 'Built' { } } } + +Remove-Variable -Name function -Scope Global +Remove-Variable -Name here -Scope Global From e6c5effe7cd911d2fb28abe7b01eed0214a2d89b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 15 Jul 2019 11:48:13 -0400 Subject: [PATCH 151/479] Specify InputObject Type --- ZertoApiWrapper/Private/New-Map.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Private/New-Map.ps1 b/ZertoApiWrapper/Private/New-Map.ps1 index 085078d..b84ea9d 100644 --- a/ZertoApiWrapper/Private/New-Map.ps1 +++ b/ZertoApiWrapper/Private/New-Map.ps1 @@ -4,7 +4,7 @@ function New-Map { param( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] - $inputObject, + [PSCustomObject]$inputObject, [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string]$key, From 19b645bccc1ac38d7ba7f3ad2fa511976ab5d3b9 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 15 Jul 2019 11:48:47 -0400 Subject: [PATCH 152/479] Exclude Common Parameters in Filter String --- .../Private/Get-ZertoApiFilter.ps1 | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/ZertoApiWrapper/Private/Get-ZertoApiFilter.ps1 b/ZertoApiWrapper/Private/Get-ZertoApiFilter.ps1 index a6400ca..c4253ca 100644 --- a/ZertoApiWrapper/Private/Get-ZertoApiFilter.ps1 +++ b/ZertoApiWrapper/Private/Get-ZertoApiFilter.ps1 @@ -1,22 +1,41 @@ function Get-ZertoApiFilter { [cmdletbinding()] + [Outputtype([String])] param( [Parameter( Mandatory = $true, HelpMessage = "Hashtable that contains filter keys and values" )] + [ValidateNotNullOrEmpty()] [hashtable]$filterTable ) # Define the start of the return string [string]$returnString = "?" - + $commonParameters = @( + "Debug" + "ErrorAction" + "ErrorVariable" + "InformationAction" + "InformationVariable" + "OutVariable" + "OutBuffer" + "PipelineVariable" + "Verbose" + "WarningAction" + "WarningVariable" + "WhatIf" + "Confirm" + ) #Foreach item in the table, process each item foreach ( $key in $filterTable.Keys ) { - #If this is not the first item added to the string, add the ampersand and filter - if ($returnString.Length -gt 1) { - $returnString = "{0}&{1}={2}" -f $returnString, $key, $filterTable[$key] - } else { - #If it is the first item, just add the first item - $returnString = "{0}{1}={2}" -f $returnString, $key, $filterTable[$key] + # If the key is not a common parameter, process it. + if ($key -notin $commonParameters) { + #If this is not the first item added to the string, add the ampersand and filter + if ($returnString.Length -gt 1) { + $returnString = "{0}&{1}={2}" -f $returnString, $key, $filterTable[$key] + } else { + #If it is the first item, just add the first item + $returnString = "{0}{1}={2}" -f $returnString, $key, $filterTable[$key] + } } } # Return the built query String From d7ee3eab122d4a07e3c032c0acba54fbabb50a65 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 15 Jul 2019 15:30:54 -0400 Subject: [PATCH 153/479] Updating Formatting --- ZertoApiWrapper/Private/Get-ZertoApiFilter.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Private/Get-ZertoApiFilter.ps1 b/ZertoApiWrapper/Private/Get-ZertoApiFilter.ps1 index c4253ca..25b52e9 100644 --- a/ZertoApiWrapper/Private/Get-ZertoApiFilter.ps1 +++ b/ZertoApiWrapper/Private/Get-ZertoApiFilter.ps1 @@ -2,7 +2,8 @@ function Get-ZertoApiFilter { [cmdletbinding()] [Outputtype([String])] param( - [Parameter( Mandatory = $true, + [Parameter( + Mandatory = $true, HelpMessage = "Hashtable that contains filter keys and values" )] [ValidateNotNullOrEmpty()] From 562d1210e6665a539c0f4d641875f688d4dcf1b4 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 15 Jul 2019 15:31:44 -0400 Subject: [PATCH 154/479] Update Tests for Mutlirun --- Tests/Private/Get-ZertoApiFilter.Tests.ps1 | 89 ++++++++++++++++------ 1 file changed, 65 insertions(+), 24 deletions(-) diff --git a/Tests/Private/Get-ZertoApiFilter.Tests.ps1 b/Tests/Private/Get-ZertoApiFilter.Tests.ps1 index 92af238..8217b49 100644 --- a/Tests/Private/Get-ZertoApiFilter.Tests.ps1 +++ b/Tests/Private/Get-ZertoApiFilter.Tests.ps1 @@ -1,30 +1,71 @@ -$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper' -$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.' -$file = Get-ChildItem "$filePath\$fileName" +#Requires -Modules Pester +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -. $file.FullName -$singleBoolItemTest = @{"BoolItem" = $True} -$oneItemTest = @{"OneItem" = "Test"} -$twoItemTest = @{"OneItem" = "Test"; "SecondItem" = "Yours"} -$boolItemTest = @{"OneItem" = "Test"; "BoolItem" = $true} +Describe $global:function -Tag 'Unit', 'Source', 'Built' { -Describe $file.BaseName -Tag Unit { - it "file should exist" { - $file.Fullname | should exist - } + InModuleScope -ModuleName ZertoApiWrapper { + Context "$global:function::Parameter Unit Tests" { + It "has a mandatory hashtable parameter for the filterTable" { + Get-Command $global:function | Should -HaveParameter filterTable -Mandatory -Type Hashtable + } - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file.Fullname -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 - } + It "FilterTable should not accecpt a Null or Empty parameter" { + { Get-ZertoApiFilter -filtertable (@{ }) } | Should Throw + { Get-ZertoApiFilter -filtertable "" } | Should Throw + { Get-ZertoApiFilter -filtertable $null } | Should Throw + } - it "converts bool to text" { - Get-ZertoApiFilter -filtertable $singleBoolItemTest | should -Be "?BoolItem=True" + it "should have an Output type of String" { + (Get-Command $global:function).OutputType.Name | Should -Match "String" + } + } + + Context "$global:function::Function Unit Tests" { + BeforeAll { + $singleBoolItemTest = @{"BoolItem" = $True } + $oneItemTest = @{ OneItem = "Test" } + $twoItemTest = @{ + OneItem = "Test" + SecondItem = "Yours" + } + $commonParamTest = @{ + Debug = $True + ErrorAction = "Stop" + ErrorVariable = "ErrVar" + InformationAction = "Continue" + InformationVariable = "InfoVar" + OutVariable = "OutVar" + OutBuffer = "OutBuff" + PipelineVariable = "PipeVar" + Verbose = $false + WarningAction = "SilentlyContinue" + WarningVariable = "WarnVar" + WhatIf = $True + Confirm = $false + OneItem = "Test" + } + } + + it "converts bool to text" { + Get-ZertoApiFilter -filtertable $singleBoolItemTest | should -Be "?BoolItem=True" + } + + it "one item test" { + Get-ZertoApiFilter -filtertable $oneItemTest | should be "?OneItem=Test" + } + + it "should ignore CommonParameters" { + Get-ZertoApiFilter -filtertable $commonParamTest | should be "?OneItem=Test" + } + + it "should process a filter table with more than one item" { + $returnString = Get-ZertoApiFilter -filtertable $twoItemTest + $returnString | Should -match "^\?" + $returnString | Should -match "&" + $returnString | Should -match "OneItem=Test" + $returnString | Should -match "SecondItem=Yours" + } + } } - it "one item test" { - Get-ZertoApiFilter -filtertable $oneItemTest | should be "?OneItem=Test" - } - #TODO:: Figure out multi-item tests } From db91acb7702e0f0cd3ace6c8a582f565086261d3 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 16 Jul 2019 14:11:01 -0400 Subject: [PATCH 155/479] remove global variables when complete --- Tests/Private/Get-ZertoApiFilter.Tests.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tests/Private/Get-ZertoApiFilter.Tests.ps1 b/Tests/Private/Get-ZertoApiFilter.Tests.ps1 index 8217b49..a4b5978 100644 --- a/Tests/Private/Get-ZertoApiFilter.Tests.ps1 +++ b/Tests/Private/Get-ZertoApiFilter.Tests.ps1 @@ -69,3 +69,6 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } } } + +Remove-Variable -Name function -Scope Global +Remove-Variable -Name here -Scope Global From 40326da05fd676f0f62ed53cdb02a45649e9a63e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 16 Jul 2019 14:16:06 -0400 Subject: [PATCH 156/479] Update to ThrowErrors when required vars missing --- ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 index 1e35829..de6869b 100644 --- a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 +++ b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 @@ -1,19 +1,23 @@ function Invoke-ZARestRequest { [cmdletbinding()] param( + # Parameter help description + [Parameter(Mandatory)] + [ValidateNotNullOrEmpty()] [string]$uri, + [ValidateSet("GET", "PUT", "POST", "DELETE")] [string]$method = "GET", + [ValidateNotNullOrEmpty()] [string]$body, + [ValidateNotNullOrEmpty()] [string]$contentType = "application/json" ) # Check to see if the required variables are present and currently valid if ( -not ((Test-Path variable:script:zaLastActionTime) -and (Test-Path variable:script:zaHeaders)) ) { - Write-Error -Message "Zerto Analytics Connection does not Exist. Please run Connect-ZertoAnalytics first to establish a connection" - break + ThrowError -ExceptionName "NoAuth" -ExceptionMessage "Zerto Analytics Connection does not Exist. Please run Connect-ZertoAnalytics first to establish a connection" -errorId "Auth02" -errorCategory "ZertoAuth" -ErrorAction Stop } elseif ( (Test-Path variable:script:zaHeaders) -and $([datetime]$script:zaLastActionTime).addMinutes(60) -lt $(get-date) ) { - Write-Error -Message "Authorization Token has Expired. Please re-authorize to the Zerto Analytics Portal" - break + ThrowError -ExceptionName "ExpiredToken" -ExceptionMessage "Authorization Token has Expired. Please re-authorize to the Zerto Analytics Portal" -errorId "Auth01" -errorCategory "ZertoAuth" -ErrorAction Stop } else { # Update the last action time and submit the request based on PS Version. Set-Variable -Name zaLastActionTime -Scope Script -Value $(Get-date).Ticks From 6b05af2db427d464cc56fc4944d658230bec4a52 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 16 Jul 2019 14:52:22 -0400 Subject: [PATCH 157/479] Update Invoke-ZARestRequest.Tests.ps1 --- Tests/Private/Invoke-ZARestRequest.Tests.ps1 | 106 ++++++++++++++++--- 1 file changed, 92 insertions(+), 14 deletions(-) diff --git a/Tests/Private/Invoke-ZARestRequest.Tests.ps1 b/Tests/Private/Invoke-ZARestRequest.Tests.ps1 index 984d682..b76f320 100644 --- a/Tests/Private/Invoke-ZARestRequest.Tests.ps1 +++ b/Tests/Private/Invoke-ZARestRequest.Tests.ps1 @@ -1,17 +1,95 @@ -$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper' -$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.' -$file = Get-ChildItem "$filePath\$fileName" -. $file.FullName +#Requires -Modules Pester +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag Unit { - it "file should exist" { - $file.FullName | should exist - } +Describe $global:function -Tag 'Unit', 'Source', 'Built' { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file.FullName -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 + InModuleScope -ModuleName ZertoApiWrapper { + + Context "$global:function::Parameter Unit Tests" { + + it "have a mandatory string parameter for the URI Variable" { + Get-Command Invoke-ZARestRequest | Should -HaveParameter uri -Mandatory -Type String + } + + it "have a non-mandatory string parameter for the Method Variable, default to 'GET'" { + Get-Command Invoke-ZARestRequest | Should -HaveParameter Method -Type String + Get-Command Invoke-ZARestRequest | Should -HaveParameter Method -Not -Mandatory + Get-Command Invoke-ZARestRequest | Should -HaveParameter Method -DefaultValue "GET" + } + + it "have a non-mandatory string parameter for the Body variable" { + Get-Command Invoke-ZARestRequest | Should -HaveParameter Body -Type String + Get-Command Invoke-ZARestRequest | Should -HaveParameter Body -Not -Mandatory + } + + it "have a non-mandatory string parameter for the contentType variable" { + Get-Command Invoke-ZARestRequest | Should -HaveParameter contentType -Type String + Get-Command Invoke-ZARestRequest | Should -HaveParameter contentType -Not -Mandatory + Get-Command Invoke-ZARestRequest | Should -HaveParameter contentType -DefaultValue "application/json" + } + + it "uri variable does not accecpt a null or empty variable" { + { Invoke-ZARestRequest -uri $null } | Should Throw + { Invoke-ZARestRequest -uri "" } | Should Throw + } + + it "method variable only accecpts 'GET' 'DELETE' 'PUT' 'POST' values" { + $parameterInfo = ( Get-Command Invoke-ZARestRequest ).Parameters['method'] + $parameterInfo.Attributes.Where{ $_ -is [ValidateSet] }.Count | Should -Be 1 + $validateSet = $parameterInfo.Attributes.Where{ $_ -is [ValidateSet] } + $validateSet.ValidValues -contains 'GET' | Should -BeTrue + $validateSet.ValidValues -contains 'PUT' | Should -BeTrue + $validateSet.ValidValues -contains 'POST' | Should -BeTrue + $validateSet.ValidValues -contains 'DELETE' | Should -BeTrue + $validateSet.ValidValues.Count | Should -Be 4 + } + + it "body variable does not accecpt a null or empty variable" { + { Invoke-ZARestRequest -uri "connect" -body $null } | Should Throw + { Invoke-ZARestRequest -uri "connect" -body "" } | Should Throw + } + + it "accecpt variable does not accecpt a null or empty variable" { + { Invoke-ZARestRequest -uri "connect" -accecpt $null } | Should Throw + { Invoke-ZARestRequest -uri "connect" -accecpt "" } | Should Throw + } + } + + Context "$global:function::Function Unit Tests" { + + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-RestMethod { + "Ran Command" + } + + BeforeEach { + Set-Variable -Name zaHeaders -Scope Script -Value (@{ "Accept" = "application/json" }) + Set-Variable -Name zaLastActionTime -Scope Script -Value $(Get-date).Ticks + } + + it "runs when called" { + Invoke-ZARestRequest -uri "myuri" | Should Be "Ran Command" + } + + it "throws when the last action was over 60 minutes ago" { + $script:zaLastActionTime = (get-date).AddMinutes(-61).Ticks + { Invoke-ZARestRequest -uri "myuri" } | Should Throw + } + + it "throws when the zaHeaders variable does not exits" { + Remove-Variable -Name zaHeaders -Scope Script + { Invoke-ZARestRequest -uri "myuri" } | Should Throw + } + + it "throws when the zaLastActionTime variable does not exits" { + Remove-Variable -Name zaLastActionTime -Scope Script + { Invoke-ZARestRequest -uri "myuri" } | Should Throw + } + + Assert-MockCalled -CommandName Invoke-RestMethod -ModuleName ZertoApiWrapper -Exactly 1 + } } -} \ No newline at end of file +} + +Remove-Variable -Name function -Scope Global +Remove-Variable -Name here -Scope Global From 1c17ca3e96b7dc1a4567ee62deff28d120b3211c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 18 Jul 2019 21:25:18 -0400 Subject: [PATCH 158/479] Update Invoke-ZertoRestRequest.ps1 --- .../Private/Invoke-ZertoRestRequest.ps1 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/ZertoApiWrapper/Private/Invoke-ZertoRestRequest.ps1 b/ZertoApiWrapper/Private/Invoke-ZertoRestRequest.ps1 index 342a1fd..7bc453e 100644 --- a/ZertoApiWrapper/Private/Invoke-ZertoRestRequest.ps1 +++ b/ZertoApiWrapper/Private/Invoke-ZertoRestRequest.ps1 @@ -1,26 +1,29 @@ function Invoke-ZertoRestRequest { [cmdletbinding()] param( + [ValidateSet("GET", "PUT", "POST", "DELETE")] [string]$method = "GET", + [Parameter(Mandatory)] + [ValidateNotNullOrEmpty()] [string]$uri, + [ValidateNotNullOrEmpty()] [string]$apiVersion = "v1", + [ValidateNotNullOrEmpty()] [string]$body, + [ValidateNotNullOrEmpty()] [string]$contentType = "application/json", - [System.Management.Automation.PSCredential] - $credential, + [PSCredential]$credential, [switch]$returnHeaders ) $callerErrorActionPreference = $ErrorActionPreference # If the ZVM server and Port not defined, Stop Call if ( -not ((Test-Path variable:script:zvmServer) -and (Test-Path variable:script:zvmPort)) ) { - Write-Error -Message "Zerto Connection does not Exist. Please run Connect-ZertoServer first to establish a connection" - break + ThrowError -ExceptionName "NoConnection" -ExceptionMessage "Zerto Connection does not Exist. Please run Connect-ZertoServer first to establish a connection" -errorId "Connection01" -errorCategory "Connection" -ErrorAction Stop } # If the Headers exist and the Last action was more than 30 minutes ago, Session is Expired if ( (Test-Path variable:script:zvmHeaders) -and $([datetime]$script:zvmLastAction).addMinutes(30) -lt $(get-date) ) { - Write-Error -Message "Authorization Token has Expired. Please re-authorize to the Zerto Virtual Manager" - break + ThrowError -ExceptionName "ExpiredToken" -ExceptionMessage "Authorization Token has Expired. Please re-authorize to the Zerto Virtual Manager" -errorId "ZVMAuth01" -errorCategory "Auth" -ErrorAction Stop } else { # Build the URI to be submitted @@ -57,7 +60,7 @@ public class TrustAllCertsPolicy : ICertificatePolicy { # If we are authenticating to the ZVM, Use this block to use Invoke-WebRequest and format the Headers as expected. if ($uri -eq "session/add" -and $method -eq "POST") { $apiRequestResults = Invoke-WebRequest -Uri $submittedURI -Headers $script:zvmHeaders -Method $method -Body $body -ContentType $contentType -Credential $credential -TimeoutSec 100 - $responseHeaders = @{} + $responseHeaders = @{ } $responseHeaders['x-zerto-session'] = @($apiRequestResults.Headers['x-zerto-session']) } elseif ($method -ne "GET") { # If the Method is something other than 'GET' use this call with a body parameter From 2e6a37bd5f708641b35b3681a67447a93c7f0688 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 18 Jul 2019 21:25:20 -0400 Subject: [PATCH 159/479] Update Invoke-ZertoRestRequest.Tests.ps1 --- .../Private/Invoke-ZertoRestRequest.Tests.ps1 | 125 ++++++++++++++++-- 1 file changed, 111 insertions(+), 14 deletions(-) diff --git a/Tests/Private/Invoke-ZertoRestRequest.Tests.ps1 b/Tests/Private/Invoke-ZertoRestRequest.Tests.ps1 index 984d682..ffcd1dc 100644 --- a/Tests/Private/Invoke-ZertoRestRequest.Tests.ps1 +++ b/Tests/Private/Invoke-ZertoRestRequest.Tests.ps1 @@ -1,17 +1,114 @@ -$filePath = (Split-Path -Parent $MyInvocation.MyCommand.Path) -replace 'Tests', 'ZertoApiWrapper' -$fileName = (Split-Path -Leaf $MyInvocation.MyCommand.Path ) -replace '.Tests.', '.' -$file = Get-ChildItem "$filePath\$fileName" -. $file.FullName +#Requires -Modules Pester +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag Unit { - it "file should exist" { - $file.FullName | should exist - } +Describe $global:function -Tag 'Unit', 'Source', 'Built' { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file.FullName -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 + InModuleScope -ModuleName ZertoApiWrapper { + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-RestMethod { + "Ran Command" + } + + Context "$global:function::Parameter Unit Tests" { + $thisCommand = get-command Invoke-ZertoRestRequest + it "has a mandatory string parameter for the uri" { + $thisCommand | Should -HaveParameter uri -Mandatory -Type String + } + + it "uri parameter cannot be null or empty" { + $thisParameter = $thisCommand.Parameters['uri'] + $thisParameter.Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should Be 1 + } + + it "has a non-mandatory string parameter for the method" { + $thisCommand | Should -HaveParameter method -Not -Mandatory + $thisCommand | Should -HaveParameter method -Type String + } + + it "method parameter can only be 'GET', 'POST', 'PUT', 'DELETE'" { + $thisParameter = $thisCommand.Parameters['method'] + $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.Count | Should Be 1 + $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'GET' | Should -BeTrue + $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'PUT' | Should -BeTrue + $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'POST' | Should -BeTrue + $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'DELETE' | Should -BeTrue + $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues.Count | Should -Be 4 + } + + it "has a non-mandatory string parameter for the apiVersion, default 'v1'" { + $thisCommand | Should -HaveParameter apiVersion -Not -Mandatory + $thisCommand | Should -HaveParameter apiVersion -Type String + $thisCommand | Should -HaveParameter apiVersion -DefaultValue "v1" + } + + it "apiVersion parameter cannot be null or empty" { + $thisParameter = $thisCommand.Parameters['apiVersion'] + $thisParameter.Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should Be 1 + } + + it "has a non-mandatory string parameter for the body" { + $thisCommand | Should -HaveParameter body -Not -Mandatory + $thisCommand | Should -HaveParameter body -Type String + } + + it "apiVersion parameter cannot be null or empty" { + $thisParameter = $thisCommand.Parameters['body'] + $thisParameter.Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should Be 1 + } + + it "has a non-mandatory string parameter for the contentType" { + $thisCommand | Should -HaveParameter contentType -Not -Mandatory + $thisCommand | Should -HaveParameter contentType -Type String + $thisCommand | Should -HaveParameter contentType -DefaultValue "application/json" + } + + it "apiVersion parameter cannot be null or empty" { + $thisParameter = $thisCommand.Parameters['contentType'] + $thisParameter.Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should Be 1 + } + + it "has a non-mandatory PSCredential parameter for the credential" { + $thisCommand | Should -HaveParameter credential -Type PSCredential + $thisCommand | Should -HaveParameter credential -not -mandatory + } + + it "has a non-mandatory switch parameter to ReturnHeaders" { + $thisCommand | Should -HaveParameter returnHeaders -Type Switch + $thisCommand | Should -HaveParameter returnHeaders -Not -Mandatory + } + + } + + Context "$global:function::Function Unit Tests" { + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-RestMethod { + "Ran Command" + } + + BeforeEach { + Set-Variable -Name zvmHeaders -Scope Script -Value (@{ "Accept" = "application/json" }) + Set-Variable -Name zvmLastAction -Scope Script -Value $(Get-date).Ticks + Set-Variable -Name zvmServer -Scope Script -Value "192.168.1.100" + Set-Variable -Name zvmPort -Scope Script -Value 9669 + } + + it "runs when called" { + Invoke-ZertoRestRequest -uri "MyUri" | Should -Be "Ran Command" + } + + it "throws an error when zvmLastAction was more than 30 minutes ago" { + Set-Variable -Name zvmLastAction -Scope Script -Value $(Get-date).AddMinutes(-31).Ticks + { Invoke-ZertoRestRequest -uri "MyUri" } | Should Throw + } + + it "throws an error when the zvmServer variable does not exist" { + Remove-Variable -Name zvmServer -Scope Script + { Invoke-ZertoRestRequest -uri "MyUri" } | Should Throw + } + + Assert-MockCalled -CommandName Invoke-RestMethod -ModuleName ZertoApiWrapper -Exactly 1 + } } -} \ No newline at end of file +} + +Remove-Variable -Name function -Scope Global +Remove-Variable -Name here -Scope Global From 670fbdbba8397abb08a6986ecead9fa149dae904 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 19 Jul 2019 11:54:11 -0400 Subject: [PATCH 160/479] Change ThrowError to Throw --- ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 index de6869b..0304c88 100644 --- a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 +++ b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 @@ -15,9 +15,9 @@ function Invoke-ZARestRequest { # Check to see if the required variables are present and currently valid if ( -not ((Test-Path variable:script:zaLastActionTime) -and (Test-Path variable:script:zaHeaders)) ) { - ThrowError -ExceptionName "NoAuth" -ExceptionMessage "Zerto Analytics Connection does not Exist. Please run Connect-ZertoAnalytics first to establish a connection" -errorId "Auth02" -errorCategory "ZertoAuth" -ErrorAction Stop + Throw "Zerto Analytics Connection does not Exist. Please run Connect-ZertoAnalytics first to establish a connection" } elseif ( (Test-Path variable:script:zaHeaders) -and $([datetime]$script:zaLastActionTime).addMinutes(60) -lt $(get-date) ) { - ThrowError -ExceptionName "ExpiredToken" -ExceptionMessage "Authorization Token has Expired. Please re-authorize to the Zerto Analytics Portal" -errorId "Auth01" -errorCategory "ZertoAuth" -ErrorAction Stop + Throw "Authorization Token has Expired. Please re-authorize to the Zerto Analytics Portal" } else { # Update the last action time and submit the request based on PS Version. Set-Variable -Name zaLastActionTime -Scope Script -Value $(Get-date).Ticks From 82dbe7ae486acd69eb38f6cd33ead2d5a2d0ba9a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 19 Jul 2019 13:47:53 -0400 Subject: [PATCH 161/479] Update Invoke-ZARestRequest.Tests.ps1 --- Tests/Private/Invoke-ZARestRequest.Tests.ps1 | 77 ++++++++++---------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/Tests/Private/Invoke-ZARestRequest.Tests.ps1 b/Tests/Private/Invoke-ZARestRequest.Tests.ps1 index b76f320..78bb6f3 100644 --- a/Tests/Private/Invoke-ZARestRequest.Tests.ps1 +++ b/Tests/Private/Invoke-ZARestRequest.Tests.ps1 @@ -8,33 +8,44 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "have a mandatory string parameter for the URI Variable" { - Get-Command Invoke-ZARestRequest | Should -HaveParameter uri -Mandatory -Type String + $testCases = @( + @{ParameterName = 'uri'; Type = 'String'; Mandatory = $true; TestName = 'URI' } + @{ParameterName = 'method'; Type = 'String'; Mandatory = $false; TestName = 'Method' } + @{ParameterName = 'body'; Type = 'String'; Mandatory = $false; TestName = 'Body' } + @{ParameterName = 'contentType'; Type = 'String'; Mandatory = $false; TestName = 'contentType' } + ) + + It "Parameter present and Type test for: " -TestCases $testCases { + param($parameterName, $type, $Mandatory) + Get-Command $global:function | Should -HaveParameter $parameterName -Type $type + if ($Mandatory) { + Get-Command $global:function | Should -HaveParameter $parameterName -Mandatory + } else { + Get-Command $global:function | Should -HaveParameter $parameterName -Not -Mandatory + } } - it "have a non-mandatory string parameter for the Method Variable, default to 'GET'" { - Get-Command Invoke-ZARestRequest | Should -HaveParameter Method -Type String - Get-Command Invoke-ZARestRequest | Should -HaveParameter Method -Not -Mandatory - Get-Command Invoke-ZARestRequest | Should -HaveParameter Method -DefaultValue "GET" + It "Method parameter default is 'GET'" { + Get-Command $global:function | Should -HaveParameter Method -DefaultValue "GET" } - it "have a non-mandatory string parameter for the Body variable" { - Get-Command Invoke-ZARestRequest | Should -HaveParameter Body -Type String - Get-Command Invoke-ZARestRequest | Should -HaveParameter Body -Not -Mandatory + It "ContentType parameter default is 'application/json'" { + Get-Command $global:function | Should -HaveParameter contentType -DefaultValue "application/json" } - it "have a non-mandatory string parameter for the contentType variable" { - Get-Command Invoke-ZARestRequest | Should -HaveParameter contentType -Type String - Get-Command Invoke-ZARestRequest | Should -HaveParameter contentType -Not -Mandatory - Get-Command Invoke-ZARestRequest | Should -HaveParameter contentType -DefaultValue "application/json" + $NotNullOrEmptyTests = @( + @{ParameterName = 'uri'; TestName = 'Uri' } + @{ParameterName = 'body'; TestName = 'Body' } + @{ParameterName = 'contentType'; TestName = 'ContentType' } + ) + + It " parameter does not accecpt a null or empty value" -TestCases $NotNullOrEmptyTests { + param($parameterName) + $parameterInfo = ( Get-Command Invoke-ZARestRequest ).Parameters[$parameterName] + $parameterInfo.Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 } - it "uri variable does not accecpt a null or empty variable" { - { Invoke-ZARestRequest -uri $null } | Should Throw - { Invoke-ZARestRequest -uri "" } | Should Throw - } - - it "method variable only accecpts 'GET' 'DELETE' 'PUT' 'POST' values" { + It "method parametert only accecpts 'GET' 'DELETE' 'PUT' 'POST' values" { $parameterInfo = ( Get-Command Invoke-ZARestRequest ).Parameters['method'] $parameterInfo.Attributes.Where{ $_ -is [ValidateSet] }.Count | Should -Be 1 $validateSet = $parameterInfo.Attributes.Where{ $_ -is [ValidateSet] } @@ -44,16 +55,6 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $validateSet.ValidValues -contains 'DELETE' | Should -BeTrue $validateSet.ValidValues.Count | Should -Be 4 } - - it "body variable does not accecpt a null or empty variable" { - { Invoke-ZARestRequest -uri "connect" -body $null } | Should Throw - { Invoke-ZARestRequest -uri "connect" -body "" } | Should Throw - } - - it "accecpt variable does not accecpt a null or empty variable" { - { Invoke-ZARestRequest -uri "connect" -accecpt $null } | Should Throw - { Invoke-ZARestRequest -uri "connect" -accecpt "" } | Should Throw - } } Context "$global:function::Function Unit Tests" { @@ -64,26 +65,26 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeEach { Set-Variable -Name zaHeaders -Scope Script -Value (@{ "Accept" = "application/json" }) - Set-Variable -Name zaLastActionTime -Scope Script -Value $(Get-date).Ticks + Set-Variable -Name zaLastActionTime -Scope Script -Value $(Get-Date).Ticks } - it "runs when called" { + It "runs when called" { Invoke-ZARestRequest -uri "myuri" | Should Be "Ran Command" } - it "throws when the last action was over 60 minutes ago" { - $script:zaLastActionTime = (get-date).AddMinutes(-61).Ticks - { Invoke-ZARestRequest -uri "myuri" } | Should Throw + It "throws when the last action was over 60 minutes ago" { + $script:zaLastActionTime = (Get-Date).AddMinutes(-61).Ticks + { Invoke-ZARestRequest -uri "myuri" } | Should Throw "Authorization Token has Expired." } - it "throws when the zaHeaders variable does not exits" { + It "throws when the zaHeaders variable does not exits" { Remove-Variable -Name zaHeaders -Scope Script - { Invoke-ZARestRequest -uri "myuri" } | Should Throw + { Invoke-ZARestRequest -uri "myuri" } | Should Throw "Zerto Analytics Connection does not Exist." } - it "throws when the zaLastActionTime variable does not exits" { + It "throws when the zaLastActionTime variable does not exist" { Remove-Variable -Name zaLastActionTime -Scope Script - { Invoke-ZARestRequest -uri "myuri" } | Should Throw + { Invoke-ZARestRequest -uri "myuri" } | Should Throw "Zerto Analytics Connection does not Exist." } Assert-MockCalled -CommandName Invoke-RestMethod -ModuleName ZertoApiWrapper -Exactly 1 From 1cfc07260f35fd9ea2268b840eac67ab32289684 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 19 Jul 2019 14:22:39 -0400 Subject: [PATCH 162/479] Remove unused BeforAll Block --- Tests/Public/Disconnect-ZertoServer.Tests.ps1 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Tests/Public/Disconnect-ZertoServer.Tests.ps1 b/Tests/Public/Disconnect-ZertoServer.Tests.ps1 index 4fe92ac..873fab2 100644 --- a/Tests/Public/Disconnect-ZertoServer.Tests.ps1 +++ b/Tests/Public/Disconnect-ZertoServer.Tests.ps1 @@ -3,13 +3,10 @@ $global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { - BeforeAll { - $script:ScriptBlock = (Get-Command $global:function).ScriptBlock - } Context "$($global:function)::Parameter Unit Tests" { - it "Does not take any parameters" { - (get-command disconnect-zertoserver).parameters.count | Should -BeExactly 11 + It "Does not take any parameters" { + (Get-Command disconnect-zertoserver).parameters.count | Should -BeExactly 11 } } From 0c4643a76eb697a51822f6de895b528dde8411e4 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 19 Jul 2019 14:22:56 -0400 Subject: [PATCH 163/479] Change ThrowError to Throw --- ZertoApiWrapper/Private/Invoke-ZertoRestRequest.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ZertoApiWrapper/Private/Invoke-ZertoRestRequest.ps1 b/ZertoApiWrapper/Private/Invoke-ZertoRestRequest.ps1 index 7bc453e..4a3f642 100644 --- a/ZertoApiWrapper/Private/Invoke-ZertoRestRequest.ps1 +++ b/ZertoApiWrapper/Private/Invoke-ZertoRestRequest.ps1 @@ -18,12 +18,12 @@ function Invoke-ZertoRestRequest { $callerErrorActionPreference = $ErrorActionPreference # If the ZVM server and Port not defined, Stop Call if ( -not ((Test-Path variable:script:zvmServer) -and (Test-Path variable:script:zvmPort)) ) { - ThrowError -ExceptionName "NoConnection" -ExceptionMessage "Zerto Connection does not Exist. Please run Connect-ZertoServer first to establish a connection" -errorId "Connection01" -errorCategory "Connection" -ErrorAction Stop + Throw "Zerto Connection does not Exist. Please run Connect-ZertoServer first to establish a connection" } # If the Headers exist and the Last action was more than 30 minutes ago, Session is Expired if ( (Test-Path variable:script:zvmHeaders) -and $([datetime]$script:zvmLastAction).addMinutes(30) -lt $(get-date) ) { - ThrowError -ExceptionName "ExpiredToken" -ExceptionMessage "Authorization Token has Expired. Please re-authorize to the Zerto Virtual Manager" -errorId "ZVMAuth01" -errorCategory "Auth" -ErrorAction Stop + Throw "Authorization Token has Expired. Please re-authorize to the Zerto Virtual Manager" } else { # Build the URI to be submitted From 86ac714c22da6a2258a4f550a1958b10e051a0d0 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 19 Jul 2019 14:23:16 -0400 Subject: [PATCH 164/479] Use TestCases --- .../Private/Invoke-ZertoRestRequest.Tests.ps1 | 101 +++++++----------- 1 file changed, 40 insertions(+), 61 deletions(-) diff --git a/Tests/Private/Invoke-ZertoRestRequest.Tests.ps1 b/Tests/Private/Invoke-ZertoRestRequest.Tests.ps1 index ffcd1dc..df40da6 100644 --- a/Tests/Private/Invoke-ZertoRestRequest.Tests.ps1 +++ b/Tests/Private/Invoke-ZertoRestRequest.Tests.ps1 @@ -10,22 +10,44 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } Context "$global:function::Parameter Unit Tests" { - $thisCommand = get-command Invoke-ZertoRestRequest - it "has a mandatory string parameter for the uri" { - $thisCommand | Should -HaveParameter uri -Mandatory -Type String + $thisCommand = Get-Command Invoke-ZertoRestRequest + $ParameterNameTestCases = @( + @{ParameterName = "uri"; Type = "String"; Mandatory = $true; DefaultValue = $null; TestName = "URI" } + @{ParameterName = "method"; Type = "String"; Mandatory = $false; DefaultValue = 'GET'; TestName = "Method" } + @{ParameterName = "apiVersion"; Type = "String"; Mandatory = $false; DefaultValue = 'v1'; TestName = "API Version" } + @{ParameterName = "body"; Type = "String"; Mandatory = $false; DefaultValue = $null; TestName = "Body" } + @{ParameterName = "contentType"; Type = "String"; Mandatory = $false; DefaultValue = 'application/json'; TestName = "Content Type" } + @{ParameterName = "credential"; Type = "PSCredential"; Mandatory = $false; DefaultValue = $null; TestName = "Credential" } + @{ParameterName = "returnHeaders"; Type = "Switch"; Mandatory = $false; DefaultValue = $null; TestName = "Return Headers" } + ) + + It " parameter has the right Type, Default Value, and Mandatory Setting" -TestCases $ParameterNameTestCases { + param($ParameterName, $Type, $DefaultValue, $Mandatory) + if ($Mandatory) { + $thisCommand | Should -HaveParameter $ParameterName -Type $Type -Mandatory + } else { + $thisCommand | Should -HaveParameter $ParameterName -Type $Type + $thisCommand | Should -HaveParameter $ParameterName -Not -Mandatory + } + if ($null -ne $DefaultValue) { + $thisCommand | Should -HaveParameter $ParameterName -DefaultValue $DefaultValue + } } - it "uri parameter cannot be null or empty" { - $thisParameter = $thisCommand.Parameters['uri'] + $ParameterValidationTestCases = @( + @{ParameterName = "URI"; TestName = "URI" } + @{ParameterName = "apiVersion"; TestName = "Api Version" } + @{ParameterName = "body"; TestName = "Body" } + @{ParameterName = "contentType"; TestName = "Content Type" } + ) + + It " parameter cannot be null or empty" -TestCases $ParameterValidationTestCases { + param($ParameterName) + $thisParameter = $thisCommand.Parameters[$ParameterName] $thisParameter.Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should Be 1 } - it "has a non-mandatory string parameter for the method" { - $thisCommand | Should -HaveParameter method -Not -Mandatory - $thisCommand | Should -HaveParameter method -Type String - } - - it "method parameter can only be 'GET', 'POST', 'PUT', 'DELETE'" { + It "Method parameter can only be 'GET', 'POST', 'PUT', 'DELETE'" { $thisParameter = $thisCommand.Parameters['method'] $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.Count | Should Be 1 $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'GET' | Should -BeTrue @@ -34,49 +56,6 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'DELETE' | Should -BeTrue $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues.Count | Should -Be 4 } - - it "has a non-mandatory string parameter for the apiVersion, default 'v1'" { - $thisCommand | Should -HaveParameter apiVersion -Not -Mandatory - $thisCommand | Should -HaveParameter apiVersion -Type String - $thisCommand | Should -HaveParameter apiVersion -DefaultValue "v1" - } - - it "apiVersion parameter cannot be null or empty" { - $thisParameter = $thisCommand.Parameters['apiVersion'] - $thisParameter.Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should Be 1 - } - - it "has a non-mandatory string parameter for the body" { - $thisCommand | Should -HaveParameter body -Not -Mandatory - $thisCommand | Should -HaveParameter body -Type String - } - - it "apiVersion parameter cannot be null or empty" { - $thisParameter = $thisCommand.Parameters['body'] - $thisParameter.Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should Be 1 - } - - it "has a non-mandatory string parameter for the contentType" { - $thisCommand | Should -HaveParameter contentType -Not -Mandatory - $thisCommand | Should -HaveParameter contentType -Type String - $thisCommand | Should -HaveParameter contentType -DefaultValue "application/json" - } - - it "apiVersion parameter cannot be null or empty" { - $thisParameter = $thisCommand.Parameters['contentType'] - $thisParameter.Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should Be 1 - } - - it "has a non-mandatory PSCredential parameter for the credential" { - $thisCommand | Should -HaveParameter credential -Type PSCredential - $thisCommand | Should -HaveParameter credential -not -mandatory - } - - it "has a non-mandatory switch parameter to ReturnHeaders" { - $thisCommand | Should -HaveParameter returnHeaders -Type Switch - $thisCommand | Should -HaveParameter returnHeaders -Not -Mandatory - } - } Context "$global:function::Function Unit Tests" { @@ -86,23 +65,23 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeEach { Set-Variable -Name zvmHeaders -Scope Script -Value (@{ "Accept" = "application/json" }) - Set-Variable -Name zvmLastAction -Scope Script -Value $(Get-date).Ticks + Set-Variable -Name zvmLastAction -Scope Script -Value $(Get-Date).Ticks Set-Variable -Name zvmServer -Scope Script -Value "192.168.1.100" Set-Variable -Name zvmPort -Scope Script -Value 9669 } - it "runs when called" { + It "runs when called" { Invoke-ZertoRestRequest -uri "MyUri" | Should -Be "Ran Command" } - it "throws an error when zvmLastAction was more than 30 minutes ago" { - Set-Variable -Name zvmLastAction -Scope Script -Value $(Get-date).AddMinutes(-31).Ticks - { Invoke-ZertoRestRequest -uri "MyUri" } | Should Throw + It "throws an error when zvmLastAction was more than 30 minutes ago" { + Set-Variable -Name zvmLastAction -Scope Script -Value $(Get-Date).AddMinutes(-31).Ticks + { Invoke-ZertoRestRequest -uri "MyUri" } | Should Throw "Authorization Token has Expired" } - it "throws an error when the zvmServer variable does not exist" { + It "throws an error when the zvmServer variable does not exist" { Remove-Variable -Name zvmServer -Scope Script - { Invoke-ZertoRestRequest -uri "MyUri" } | Should Throw + { Invoke-ZertoRestRequest -uri "MyUri" } | Should Throw "Zerto Connection does not Exist." } Assert-MockCalled -CommandName Invoke-RestMethod -ModuleName ZertoApiWrapper -Exactly 1 From 997ab900350b8e51d5a85fab0d1984eb1edf04ef Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 11:37:22 -0400 Subject: [PATCH 165/479] Add Mock File for Single VRA Information --- Tests/Public/Mocks/GetSingleVra.json | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Tests/Public/Mocks/GetSingleVra.json diff --git a/Tests/Public/Mocks/GetSingleVra.json b/Tests/Public/Mocks/GetSingleVra.json new file mode 100644 index 0000000..df9776c --- /dev/null +++ b/Tests/Public/Mocks/GetSingleVra.json @@ -0,0 +1,50 @@ +{ + "DatastoreClusterIdentifier": null, + "DatastoreClusterName": null, + "DatastoreIdentifier": "d4a6a1d5-79e9-4308-990a-7c3e616f0908.datastore-19", + "DatastoreName": "datastore1", + "HostIdentifier": "d4a6a1d5-79e9-4308-990a-7c3e616f0908.host-15", + "HostVersion": "6.7", + "IpAddress": "192.168.10.15", + "Link": { + "href": "https://192.168.10.20:9669/v1/vras/5377857665828093654", + "identifier": "5377857665828093654", + "rel": null, + "type": "VraApi" + }, + "Link_{0}": { + "href": "https://192.168.10.20:9669/v1/vras/5377857665828093654", + "rel": "self", + "type": "VraApi" + }, + "MemoryInGB": 1, + "NetworkIdentifier": "d4a6a1d5-79e9-4308-990a-7c3e616f0908.network-22", + "NetworkName": "VM Network", + "Progress": 0, + "ProtectedCounters": { + "Vms": 0, + "Volumes": 0, + "Vpgs": 0 + }, + "RecoveryCounters": { + "Vms": 0, + "Volumes": 0, + "Vpgs": 0 + }, + "SelfProtectedVpgs": 0, + "Status": 0, + "VraAlerts": { + "VraAlertsStatus": 0 + }, + "VraGroup": "default_group", + "VraIdentifier": 5377857665828093654, + "VraIdentifierStr": "5377857665828093654", + "VraName": "Z-VRA-ncesx2.nc.lab", + "VraNetworkDataApi": { + "DefaultGateway": "192.168.10.254", + "SubnetMask": "255.255.255.0", + "VraIPAddress": "192.168.10.15", + "VraIPConfigurationTypeApi": "Static" + }, + "VraVersion": "7.0" +} From 9ab97f27862f60fa3ed3d98505d94267fcfb4f70 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 11:39:05 -0400 Subject: [PATCH 166/479] Update Test Template for both source and built tests --- Tests/Public/Get-ZAAlert.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZADatastore.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZAEvent.Tests.ps1 | 26 ++++++++--------- .../Get-ZAJournalAverageHistory.Tests.ps1 | 26 ++++++++--------- .../Public/Get-ZAJournalAverageSize.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZAJournalBreach.Tests.ps1 | 26 ++++++++--------- .../Public/Get-ZAJournalHistoryStat.Tests.ps1 | 26 ++++++++--------- .../Get-ZAJournalSiteAverageHistory.Tests.ps1 | 26 ++++++++--------- .../Get-ZAJournalSiteAverageSize.Tests.ps1 | 26 ++++++++--------- .../Get-ZAJournalSiteHistoryStat.Tests.ps1 | 26 ++++++++--------- .../Get-ZAJournalSiteHistorySummary.Tests.ps1 | 26 ++++++++--------- .../Get-ZAJournalSiteSizeStat.Tests.ps1 | 26 ++++++++--------- .../Get-ZAJournalStatusProportion.Tests.ps1 | 26 ++++++++--------- .../Public/Get-ZAJournalStorageStat.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZAJournalSummary.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZALicense.Tests.ps1 | 28 +++++++++--------- Tests/Public/Get-ZAMonitoring.Tests.ps1 | 28 +++++++++--------- .../Get-ZANetworkSiteAverageIOPS.Tests.ps1 | 26 ++++++++--------- ...-ZANetworkSiteAveragePerformance.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 | 26 ++++++++--------- .../Public/Get-ZANetworkSiteSummary.Tests.ps1 | 26 ++++++++--------- .../Get-ZANetworkVpgAverageIOPS.Tests.ps1 | 26 ++++++++--------- ...t-ZANetworkVpgAveragePerformance.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 | 26 ++++++++--------- .../Public/Get-ZANetworkVpgSummary.Tests.ps1 | 26 ++++++++--------- .../Public/Get-ZARPOAccountAverage.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZARPOAverage.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZARPOBreach.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZARPOStat.Tests.ps1 | 26 ++++++++--------- .../Get-ZARPOStatusProportion.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZARPOSummary.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZASite.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZASitePair.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZASiteTopology.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZATask.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZAVolume.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZAVpg.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZAzOrg.Tests.ps1 | 26 ++++++++--------- Tests/Public/Get-ZertoEvent.Tests.ps1 | 28 +++++++++--------- Tests/Public/Get-ZertoLicense.Tests.ps1 | 28 +++++++++--------- Tests/Public/Get-ZertoPeerSite.Tests.ps1 | 28 +++++++++--------- Tests/Public/Get-ZertoProtectedVm.Tests.ps1 | 28 +++++++++--------- .../Public/Get-ZertoRecoveryReport.Tests.ps1 | 28 +++++++++--------- .../Public/Get-ZertoResourcesReport.Tests.ps1 | 28 +++++++++--------- .../Public/Get-ZertoServiceProfile.Tests.ps1 | 28 +++++++++--------- Tests/Public/Get-ZertoTask.Tests.ps1 | 28 +++++++++--------- Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 | 28 +++++++++--------- .../Get-ZertoVirtualizationSite.Tests.ps1 | 28 +++++++++--------- Tests/Public/Get-ZertoVolume.Tests.ps1 | 29 +++++++++---------- Tests/Public/Get-ZertoVpg.Tests.ps1 | 28 +++++++++--------- Tests/Public/Get-ZertoVpgSetting.Tests.ps1 | 28 +++++++++--------- Tests/Public/Get-ZertoVra.Tests.ps1 | 28 +++++++++--------- Tests/Public/Get-ZertoZorg.Tests.ps1 | 28 +++++++++--------- Tests/Public/Get-ZertoZsspSession.Tests.ps1 | 28 +++++++++--------- Tests/Public/New-ZertoVpg.Tests.ps1 | 28 +++++++++--------- .../New-ZertoVpgSettingsIdentifier.Tests.ps1 | 28 +++++++++--------- Tests/Public/Remove-ZertoPeerSite.Tests.ps1 | 28 +++++++++--------- Tests/Public/Remove-ZertoVpg.Tests.ps1 | 28 +++++++++--------- ...emove-ZertoVpgSettingsIdentifier.Tests.ps1 | 26 ++++++++--------- Tests/Public/Resume-ZertoVpg.Tests.ps1 | 28 +++++++++--------- Tests/Public/Save-ZertoVpgSetting.Tests.ps1 | 28 +++++++++--------- Tests/Public/Set-ZertoAlert.Tests.ps1 | 28 +++++++++--------- Tests/Public/Set-ZertoLicense.Tests.ps1 | 28 +++++++++--------- Tests/Public/Start-ZertoCloneVpg.Tests.ps1 | 28 +++++++++--------- .../Public/Start-ZertoFailoverTest.Tests.ps1 | 28 +++++++++--------- Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 | 28 +++++++++--------- Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 | 28 +++++++++--------- Tests/Public/Suspend-ZertoVpg.Tests.ps1 | 28 +++++++++--------- Tests/Public/Uninstall-ZertoVra.Tests.ps1 | 28 +++++++++--------- 69 files changed, 861 insertions(+), 998 deletions(-) diff --git a/Tests/Public/Get-ZAAlert.Tests.ps1 b/Tests/Public/Get-ZAAlert.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAAlert.Tests.ps1 +++ b/Tests/Public/Get-ZAAlert.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZADatastore.Tests.ps1 b/Tests/Public/Get-ZADatastore.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZADatastore.Tests.ps1 +++ b/Tests/Public/Get-ZADatastore.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAEvent.Tests.ps1 b/Tests/Public/Get-ZAEvent.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAEvent.Tests.ps1 +++ b/Tests/Public/Get-ZAEvent.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAJournalBreach.Tests.ps1 b/Tests/Public/Get-ZAJournalBreach.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAJournalBreach.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalBreach.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 b/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 b/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 b/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAJournalSummary.Tests.ps1 b/Tests/Public/Get-ZAJournalSummary.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAJournalSummary.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSummary.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZALicense.Tests.ps1 b/Tests/Public/Get-ZALicense.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZALicense.Tests.ps1 +++ b/Tests/Public/Get-ZALicense.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAMonitoring.Tests.ps1 b/Tests/Public/Get-ZAMonitoring.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZAMonitoring.Tests.ps1 +++ b/Tests/Public/Get-ZAMonitoring.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 b/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 +++ b/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZARPOAverage.Tests.ps1 b/Tests/Public/Get-ZARPOAverage.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZARPOAverage.Tests.ps1 +++ b/Tests/Public/Get-ZARPOAverage.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZARPOBreach.Tests.ps1 b/Tests/Public/Get-ZARPOBreach.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZARPOBreach.Tests.ps1 +++ b/Tests/Public/Get-ZARPOBreach.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZARPOStat.Tests.ps1 b/Tests/Public/Get-ZARPOStat.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZARPOStat.Tests.ps1 +++ b/Tests/Public/Get-ZARPOStat.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 b/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 +++ b/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZARPOSummary.Tests.ps1 b/Tests/Public/Get-ZARPOSummary.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZARPOSummary.Tests.ps1 +++ b/Tests/Public/Get-ZARPOSummary.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZASite.Tests.ps1 b/Tests/Public/Get-ZASite.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZASite.Tests.ps1 +++ b/Tests/Public/Get-ZASite.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZASitePair.Tests.ps1 b/Tests/Public/Get-ZASitePair.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZASitePair.Tests.ps1 +++ b/Tests/Public/Get-ZASitePair.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZASiteTopology.Tests.ps1 b/Tests/Public/Get-ZASiteTopology.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZASiteTopology.Tests.ps1 +++ b/Tests/Public/Get-ZASiteTopology.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZATask.Tests.ps1 b/Tests/Public/Get-ZATask.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZATask.Tests.ps1 +++ b/Tests/Public/Get-ZATask.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAVolume.Tests.ps1 b/Tests/Public/Get-ZAVolume.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAVolume.Tests.ps1 +++ b/Tests/Public/Get-ZAVolume.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAVpg.Tests.ps1 b/Tests/Public/Get-ZAVpg.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAVpg.Tests.ps1 +++ b/Tests/Public/Get-ZAVpg.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAzOrg.Tests.ps1 b/Tests/Public/Get-ZAzOrg.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Get-ZAzOrg.Tests.ps1 +++ b/Tests/Public/Get-ZAzOrg.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZertoEvent.Tests.ps1 b/Tests/Public/Get-ZertoEvent.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZertoEvent.Tests.ps1 +++ b/Tests/Public/Get-ZertoEvent.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZertoLicense.Tests.ps1 b/Tests/Public/Get-ZertoLicense.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZertoLicense.Tests.ps1 +++ b/Tests/Public/Get-ZertoLicense.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZertoPeerSite.Tests.ps1 b/Tests/Public/Get-ZertoPeerSite.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoPeerSite.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZertoProtectedVm.Tests.ps1 b/Tests/Public/Get-ZertoProtectedVm.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZertoProtectedVm.Tests.ps1 +++ b/Tests/Public/Get-ZertoProtectedVm.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZertoRecoveryReport.Tests.ps1 b/Tests/Public/Get-ZertoRecoveryReport.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZertoRecoveryReport.Tests.ps1 +++ b/Tests/Public/Get-ZertoRecoveryReport.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZertoResourcesReport.Tests.ps1 b/Tests/Public/Get-ZertoResourcesReport.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZertoResourcesReport.Tests.ps1 +++ b/Tests/Public/Get-ZertoResourcesReport.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZertoServiceProfile.Tests.ps1 b/Tests/Public/Get-ZertoServiceProfile.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZertoServiceProfile.Tests.ps1 +++ b/Tests/Public/Get-ZertoServiceProfile.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZertoTask.Tests.ps1 b/Tests/Public/Get-ZertoTask.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZertoTask.Tests.ps1 +++ b/Tests/Public/Get-ZertoTask.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 b/Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 +++ b/Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 b/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZertoVolume.Tests.ps1 b/Tests/Public/Get-ZertoVolume.Tests.ps1 index 50d2f9d..4b86f54 100644 --- a/Tests/Public/Get-ZertoVolume.Tests.ps1 +++ b/Tests/Public/Get-ZertoVolume.Tests.ps1 @@ -1,19 +1,18 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global + diff --git a/Tests/Public/Get-ZertoVpg.Tests.ps1 b/Tests/Public/Get-ZertoVpg.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Get-ZertoVpg.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZertoVpgSetting.Tests.ps1 b/Tests/Public/Get-ZertoVpgSetting.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZertoVpgSetting.Tests.ps1 +++ b/Tests/Public/Get-ZertoVpgSetting.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZertoVra.Tests.ps1 b/Tests/Public/Get-ZertoVra.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZertoVra.Tests.ps1 +++ b/Tests/Public/Get-ZertoVra.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZertoZorg.Tests.ps1 b/Tests/Public/Get-ZertoZorg.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZertoZorg.Tests.ps1 +++ b/Tests/Public/Get-ZertoZorg.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZertoZsspSession.Tests.ps1 b/Tests/Public/Get-ZertoZsspSession.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Get-ZertoZsspSession.Tests.ps1 +++ b/Tests/Public/Get-ZertoZsspSession.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/New-ZertoVpg.Tests.ps1 b/Tests/Public/New-ZertoVpg.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/New-ZertoVpg.Tests.ps1 +++ b/Tests/Public/New-ZertoVpg.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/New-ZertoVpgSettingsIdentifier.Tests.ps1 b/Tests/Public/New-ZertoVpgSettingsIdentifier.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/New-ZertoVpgSettingsIdentifier.Tests.ps1 +++ b/Tests/Public/New-ZertoVpgSettingsIdentifier.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Remove-ZertoPeerSite.Tests.ps1 b/Tests/Public/Remove-ZertoPeerSite.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Remove-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Remove-ZertoPeerSite.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Remove-ZertoVpg.Tests.ps1 b/Tests/Public/Remove-ZertoVpg.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Remove-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Remove-ZertoVpg.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 b/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 index f5816b6..e6e6083 100644 --- a/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 +++ b/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + + } + + Context "$global:function::Parameter Functional Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Resume-ZertoVpg.Tests.ps1 b/Tests/Public/Resume-ZertoVpg.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Resume-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Resume-ZertoVpg.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Save-ZertoVpgSetting.Tests.ps1 b/Tests/Public/Save-ZertoVpgSetting.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Save-ZertoVpgSetting.Tests.ps1 +++ b/Tests/Public/Save-ZertoVpgSetting.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Set-ZertoAlert.Tests.ps1 b/Tests/Public/Set-ZertoAlert.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Set-ZertoAlert.Tests.ps1 +++ b/Tests/Public/Set-ZertoAlert.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Set-ZertoLicense.Tests.ps1 b/Tests/Public/Set-ZertoLicense.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Set-ZertoLicense.Tests.ps1 +++ b/Tests/Public/Set-ZertoLicense.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Start-ZertoCloneVpg.Tests.ps1 b/Tests/Public/Start-ZertoCloneVpg.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Start-ZertoCloneVpg.Tests.ps1 +++ b/Tests/Public/Start-ZertoCloneVpg.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Start-ZertoFailoverTest.Tests.ps1 b/Tests/Public/Start-ZertoFailoverTest.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Start-ZertoFailoverTest.Tests.ps1 +++ b/Tests/Public/Start-ZertoFailoverTest.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 b/Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 +++ b/Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 b/Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 +++ b/Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Suspend-ZertoVpg.Tests.ps1 b/Tests/Public/Suspend-ZertoVpg.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Suspend-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Suspend-ZertoVpg.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Uninstall-ZertoVra.Tests.ps1 b/Tests/Public/Uninstall-ZertoVra.Tests.ps1 index 50d2f9d..e6e6083 100644 --- a/Tests/Public/Uninstall-ZertoVra.Tests.ps1 +++ b/Tests/Public/Uninstall-ZertoVra.Tests.ps1 @@ -1,19 +1,17 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global From 1e64d9d7f397828c922b7ababc3d1e3f2e8cc966 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 12:57:21 -0400 Subject: [PATCH 167/479] Renamed Function --- .../{New-Map.Tests.ps1 => Get-Map.Tests.ps1} | 20 +++++++++---------- .../Private/{New-Map.ps1 => Get-Map.ps1} | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) rename Tests/Private/{New-Map.Tests.ps1 => Get-Map.Tests.ps1} (79%) rename ZertoApiWrapper/Private/{New-Map.ps1 => Get-Map.ps1} (96%) diff --git a/Tests/Private/New-Map.Tests.ps1 b/Tests/Private/Get-Map.Tests.ps1 similarity index 79% rename from Tests/Private/New-Map.Tests.ps1 rename to Tests/Private/Get-Map.Tests.ps1 index 6134a02..8aeca06 100644 --- a/Tests/Private/New-Map.Tests.ps1 +++ b/Tests/Private/Get-Map.Tests.ps1 @@ -12,9 +12,9 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { it "Input Object should not accecpt a Null or Empty value" { $myObj = [PSCustomObject]@{ } - { New-Map -InputObject $myObj -Key "Key" -Value "Value" } | Should Throw - { New-Map -InputObject $null -Key "Key" -Value "Value" } | Should Throw - { New-Map -InputObject "" -Key "Key" -Value "Value" } | Should Throw + { Get-Map -InputObject $myObj -Key "Key" -Value "Value" } | Should Throw + { Get-Map -InputObject $null -Key "Key" -Value "Value" } | Should Throw + { Get-Map -InputObject "" -Key "Key" -Value "Value" } | Should Throw } it "have a mandatory string parameter for the Map Key" { @@ -23,16 +23,16 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { it "The Map variable should not accecpt a Null or Empty value" { $myObj = [PSCustomObject]@{one = 1; two = 2 } - { New-Map -InputObject $myObj -Key "" -Value "Value" } | Should Throw - { New-Map -InputObject $null -Key $null -Value "Value" } | Should Throw - { New-Map -InputObject $myObj -Key 1 -Value "Value" } | Should Throw + { Get-Map -InputObject $myObj -Key "" -Value "Value" } | Should Throw + { Get-Map -InputObject $null -Key $null -Value "Value" } | Should Throw + { Get-Map -InputObject $myObj -Key 1 -Value "Value" } | Should Throw } it "The Value variable should not accecpt a Null or Empty value" { $myObj = [PSCustomObject]@{one = 1; two = 2 } - { New-Map -InputObject $myObj -Key "Key" -Value "" } | Should Throw - { New-Map -InputObject $myObj -Key "Key" -Value $null } | Should Throw - { New-Map -InputObject $myObj -Key "Key" -Value 1 } | Should Throw + { Get-Map -InputObject $myObj -Key "Key" -Value "" } | Should Throw + { Get-Map -InputObject $myObj -Key "Key" -Value $null } | Should Throw + { Get-Map -InputObject $myObj -Key "Key" -Value 1 } | Should Throw } it "have a mandatory string parameter for the Map Value" { @@ -47,7 +47,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Function Tests" { $myObj = Get-Content "$global:here/Mocks/ProtectedVMs.json" | ConvertFrom-Json BeforeEach { - $MyMap = New-Map -InputObject $MyObj -Key "vmIdentifier" -Value "vmName" + $MyMap = Get-Map -InputObject $MyObj -Key "vmIdentifier" -Value "vmName" } it "Returned object should be a hashtable" { $myMap | Should -BeOfType Hashtable diff --git a/ZertoApiWrapper/Private/New-Map.ps1 b/ZertoApiWrapper/Private/Get-Map.ps1 similarity index 96% rename from ZertoApiWrapper/Private/New-Map.ps1 rename to ZertoApiWrapper/Private/Get-Map.ps1 index b84ea9d..343a711 100644 --- a/ZertoApiWrapper/Private/New-Map.ps1 +++ b/ZertoApiWrapper/Private/Get-Map.ps1 @@ -1,4 +1,4 @@ -function New-Map { +function Get-Map { [CmdletBinding()] [OutputType([Hashtable])] param( From 344e7836f9437805e18b1f3e588de155e06e8836 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 12:57:27 -0400 Subject: [PATCH 168/479] Update .gitignore --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2f58130..be77f6b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ *.zip temp/* -Tests/Public/TestResults.xml -Tests/TestResults.xml +BuiltTestResults.xml +SourceTestResults.xml publish/* CodeCoverage.xml From b11c497eadf6a66342374bdec8ca80ef9c922927 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 12:59:12 -0400 Subject: [PATCH 169/479] Update Exclude Rules --- ZertoApiWrapper.build.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index b823443..197036c 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -52,7 +52,7 @@ task AnalyzeSourceFiles CheckPSScriptAnalyzerInstalled, { Severity = @('Error', 'Warning') Recurse = $true Verbose = $false - ExcludeRule = @('PSUseDeclaredVarsMoreThanAssignments', 'PSUseShouldProcessForStateChangingFunctions', 'PSUseToExportFieldsInManifest') + ExcludeRule = @('PSUseToExportFieldsInManifest', 'PSUseBOMForUnicodeEncodedFile', 'PSUseSingularNouns') } $saresults = Invoke-ScriptAnalyzer @scriptAnalyzerParams if ($saResults) { @@ -67,7 +67,7 @@ task AnalyzeBuiltFiles CheckPSScriptAnalyzerInstalled, CreatePsm1ForRelease, { Severity = @('Error', 'Warning') Recurse = $true Verbose = $false - ExcludeRule = @("PSUseBOMForUnicodeEncodedFile", "PSUseSingularNouns") + ExcludeRule = @('PSUseSingularNouns', 'PSUseBOMForUnicodeEncodedFile') } $saresults = Invoke-ScriptAnalyzer @scriptAnalyzerParams From 6a6b073adadb8a9e655f32b8e6c2dbf3607dade4 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 13:00:28 -0400 Subject: [PATCH 170/479] Redirect Invoke Output to Null --- ZertoApiWrapper/Public/Disconnect-ZertoServer.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Disconnect-ZertoServer.ps1 b/ZertoApiWrapper/Public/Disconnect-ZertoServer.ps1 index 4559701..b9d3032 100644 --- a/ZertoApiWrapper/Public/Disconnect-ZertoServer.ps1 +++ b/ZertoApiWrapper/Public/Disconnect-ZertoServer.ps1 @@ -5,7 +5,7 @@ function Disconnect-ZertoServer { $uri = "session" # Delete API Authorization - Invoke-ZertoRestRequest -uri $uri -method DELETE + $null = Invoke-ZertoRestRequest -uri $uri -method DELETE # Remove all variables used Remove-Variable -Name zvmServer -Scope Script From a526045662e1264196ff383ac20245530ebd3468 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 13:01:32 -0400 Subject: [PATCH 171/479] Update Map Function Call --- ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 | 4 ++-- ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 b/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 index 6de8852..bef7b42 100644 --- a/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 +++ b/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 @@ -38,12 +38,12 @@ function Export-ZertoVmNicSetting { } $nicSettings = foreach ($group in $vpgs) { $protectedVms = Get-ZertoProtectedVm -vpgName ($group.vpgname) - $vmMap = New-Map -InputObject $protectedVms -key "vmIdentifier" -value "vmName" + $vmMap = Get-Map -InputObject $protectedVms -key "vmIdentifier" -value "vmName" $settingsId = New-ZertoVpgSettingsIdentifier -vpgIdentifier $group.vpgIdentifier $vmSettings = Get-ZertoVpgSetting -vpgSettingsIdentifier $settingsId -vms $networks = Get-ZertoVirtualizationSite -siteIdentifier $group.RecoverySite.identifier -networks $null = Remove-ZertoVpgSettingsIdentifier -vpgSettingsIdentifier $settingsId - $networkMap = New-Map -InputObject $networks -key "NetworkIdentifier" -value "VirtualizationNetworkName" + $networkMap = Get-Map -InputObject $networks -key "NetworkIdentifier" -value "VirtualizationNetworkName" foreach ($vm in $vmSettings) { $nicInfo = [PSCustomObject]@{ VPGName = $group.VPGName diff --git a/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 b/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 index 3cdf766..0a59888 100644 --- a/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 +++ b/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 @@ -31,9 +31,9 @@ function Import-ZertoVmNicSetting { $VpgInfo = Get-ZertoVpg -vpgName $Vpg $VpgIdentifier = $VpgInfo.VpgIdentifier $RecoveryNetworks = Get-ZertoVirtualizationSite -siteIdentifier $VpgInfo.RecoverySite.Identifier -networks - $NetworkMap = New-Map -InputObject $RecoveryNetworks -key "VirtualizationNetworkName" -value "NetworkIdentifier" + $NetworkMap = Get-Map -InputObject $RecoveryNetworks -key "VirtualizationNetworkName" -value "NetworkIdentifier" $VpgVms = Get-ZertoProtectedVm -vpgName $Vpg - $VmMap = New-Map -InputObject $VpgVms -key "vmName" -value "vmIdentifier" + $VmMap = Get-Map -InputObject $VpgVms -key "vmName" -value "vmIdentifier" $VpgSettingsId = New-ZertoVpgSettingsIdentifier -vpgIdentifier $VpgIdentifier $VmsToUpdate = $ImportData | Where-Object { $_.VPGName -eq $Vpg } foreach ($vm in $VmsToUpdate) { From a78f827804f10dcc6aed9498a7c3f674000feb28 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 13:48:25 -0400 Subject: [PATCH 172/479] Add Dhcp VRA Mock --- Tests/Public/Mocks/GetDhcpVra.json | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Tests/Public/Mocks/GetDhcpVra.json diff --git a/Tests/Public/Mocks/GetDhcpVra.json b/Tests/Public/Mocks/GetDhcpVra.json new file mode 100644 index 0000000..0c2539c --- /dev/null +++ b/Tests/Public/Mocks/GetDhcpVra.json @@ -0,0 +1,50 @@ +{ + "DatastoreClusterIdentifier": null, + "DatastoreClusterName": null, + "DatastoreIdentifier": "d4a6a1d5-79e9-4308-990a-7c3e616f0908.datastore-21", + "DatastoreName": "datastore1 (2)", + "HostIdentifier": "d4a6a1d5-79e9-4308-990a-7c3e616f0908.host-18", + "HostVersion": "6.7", + "IpAddress": "192.168.10.110", + "Link": { + "href": "https://192.168.10.20:9669/v1/vras/5377857665828094938", + "identifier": "5377857665828094938", + "rel": null, + "type": "VraApi" + }, + "Link_{0}": { + "href": "https://192.168.10.20:9669/v1/vras/5377857665828094938", + "rel": "self", + "type": "VraApi" + }, + "MemoryInGB": 1, + "NetworkIdentifier": "d4a6a1d5-79e9-4308-990a-7c3e616f0908.network-22", + "NetworkName": "VM Network", + "Progress": 0, + "ProtectedCounters": { + "Vms": 0, + "Volumes": 0, + "Vpgs": 0 + }, + "RecoveryCounters": { + "Vms": 0, + "Volumes": 0, + "Vpgs": 0 + }, + "SelfProtectedVpgs": 0, + "Status": 0, + "VraAlerts": { + "VraAlertsStatus": 0 + }, + "VraGroup": "default_group", + "VraIdentifier": 5377857665828094938, + "VraIdentifierStr": "5377857665828094938", + "VraName": "Z-VRA-ncesx1.nc.lab", + "VraNetworkDataApi": { + "DefaultGateway": "", + "SubnetMask": "255.255.255.0", + "VraIPAddress": "192.168.10.110", + "VraIPConfigurationTypeApi": "Dhcp" + }, + "VraVersion": "7.0" +} From 9f2a6c42cd95b24d069b2d7b105496ea8664e26e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 13:49:03 -0400 Subject: [PATCH 173/479] Change error to Throw --- ZertoApiWrapper/Public/Edit-ZertoVra.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ZertoApiWrapper/Public/Edit-ZertoVra.ps1 b/ZertoApiWrapper/Public/Edit-ZertoVra.ps1 index acf1693..1a0e40b 100644 --- a/ZertoApiWrapper/Public/Edit-ZertoVra.ps1 +++ b/ZertoApiWrapper/Public/Edit-ZertoVra.ps1 @@ -39,7 +39,7 @@ function Edit-ZertoVra { # Get the current VRA information for use if an updated parameter is not supplied $vra = Get-ZertoVra -vraIdentifier $vraIdentifier if ( -not $vra ) { - Write-Error "VRA with Identifier: $vraIdentifier could not be found. Please check the ID and try again." + Throw "VRA with Identifier: $vraIdentifier could not be found. Please check the ID and try again." } } @@ -87,4 +87,4 @@ function Edit-ZertoVra { # Nothing to Do } } -#TODO: Refactor \ No newline at end of file +#TODO: Refactor From a6d81aca44642ee98a356bace55787774f509f01 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 13:49:37 -0400 Subject: [PATCH 174/479] Refactor Tests --- Tests/Public/Edit-ZertoVra.Tests.ps1 | 226 ++++++++------------------- 1 file changed, 68 insertions(+), 158 deletions(-) diff --git a/Tests/Public/Edit-ZertoVra.Tests.ps1 b/Tests/Public/Edit-ZertoVra.Tests.ps1 index 4026b3d..ec609fd 100644 --- a/Tests/Public/Edit-ZertoVra.Tests.ps1 +++ b/Tests/Public/Edit-ZertoVra.Tests.ps1 @@ -1,187 +1,97 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -Replace "Tests", "ZertoApiWrapper" -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { Mock -ModuleName ZertoApiWrapper Invoke-ZertoRestRequest { - return "8dcfdc8e-e5d2-4ba4-9885-f9eb57d92b14.928a122b-1763-4664-ad37-cc00bb883f2f" + Get-Content $global:here\Mocks\TaskId.txt } - Mock -ModuleName ZertoApiWrapper Get-ZertoVra { - $vraInformation = @{ - DatastoreClusterIdentifier = $null - DatastoreClusterName = $null - DatastoreIdentifier = "840f99fb-4689-2f8b-ea10-2a47a5bb00cc.Prod_Datastore" - DatastoreName = "Prod_Datastore" - HostIdentifier = "840f99fb-4689-2f8b-ea10-2a47a5bb00cc.znest82esxus-1" - HostVersion = 6.5 - IpAddress = 192.168.1.100 - Link = @{ - href = "https://192.168.1.200:7669/v1/vras/2609816293328110468" - identifier = "269816293328110468" - rel = $null - type = "VraApi" - } - MemoryInGB = 3 - NetworkIdentifier = "840f99fb-4689-2f8b-ea10-2a47a5bb00cc.network-1" - NetworkName = "Test Network" - Progress = 0 - ProtectedCounters = @{ - Vms = 0 - Volumes = 0 - Vpgs = 0 - } - RecoveryCounters = @{ - Vms = 0 - Volumes = 0 - Vpgs = 0 - } - SelfProtectedVpgs = 0 - Status = 0 - VraAlerts = @{ - VraAlertStatus = 0 - } - VraGroup = "default_group" - VraIdentifier = 269816293328110468 - VraIdentifierStr = "269816293328110468" - VraName = "VRA-znest82esxus-1" - VraNetworkDataApi = @{ - DefaultGateway = "192.168.1.1" - SubnetMask = "255.255.255.0" - VraIpAddress = "192.168.1.100" - VraIpConfigurationTypeApi = "Dhcp" - } - VraVersion = 7.0 - } - return $vraInformation + Mock -ModuleName ZertoApiWrapper Get-ZertoVra -ParameterFilter { $vraIdentifier -eq "MyVraIdentifier" } { + Get-Content $global:here\Mocks\GetSingleVra.json -Raw | ConvertFrom-Json } - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 + Mock -ModuleName ZertoApiWrapper Get-ZertoVra -ParameterFilter { $vraIdentifier -eq "DoesNotExist" } { + $null } - Context "$($File.BaseName)::Parameter Unit Tests" { + Mock -ModuleName ZertoApiWrapper Get-ZertoVra -ParameterFilter { $vraIdentifier -eq "DhcpVraIdentifier" } { + Get-Content $global:here\Mocks\GetDhcpVra.json -Raw | ConvertFrom-Json + } - It "has a mandatory String variable for the vraIdentifier" { - Get-Command $file.BaseName | Should -HaveParameter vraIdentifier -Mandatory -Type String - {Edit-ZertoVra} + Context "$($global:function)::Parameter Unit Tests" { + + $ParameterTestCases = @( + @{ParameterName = 'vraIdentifier'; Type = 'String'; Mandatory = $true } + @{ParameterName = 'groupName'; Type = 'String'; Mandatory = $false } + @{ParameterName = 'vraIpAddress'; Type = 'String'; Mandatory = $false } + @{ParameterName = 'defaultGateway'; Type = 'String'; Mandatory = $false } + @{ParameterName = 'subnetMask'; Type = 'String'; Mandatory = $false } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type } - It "has a non-mandatory String variable for the Bandwidth Group" { - Get-Command $file.BaseName | Should -HaveParameter groupName -Not -Mandatory - Get-Command $file.BaseName | Should -HaveParameter groupName -Type String + $StringTestCases = @( + @{ ParameterName = 'vraIdentifier' } + @{ ParameterName = 'groupName' } + ) + + it " validates against null or empty values" -TestCases $StringTestCases { + param($ParameterName) + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 } - it "has a non-mandatory String variable for the staticIp Address" { - Get-Command $file.BaseName | Should -HaveParameter vraIpAddress -Not -Mandatory - Get-Command $file.BaseName | Should -HaveParameter vraIpAddress -Type String - } + $IpAddrTestCases = @( + @{ParameterName = 'vraIpAddress' } + @{ParameterName = 'defaultGateway' } + @{ParameterName = 'subnetMask' } + ) - it "has a non-mandatory String variable for the default gateway" { - Get-Command $file.BaseName | Should -HaveParameter defaultGateway -Not -Mandatory - Get-Command $file.BaseName | Should -HaveParameter defaultGateway -Type String - } - - it "has a non-mandatory String variable for the subnetmask" { - Get-Command $file.BaseName | Should -HaveParameter subnetMask -Not -Mandatory - Get-Command $file.BaseName | Should -HaveParameter subnetMask -Type String - } - - it "supports WhatIf" { - Get-Command $file.BaseName | Should -HaveParameter WhatIf -Not -Mandatory - } - - $cases = ` - @{vraIpAddress = "192.168.1.256"}, ` - @{vraIpAddress = "192.168.1"}, ` - @{vraIpAddress = "String"}, ` - @{vraIpAddress = 192.168.1}, ` - @{vraIpAddress = 192.168.1.246}, ` - @{vraIpAddress = 32}, ` - @{vraIpAddress = ""}, ` - @{vraIpAddress = $null} - It "IpAddress field require valid IP addresses as a String" -TestCases $cases { - param ( $vraIpAddress ) - {Edit-ZertoVra -vraIdentifier "MyVraIdentifier" -vraIpaddress $vraIpAddress} | Should -Throw - } - - $cases = ` - @{subnetMask = "192.168.1.256"}, ` - @{subnetMask = "192.168.1"}, ` - @{subnetMask = "String"}, ` - @{subnetMask = 192.168.1}, ` - @{subnetMask = 192.168.1.246}, ` - @{subnetMask = 32}, ` - @{subnetMask = ""}, ` - @{subnetMask = $null} - It "subnetMask field require valid IP addresses as a String" -TestCases $cases { - param ( $vraIpAddress ) - {Edit-ZertoVra -vraIdentifier "MyVraIdentifier" -subnetMask $subnetMask} | Should -Throw - } - - $cases = ` - @{defaultGateway = "192.168.1.256"}, ` - @{defaultGateway = "192.168.1"}, ` - @{defaultGateway = "String"}, ` - @{defaultGateway = 192.168.1}, ` - @{defaultGateway = 192.168.1.246}, ` - @{defaultGateway = 32}, ` - @{defaultGateway = ""}, ` - @{defaultGateway = $null} - It "defaultGateway field require valid IP addresses as a String" -TestCases $cases { - param ( $vraIpAddress ) - {Edit-ZertoVra -vraIdentifier "MyVraIdentifier" -defaultGateway $defaultGateway} | Should -Throw - } - - $cases = ` - @{vraIdentifier = ""; paramName = "vraIdentifier"; paramValue = ""}, ` - @{vraIdentifier = $null; paramName = "vraIdentifier"; paramValue = ""}, ` - @{vraIdentifier = "MyVraIdentifier"; paramName = "groupName"; paramValue = ""}, ` - @{vraIdentifier = "MyVraIdentifier"; paramName = "groupName"; paramValue = $null}, ` - @{vraIdentifier = "MyVraIdentifier"; paramName = "vraIpAddress"; paramValue = ""}, ` - @{vraIdentifier = "MyVraIdentifier"; paramName = "vraIpAddress"; paramValue = $null}, ` - @{vraIdentifier = "MyVraIdentifier"; paramName = "subnetMask"; paramValue = ""}, ` - @{vraIdentifier = "MyVraIdentifier"; paramName = "subnetMask"; paramValue = $null}, ` - @{vraIdentifier = "MyVraIdentifier"; paramName = "defaultGateway"; paramValue = ""}, ` - @{vraIdentifier = "MyVraIdentifier"; paramName = "defaultGateway"; paramValue = $null} - - It " does not take empty or null" -TestCases $cases { - param($vraIdentifier, $paramValue, $paramName ) - if ([String]::IsNullOrEmpty($vraIdentifier)) { - {Edit-ZertoVra -vraIdentifier $vraIdentifier} | Should -Throw - } else { - {Edit-ZertoVra -vraIdentifier $vraIdentifier -$paramName $paramValue} | should -Throw - } + it " validates string for a valid IP Address" -TestCases $IpAddrTestCases { + param($ParameterName) + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateScript] }.Count | Should -Be 1 + $attrs.Where{ $_ -is [ValidateScript] }.ScriptBlock | Should -Match '^\$_ \-match \[IPAddress\]\$_' } } - Context "$($File.BaseName)::Function Unit Tests" { + Context "$($global:function)::Function Unit Tests" { - It "Returns a string" { + It "Returns a task id string" { $results = Edit-ZertoVra -vraIdentifier "MyVraIdentifier" -groupName "MyGroup" $results | should not benullorempty $results | should -BeOfType "String" - $results | Should -BeExactly "8dcfdc8e-e5d2-4ba4-9885-f9eb57d92b14.928a122b-1763-4664-ad37-cc00bb883f2f" + $results | Should -BeExactly "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a" + } + + It "Throws an error when the VPG does not exist" { + { Edit-ZertoVra -vraIdentifier "DoesNotExist" -groupName "MyNewGroup" } | Should Throw "VRA with Identifier:" + } + + It "Runs when passed static IP information" { + Edit-ZertoVra -vraIdentifier "MyVraIdentifier" -vraIpAddress "192.168.1.250" -defaultGateway "192.168.1.254" -subnetMask "255.255.255.0" + } + + It "Processes a VRA with a DHCP address" { + Edit-ZertoVra -vraIdentifier "DhcpVraIdentifier" -groupName "MyNewGroup" | Should -BeExactly "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a" } it "Supports 'SupportsShouldProcess'" { - Get-Command $file.BaseName | Should -HaveParameter WhatIf - Get-Command $file.BaseName | Should -HaveParameter Confirm - $file | Should -FileContentMatch 'SupportsShouldProcess' - $file | Should -FileContentMatch '\$PSCmdlet\.ShouldProcess\(.+\)' + Get-Command $global:function | Should -HaveParameter WhatIf + Get-Command $global:function | Should -HaveParameter Confirm + (Get-Command $global:function).ScriptBlock | Should -Match 'SupportsShouldProcess' + (Get-Command $global:function).ScriptBlock | Should -Match '\$PSCmdlet\.ShouldProcess\(.+\)' } } - Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest - Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Get-ZertoVra -} \ No newline at end of file + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -Exactly 3 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Get-ZertoVra -Exactly 4 +} + +Remove-Variable -Name function -Scope Global +Remove-Variable -Name here -Scope Global From 075a78436d4a5d29418e2a5900ac51d48dd2350e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 18:35:13 -0400 Subject: [PATCH 175/479] Add Mock Data Files --- Tests/Public/Mocks/GetVpg.json | 75 ++++++++ Tests/Public/Mocks/ProtectedVms.json | 274 +++++++++++++++++++++++++++ 2 files changed, 349 insertions(+) create mode 100644 Tests/Public/Mocks/GetVpg.json create mode 100644 Tests/Public/Mocks/ProtectedVms.json diff --git a/Tests/Public/Mocks/GetVpg.json b/Tests/Public/Mocks/GetVpg.json new file mode 100644 index 0000000..f1766dc --- /dev/null +++ b/Tests/Public/Mocks/GetVpg.json @@ -0,0 +1,75 @@ +{ + "ActiveProcessesApi": { + "RunningFailOverTestApi": null + }, + "ActualRPO": 7, + "BackupEnabled": false, + "ConfiguredRpoSeconds": 300, + "Entities": { + "Protected": 0, + "Recovery": 0, + "Source": 0, + "Target": 0 + }, + "FailSafeHistory": { + "ActualFailSafeHistory": 60, + "ConfiguredFailSafeHistory": 240, + "FailSafeDescription": "" + }, + "HistoryStatusApi": { + "ActualHistoryInMinutes": 92, + "ConfiguredHistoryInMinutes": 1440, + "EarliestCheckpoint": { + "CheckpointIdentifier": "786", + "Tag": null, + "TimeStamp": "2019-07-20T19:30:19Z" + } + }, + "IOPs": 13, + "LastTest": null, + "Link": { + "href": "https://192.168.10.20:9669/v1/vpgs/57f502ff-3c41-4aff-b20a-6638205b73cd", + "identifier": "57f502ff-3c41-4aff-b20a-6638205b73cd", + "rel": null, + "type": "VpgApi" + }, + "Link_{0}": { + "href": "https://192.168.10.20:9669/v1/vpgs/57f502ff-3c41-4aff-b20a-6638205b73cd", + "rel": "self", + "type": "VpgApi" + }, + "OrganizationName": "", + "Priority": 1, + "ProgressPercentage": 0, + "ProtectedSite": { + "href": "https://192.168.10.20:9669/v1/localsite", + "identifier": "9e09efa0-0d00-46ed-929b-f86273b28205", + "rel": null, + "type": "LocalSiteApi" + }, + "ProvisionedStorageInMB": 336118, + "RecoverySite": { + "href": "https://192.168.10.20:9669/v1/peersites/057cab27-f02a-443a-989d-7f14341fa9c3", + "identifier": "057cab27-f02a-443a-989d-7f14341fa9c3", + "rel": null, + "type": "PeerSiteApi" + }, + "ServiceProfile": null, + "ServiceProfileIdentifier": null, + "ServiceProfileName": "", + "SourceSite": "WCHL - NC", + "Status": 1, + "SubStatus": 0, + "TargetSite": "WCHL - CA", + "ThroughputInMB": 0.27197265625, + "UsedStorageInMB": 245465, + "VmsCount": 4, + "VpgIdentifier": "57f502ff-3c41-4aff-b20a-6638205b73cd", + "VpgName": "ExportStuff", + "Zorg": { + "href": "https://192.168.10.20:9669/v1/zorgs/00000000-0000-0000-0000-000000000000", + "identifier": "00000000-0000-0000-0000-000000000000", + "rel": null, + "type": "ZorgApi" + } +} diff --git a/Tests/Public/Mocks/ProtectedVms.json b/Tests/Public/Mocks/ProtectedVms.json new file mode 100644 index 0000000..8326055 --- /dev/null +++ b/Tests/Public/Mocks/ProtectedVms.json @@ -0,0 +1,274 @@ +[ + { + "ActualRPO": 7, + "EnabledActions": { + "IsFlrEnabled": true + }, + "Entities": { + "Protected": 0, + "Recovery": 0, + "Source": 0, + "Target": 0 + }, + "HardwareVersion": "vmx-15", + "IOPs": 2, + "IsVmExists": true, + "JournalHardLimit": { + "LimitType": 1, + "LimitValue": 153600 + }, + "JournalUsedStorageMb": 640, + "JournalWarningThreshold": { + "LimitType": 1, + "LimitValue": 115200 + }, + "LastTest": null, + "Link": { + "href": "https://192.168.10.20:9669/v1/vms/d4a6a1d5-79e9-4308-990a-7c3e616f0908.vm-38?VpgIdentifier=57f502ff-3c41-4aff-b20a-6638205b73cd", + "identifier": "d4a6a1d5-79e9-4308-990a-7c3e616f0908.vm-38?VpgIdentifier=57f502ff-3c41-4aff-b20a-6638205b73cd", + "rel": null, + "type": "VmApi" + }, + "Link_{0}": { + "href": "https://192.168.10.20:9669/v1/vms/d4a6a1d5-79e9-4308-990a-7c3e616f0908.vm-38?VpgIdentifier=57f502ff-3c41-4aff-b20a-6638205b73cd", + "rel": "self", + "type": "VmApi" + }, + "OrganizationName": "", + "OutgoingBandWidthInMbps": 0.001953125, + "Priority": 1, + "ProtectedSite": { + "href": "https://192.168.10.20:9669/v1/localsite", + "identifier": "9e09efa0-0d00-46ed-929b-f86273b28205", + "rel": null, + "type": "LocalSiteApi" + }, + "ProvisionedStorageInMB": 77906, + "RecoveryHostIdentifier": "f45d81e4-4ff5-4376-a5c8-20ffe8d52431.host-15", + "RecoverySite": { + "href": "https://192.168.10.20:9669/v1/peersites/057cab27-f02a-443a-989d-7f14341fa9c3", + "identifier": "057cab27-f02a-443a-989d-7f14341fa9c3", + "rel": null, + "type": "PeerSiteApi" + }, + "SourceSite": "WCHL - NC", + "Status": 1, + "SubStatus": 0, + "TargetSite": "WCHL - CA", + "ThroughputInMB": 0, + "UsedStorageInMB": 77906, + "VmIdentifier": "d4a6a1d5-79e9-4308-990a-7c3e616f0908.vm-38", + "VmName": "ncesx3.nc.lab", + "Volumes": [ + { + "VmVolumeIdentifier": "scsi:0:0" + } + ], + "VpgIdentifier": "57f502ff-3c41-4aff-b20a-6638205b73cd", + "VpgName": "ExportStuff" + }, + { + "ActualRPO": 7, + "EnabledActions": { + "IsFlrEnabled": true + }, + "Entities": { + "Protected": 0, + "Recovery": 0, + "Source": 0, + "Target": 0 + }, + "HardwareVersion": "vmx-15", + "IOPs": 1, + "IsVmExists": true, + "JournalHardLimit": { + "LimitType": 1, + "LimitValue": 153600 + }, + "JournalUsedStorageMb": 609, + "JournalWarningThreshold": { + "LimitType": 1, + "LimitValue": 115200 + }, + "LastTest": null, + "Link": { + "href": "https://192.168.10.20:9669/v1/vms/d4a6a1d5-79e9-4308-990a-7c3e616f0908.vm-37?VpgIdentifier=57f502ff-3c41-4aff-b20a-6638205b73cd", + "identifier": "d4a6a1d5-79e9-4308-990a-7c3e616f0908.vm-37?VpgIdentifier=57f502ff-3c41-4aff-b20a-6638205b73cd", + "rel": null, + "type": "VmApi" + }, + "Link_{0}": { + "href": "https://192.168.10.20:9669/v1/vms/d4a6a1d5-79e9-4308-990a-7c3e616f0908.vm-37?VpgIdentifier=57f502ff-3c41-4aff-b20a-6638205b73cd", + "rel": "self", + "type": "VmApi" + }, + "OrganizationName": "", + "OutgoingBandWidthInMbps": 0.0009765625, + "Priority": 1, + "ProtectedSite": { + "href": "https://192.168.10.20:9669/v1/localsite", + "identifier": "9e09efa0-0d00-46ed-929b-f86273b28205", + "rel": null, + "type": "LocalSiteApi" + }, + "ProvisionedStorageInMB": 77906, + "RecoveryHostIdentifier": "f45d81e4-4ff5-4376-a5c8-20ffe8d52431.host-15", + "RecoverySite": { + "href": "https://192.168.10.20:9669/v1/peersites/057cab27-f02a-443a-989d-7f14341fa9c3", + "identifier": "057cab27-f02a-443a-989d-7f14341fa9c3", + "rel": null, + "type": "PeerSiteApi" + }, + "SourceSite": "WCHL - NC", + "Status": 1, + "SubStatus": 0, + "TargetSite": "WCHL - CA", + "ThroughputInMB": 0, + "UsedStorageInMB": 77906, + "VmIdentifier": "d4a6a1d5-79e9-4308-990a-7c3e616f0908.vm-37", + "VmName": "ncesx2.nc.lab", + "Volumes": [ + { + "VmVolumeIdentifier": "scsi:0:0" + } + ], + "VpgIdentifier": "57f502ff-3c41-4aff-b20a-6638205b73cd", + "VpgName": "ExportStuff" + }, + { + "ActualRPO": 7, + "EnabledActions": { + "IsFlrEnabled": true + }, + "Entities": { + "Protected": 0, + "Recovery": 0, + "Source": 0, + "Target": 0 + }, + "HardwareVersion": "vmx-15", + "IOPs": 2, + "IsVmExists": true, + "JournalHardLimit": { + "LimitType": 1, + "LimitValue": 153600 + }, + "JournalUsedStorageMb": 634, + "JournalWarningThreshold": { + "LimitType": 1, + "LimitValue": 115200 + }, + "LastTest": null, + "Link": { + "href": "https://192.168.10.20:9669/v1/vms/d4a6a1d5-79e9-4308-990a-7c3e616f0908.vm-36?VpgIdentifier=57f502ff-3c41-4aff-b20a-6638205b73cd", + "identifier": "d4a6a1d5-79e9-4308-990a-7c3e616f0908.vm-36?VpgIdentifier=57f502ff-3c41-4aff-b20a-6638205b73cd", + "rel": null, + "type": "VmApi" + }, + "Link_{0}": { + "href": "https://192.168.10.20:9669/v1/vms/d4a6a1d5-79e9-4308-990a-7c3e616f0908.vm-36?VpgIdentifier=57f502ff-3c41-4aff-b20a-6638205b73cd", + "rel": "self", + "type": "VmApi" + }, + "OrganizationName": "", + "OutgoingBandWidthInMbps": 0.00146484375, + "Priority": 1, + "ProtectedSite": { + "href": "https://192.168.10.20:9669/v1/localsite", + "identifier": "9e09efa0-0d00-46ed-929b-f86273b28205", + "rel": null, + "type": "LocalSiteApi" + }, + "ProvisionedStorageInMB": 77906, + "RecoveryHostIdentifier": "f45d81e4-4ff5-4376-a5c8-20ffe8d52431.host-15", + "RecoverySite": { + "href": "https://192.168.10.20:9669/v1/peersites/057cab27-f02a-443a-989d-7f14341fa9c3", + "identifier": "057cab27-f02a-443a-989d-7f14341fa9c3", + "rel": null, + "type": "PeerSiteApi" + }, + "SourceSite": "WCHL - NC", + "Status": 1, + "SubStatus": 0, + "TargetSite": "WCHL - CA", + "ThroughputInMB": 0, + "UsedStorageInMB": 77906, + "VmIdentifier": "d4a6a1d5-79e9-4308-990a-7c3e616f0908.vm-36", + "VmName": "ncesx1.nc.lab", + "Volumes": [ + { + "VmVolumeIdentifier": "scsi:0:0" + } + ], + "VpgIdentifier": "57f502ff-3c41-4aff-b20a-6638205b73cd", + "VpgName": "ExportStuff" + }, + { + "ActualRPO": 7, + "EnabledActions": { + "IsFlrEnabled": true + }, + "Entities": { + "Protected": 0, + "Recovery": 0, + "Source": 0, + "Target": 0 + }, + "HardwareVersion": "vmx-14", + "IOPs": 5, + "IsVmExists": true, + "JournalHardLimit": { + "LimitType": 1, + "LimitValue": 153600 + }, + "JournalUsedStorageMb": 642, + "JournalWarningThreshold": { + "LimitType": 1, + "LimitValue": 115200 + }, + "LastTest": null, + "Link": { + "href": "https://192.168.10.20:9669/v1/vms/d4a6a1d5-79e9-4308-990a-7c3e616f0908.vm-26?VpgIdentifier=57f502ff-3c41-4aff-b20a-6638205b73cd", + "identifier": "d4a6a1d5-79e9-4308-990a-7c3e616f0908.vm-26?VpgIdentifier=57f502ff-3c41-4aff-b20a-6638205b73cd", + "rel": null, + "type": "VmApi" + }, + "Link_{0}": { + "href": "https://192.168.10.20:9669/v1/vms/d4a6a1d5-79e9-4308-990a-7c3e616f0908.vm-26?VpgIdentifier=57f502ff-3c41-4aff-b20a-6638205b73cd", + "rel": "self", + "type": "VmApi" + }, + "OrganizationName": "", + "OutgoingBandWidthInMbps": 0.01953125, + "Priority": 1, + "ProtectedSite": { + "href": "https://192.168.10.20:9669/v1/localsite", + "identifier": "9e09efa0-0d00-46ed-929b-f86273b28205", + "rel": null, + "type": "LocalSiteApi" + }, + "ProvisionedStorageInMB": 102400, + "RecoveryHostIdentifier": "f45d81e4-4ff5-4376-a5c8-20ffe8d52431.host-15", + "RecoverySite": { + "href": "https://192.168.10.20:9669/v1/peersites/057cab27-f02a-443a-989d-7f14341fa9c3", + "identifier": "057cab27-f02a-443a-989d-7f14341fa9c3", + "rel": null, + "type": "PeerSiteApi" + }, + "SourceSite": "WCHL - NC", + "Status": 1, + "SubStatus": 0, + "TargetSite": "WCHL - CA", + "ThroughputInMB": 0, + "UsedStorageInMB": 11747, + "VmIdentifier": "d4a6a1d5-79e9-4308-990a-7c3e616f0908.vm-26", + "VmName": "nczvm.nc.lab", + "Volumes": [ + { + "VmVolumeIdentifier": "scsi:0:0" + } + ], + "VpgIdentifier": "57f502ff-3c41-4aff-b20a-6638205b73cd", + "VpgName": "ExportStuff" + } +] From 55fb683dc315dd88a8ac9b68caa60ccaab016bde Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 19:18:46 -0400 Subject: [PATCH 176/479] Update Tests to TestCases --- .../Public/Export-ZertoVmNicSetting.Tests.ps1 | 60 ++++++++----------- 1 file changed, 25 insertions(+), 35 deletions(-) diff --git a/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 b/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 index 7e63113..be52ffb 100644 --- a/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 +++ b/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 @@ -1,42 +1,32 @@ #Requires -Modules Pester -#Region - Test Setup -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force -#EndRegion +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 + Context "$global:function::Parameter Unit Tests" { + + $ParameterTestCases = @( + @{ParameterName = 'OutputFile'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'vpgName'; Type = 'String[]'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + it " has validation set" -TestCases $ParameterTestCases { + param($ParameterName) + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } } - Context "$($file.BaseName)::Parameter Unit Tests" { - It "has a mantatory string parameter for the output file" { - Get-Command $file.BaseName | Should -HaveParameter OutputFile -Type String -Mandatory - } - - It "has a non-mandatory string array parameter for vpgName(s) to export" { - Get-Command $file.BaseName | Should -HaveParameter vpgName -Type String[] - Get-Command $file.BaseName | Should -HaveParameter vpgName -Not -Mandatory - } - - It "Output File does not take null or empty string" { - { Export-ZertoVpg -outputFile "" } | Should -Throw - { Export-ZertoVpg -outputFile $null } | Should -Throw - } - - It "Vpg Name parameter does not take null or empty string" { - { Export-ZertoVpg -outputFile ".\ExportedInfo.csv" -vpgName = "" } | Should -Throw - { Export-ZertoVpg -outputFile ".\ExportedInfo.csv" -vpgName = $null } | Should -Throw - } + Context "$global:function::Function Unit Tests" { + } } + +Remove-Variable -Name function -Scope Global +Remove-Variable -Name here -Scope Global From 213329801af8f52fdfb4ba60e9aef8fb2721ccee Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 19:42:48 -0400 Subject: [PATCH 177/479] Update Tests to New Format --- Tests/Public/Export-ZertoVpg.Tests.ps1 | 69 +++++++++++--------------- 1 file changed, 29 insertions(+), 40 deletions(-) diff --git a/Tests/Public/Export-ZertoVpg.Tests.ps1 b/Tests/Public/Export-ZertoVpg.Tests.ps1 index e46b59e..e733e93 100644 --- a/Tests/Public/Export-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Export-ZertoVpg.Tests.ps1 @@ -1,53 +1,39 @@ #Requires -Modules Pester -#Region - Test Setup -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force -#EndRegion +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 - } + Context "$global:function::Parameter Unit Tests" { - Context "$($file.BaseName)::Parameter Unit Tests" { - it "has a mantatory string parameter for the output path" { - Get-Command $file.BaseName | Should -HaveParameter outputPath -Type String -Mandatory + $ParameterTestCases = @( + @{ParameterName = 'OutputPath'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'vpgName'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'allVpgs'; Type = 'Switch'; Mandatory = $true; Validation = $null } + ) + + It " parameter is of type, with correct validation" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type } - it "has a non-mandatory string array parameter for vpgName(s) to export" { - Get-Command $file.BaseName | Should -HaveParameter vpgName -Type String[] -Mandatory - } + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } - it "has a non-mandatory switch parameter to export all vpgs" { - Get-Command $file.BaseName | Should -HaveParameter allVpgs -Type Switch -Mandatory - } - - it "No defined vpgName or AllVpg switch should throw an error" { - {Export-ZertoVpg -outputPath "."} | Should -Throw - } - - it "Output path does not take null or empty string" { - {Export-ZertoVpg -outputPath "" -allVpgs} | Should -Throw - {Export-ZertoVpg -outputPath $null -allVpgs} | Should -Throw - } - - it "Vpg Name parameter does not take null or empty string" { - {Export-ZertoVpg -outputPath "." -vpgName = ""} | Should -Throw - {Export-ZertoVpg -outputPath "." -vpgName = $null} | Should -Throw + $null { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.TypeId.Count | Should -Be 2 + } + } } } - Context "$($file.BaseName)::Function Unit Tests" { + Context "$($global:function)::Function Unit Tests" { Mock -ModuleName ZertoApiWrapper -CommandName Get-ZertoVpg { $returnObj = @{ VpgName = "HRIS" @@ -247,3 +233,6 @@ Describe $file.BaseName -Tag 'Unit' { Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Get-ZertoVpgSetting } } + +Remove-Variable -Name function -Scope Global +Remove-Variable -Name here -Scope Global From 6b1486b74d5b62b45fa8c4bf6694a609723a09e9 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 19:58:48 -0400 Subject: [PATCH 178/479] Update Tests to new format --- Tests/Public/Get-ZertoAlert.Tests.ps1 | 118 ++++++++++---------------- 1 file changed, 43 insertions(+), 75 deletions(-) diff --git a/Tests/Public/Get-ZertoAlert.Tests.ps1 b/Tests/Public/Get-ZertoAlert.Tests.ps1 index d3e1558..39873fd 100644 --- a/Tests/Public/Get-ZertoAlert.Tests.ps1 +++ b/Tests/Public/Get-ZertoAlert.Tests.ps1 @@ -1,84 +1,52 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 + Context "$global:function::Parameter Unit Tests" { + + $ParameterTestCases = @( + @{ParameterName = 'alertId'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'entities'; Type = 'Switch'; Mandatory = $false; Validation = $null } + @{ParameterName = 'helpIdentifiers'; Type = 'Switch'; Mandatory = $false; Validation = $null } + @{ParameterName = 'levels'; Type = 'Switch'; Mandatory = $false; Validation = $null } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'siteIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'zOrgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'level'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'helpIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'isDismissed'; Type = 'bool'; Mandatory = $false; Validation = $null } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + $null { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.TypeId.Count | Should -Be 2 + } + } + } } - Context "$($file.BaseName)::Parameter Unit Tests" { + Context "$global:function::Parameter Functional Tests" { - it "Has a mandatory string parameter for the Alert identifier" { - Get-Command $file.BaseName | Should -HaveParameter alertId - Get-Command $file.BaseName | Should -HaveParameter alertId -Mandatory - Get-Command $file.BaseName | Should -HaveParameter alertId -Type String[] - } - - it "Has a non-mandatory switch parameter for the entities" { - Get-Command $file.BaseName | Should -HaveParameter entities - Get-Command $file.BaseName | Should -HaveParameter entities -Type switch - } - - it "Has a non-mandatory switch parameter for the helpIdentifiers" { - Get-Command $file.BaseName | Should -HaveParameter helpIdentifiers - Get-Command $file.BaseName | Should -HaveParameter helpIdentifiers -Type switch - } - - it "Has a non-mandatory switch parameter for the levels" { - Get-Command $file.BaseName | Should -HaveParameter levels - Get-Command $file.BaseName | Should -HaveParameter levels -Type switch - } - - it "Has a non-mandatory string parameter for the startDate" { - Get-Command $file.BaseName | Should -HaveParameter startDate - Get-Command $file.BaseName | Should -HaveParameter startDate -Type string - } - - it "Has a non-mandatory string parameter for the endDate" { - Get-Command $file.BaseName | Should -HaveParameter endDate - Get-Command $file.BaseName | Should -HaveParameter endDate -Type string - } - - it "Has a non-mandatory string parameter for the vpgIdentifier" { - Get-Command $file.BaseName | Should -HaveParameter vpgIdentifier - Get-Command $file.BaseName | Should -HaveParameter vpgIdentifier -Type string - } - - it "Has a non-mandatory string parameter for the siteIdentifier" { - Get-Command $file.BaseName | Should -HaveParameter siteIdentifier - Get-Command $file.BaseName | Should -HaveParameter siteIdentifier -Type string - } - - it "Has a non-mandatory string parameter for the zorgIdentifier" { - Get-Command $file.BaseName | Should -HaveParameter zorgIdentifier - Get-Command $file.BaseName | Should -HaveParameter zorgIdentifier -Type string - } - - it "Has a non-mandatory string parameter for the level" { - Get-Command $file.BaseName | Should -HaveParameter level - Get-Command $file.BaseName | Should -HaveParameter level -Type string - } - - it "Has a non-mandatory string parameter for the helpIdentifier" { - Get-Command $file.BaseName | Should -HaveParameter helpIdentifier - Get-Command $file.BaseName | Should -HaveParameter helpIdentifier -Type string - } - - it "Has a non-mandatory bool parameter for the isDismissed" { - Get-Command $file.BaseName | Should -HaveParameter isDismissed - Get-Command $file.BaseName | Should -HaveParameter isDismissed -Type bool - } } } +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global + From 047e701f5527061d70544d16f554d60180a51526 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 20:01:02 -0400 Subject: [PATCH 179/479] Update tests to new format --- Tests/Public/Get-ZertoAlert.Tests.ps1 | 1 - Tests/Public/Get-ZertoDatastore.Tests.ps1 | 33 +++++++++++------------ 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/Tests/Public/Get-ZertoAlert.Tests.ps1 b/Tests/Public/Get-ZertoAlert.Tests.ps1 index 39873fd..8f3c29b 100644 --- a/Tests/Public/Get-ZertoAlert.Tests.ps1 +++ b/Tests/Public/Get-ZertoAlert.Tests.ps1 @@ -49,4 +49,3 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Remove-Variable -Name here -Scope Global Remove-Variable -Name function -Scope Global - diff --git a/Tests/Public/Get-ZertoDatastore.Tests.ps1 b/Tests/Public/Get-ZertoDatastore.Tests.ps1 index 294021f..46c470b 100644 --- a/Tests/Public/Get-ZertoDatastore.Tests.ps1 +++ b/Tests/Public/Get-ZertoDatastore.Tests.ps1 @@ -1,24 +1,21 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 + Context "$global:function::Parameter Unit Tests" { + + It "has a non-mandatory string parameter for the datacenterIdentifier" { + Get-Command $file.BaseName | Should -HaveParameter datastoreIdentifier + Get-Command $file.BaseName | Should -HaveParameter datastoreIdentifier -Type String[] + } } - It "has a non-mandatory string parameter for the datacenterIdentifier" { - Get-Command $file.BaseName | Should -HaveParameter datastoreIdentifier - Get-Command $file.BaseName | Should -HaveParameter datastoreIdentifier -Type String[] + Context "$global:function::Parameter Functional Tests" { + } -} \ No newline at end of file +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global From 3e3a4338433db45bfa8ce7818f7673ddd6a8fe06 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 20:03:06 -0400 Subject: [PATCH 180/479] Update tests to new format --- Tests/Public/Get-ZertoLocalSite.Tests.ps1 | 31 +++++++++-------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/Tests/Public/Get-ZertoLocalSite.Tests.ps1 b/Tests/Public/Get-ZertoLocalSite.Tests.ps1 index 03ae2c6..4412139 100644 --- a/Tests/Public/Get-ZertoLocalSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoLocalSite.Tests.ps1 @@ -1,27 +1,20 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { - - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 - } - - Context "$($file.BaseName)::Parameter Unit Tests" { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + Context "$global:function::Parameter Unit Tests" { it "Has a non-mandatory switch parameter for the pairing Statuses" { Get-Command $file.BaseName | Should -HaveParameter pairingstatuses Get-Command $file.BaseName | Should -HaveParameter pairingstatuses -Type switch } } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global From b82912605e68f6a2719348ee1f491f85d63aabb5 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 20:07:02 -0400 Subject: [PATCH 181/479] Update tests to new format --- .../Public/Import-ZertoVmNicSetting.Tests.ps1 | 39 +++++++------------ 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 b/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 index 5647976..a499b6a 100644 --- a/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 +++ b/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 @@ -1,39 +1,26 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { - - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 - } - - Context "$($file.BaseName)::Parameter Unit Tests" { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + Context "$global:function::Parameter Unit Tests" { It "Has a mandatory string array parameter for the settings file to import" { - Get-Command $file.BaseName | Should -HaveParameter InputFile - Get-Command $file.BaseName | Should -HaveParameter InputFile -Mandatory - Get-Command $file.BaseName | Should -HaveParameter InputFile -Type String + Get-Command $global:function | Should -HaveParameter InputFile + Get-Command $global:function | Should -HaveParameter InputFile -Mandatory + Get-Command $global:function | Should -HaveParameter InputFile -Type String } It "Will not accecpt a Null or Empty string for the settings file" { - { Import-ZertoVpg -InputFile $null } | Should -Throw - { Import-ZertoVpg -InputFile "" } | Should -Throw - { Import-ZertoVpg -InputFile @() } | Should -Throw + $attrs = (Get-Command $global:function).Parameters['InputFile'].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 } - } - Context "$($file.BaseName)::Function Unit Tests" { + Context "$global:function::Parameter Functional Tests" { } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global From ff54a92f92005d198995d71358cfa6794b4917c8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 20:10:06 -0400 Subject: [PATCH 182/479] Fix function call var --- Tests/Public/Get-ZertoDatastore.Tests.ps1 | 4 ++-- Tests/Public/Get-ZertoLocalSite.Tests.ps1 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/Public/Get-ZertoDatastore.Tests.ps1 b/Tests/Public/Get-ZertoDatastore.Tests.ps1 index 46c470b..6727a99 100644 --- a/Tests/Public/Get-ZertoDatastore.Tests.ps1 +++ b/Tests/Public/Get-ZertoDatastore.Tests.ps1 @@ -7,8 +7,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { It "has a non-mandatory string parameter for the datacenterIdentifier" { - Get-Command $file.BaseName | Should -HaveParameter datastoreIdentifier - Get-Command $file.BaseName | Should -HaveParameter datastoreIdentifier -Type String[] + Get-Command $global:function | Should -HaveParameter datastoreIdentifier + Get-Command $global:function | Should -HaveParameter datastoreIdentifier -Type String[] } } diff --git a/Tests/Public/Get-ZertoLocalSite.Tests.ps1 b/Tests/Public/Get-ZertoLocalSite.Tests.ps1 index 4412139..4fea226 100644 --- a/Tests/Public/Get-ZertoLocalSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoLocalSite.Tests.ps1 @@ -6,8 +6,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { it "Has a non-mandatory switch parameter for the pairing Statuses" { - Get-Command $file.BaseName | Should -HaveParameter pairingstatuses - Get-Command $file.BaseName | Should -HaveParameter pairingstatuses -Type switch + Get-Command $global:function | Should -HaveParameter pairingstatuses + Get-Command $global:function | Should -HaveParameter pairingstatuses -Type switch } } From c05a5279826ca7731ff2c1cf812a7b7c45623e2f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 20:14:58 -0400 Subject: [PATCH 183/479] Update tests to new format --- Tests/Public/Import-ZertoVpg.Tests.ps1 | 39 +++++++++----------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/Tests/Public/Import-ZertoVpg.Tests.ps1 b/Tests/Public/Import-ZertoVpg.Tests.ps1 index bd91e77..4fd59b3 100644 --- a/Tests/Public/Import-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Import-ZertoVpg.Tests.ps1 @@ -1,39 +1,26 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { - - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 - } - - Context "$($file.BaseName)::Parameter Unit Tests" { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + Context "$global:function::Parameter Unit Tests" { It "Has a mandatory string array parameter for the settings file to import" { - Get-Command $file.BaseName | Should -HaveParameter settingsFile - Get-Command $file.BaseName | Should -HaveParameter settingsFile -Mandatory - Get-Command $file.BaseName | Should -HaveParameter settingsFile -Type String[] + Get-Command $global:function | Should -HaveParameter settingsFile + Get-Command $global:function | Should -HaveParameter settingsFile -Mandatory + Get-Command $global:function | Should -HaveParameter settingsFile -Type String[] } It "Will not accecpt a Null or Empty string for the settings file" { - {Import-ZertoVpg -settingsFile $null} | Should -Throw - {Import-ZertoVpg -settingsFile ""} | Should -Throw - {Import-ZertoVpg -settingsFile @()} | Should -Throw + $attrs = (Get-Command $global:function).Parameters['settingsFile'].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 } - } - Context "$($file.BaseName)::Function Unit Tests" { + Context "$global:function::Parameter Functional Tests" { } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global From 37016076fde9c710f5bd67a1a9bdc0ed4b75839c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 20 Jul 2019 20:56:23 -0400 Subject: [PATCH 184/479] Update to the new format --- Tests/Public/Install-ZertoVra.Tests.ps1 | 143 ++++++-------------- Tests/Public/Invoke-ZertoFailover.Tests.ps1 | 124 +++++++++-------- 2 files changed, 113 insertions(+), 154 deletions(-) diff --git a/Tests/Public/Install-ZertoVra.Tests.ps1 b/Tests/Public/Install-ZertoVra.Tests.ps1 index 598a6e4..e14e10f 100644 --- a/Tests/Public/Install-ZertoVra.Tests.ps1 +++ b/Tests/Public/Install-ZertoVra.Tests.ps1 @@ -1,108 +1,51 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 + Context "$global:function::Parameter Unit Tests" { + $ParameterTestCases = @( + @{ParameterName = 'hostName'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'datastoreName'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'networkName'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'Dhcp'; Type = 'Switch'; Mandatory = $true; Validation = $null } + @{ParameterName = 'vraIpAddress'; Type = 'String'; Mandatory = $true; Validation = 'IpAddr' } + @{ParameterName = 'subnetMask'; Type = 'String'; Mandatory = $true; Validation = 'IpAddr' } + @{ParameterName = 'defaultGateway'; Type = 'String'; Mandatory = $true; Validation = 'IpAddr' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'IpAddr' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateScript] }.Count | Should -Be 1 + $attrs.Where{ $_ -is [ValidateScript] }.ScriptBlock | Should -Match '^\$_ \-match \[IPAddress\]\$_' + } + + $null { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.TypeId.Count | Should -Be 2 + } + } + } } - Context "$($file.BaseName)::Parameter Unit Tests" { + Context "$global:function::Parameter Functional Tests" { - It "Has a mandatory string host name parameter" { - Get-Command $file.BaseName | Should -HaveParameter hostName - Get-Command $file.BaseName | Should -HaveParameter hostName -Mandatory - Get-Command $file.BaseName | Should -HaveParameter hostName -Type String - } - - It "Will not accecpt a Null or Empty string for the host name" { - {Install-ZertoVra -hostName $null -datastoreName "DS01" -networkName "MyNetwork" -Dhcp } | Should -Throw "The argument is null or empty" - {Install-ZertoVra -hostName "" -datastoreName "DS01" -networkName "MyNetwork" -Dhcp } | Should -Throw "The argument is null or empty" - } - - It "Has a mandatory string datastore parameter" { - Get-Command $file.BaseName | Should -HaveParameter datastoreName - Get-Command $file.BaseName | Should -HaveParameter datastoreName -Mandatory - Get-Command $file.BaseName | Should -HaveParameter datastoreName -Type String - } - - It "Will not accecpt a Null or Empty string for the datastore" { - {Install-ZertoVra -hostName "MyfirstHost" -datastoreName $null -networkName "MyNetwork" -Dhcp } | Should -Throw "The argument is null or empty" - {Install-ZertoVra -hostName "MyfirstHost" -datastoreName "" -networkName "MyNetwork" -Dhcp } | Should -Throw "The argument is null or empty" - } - - It "Has a mandatory string network parameter" { - Get-Command $file.BaseName | Should -HaveParameter networkName - Get-Command $file.BaseName | Should -HaveParameter networkName -Mandatory - Get-Command $file.BaseName | Should -HaveParameter networkName -Type String - } - - It "Will not accecpt a Null or Empty string for the datastore" { - {Install-ZertoVra -hostName "MyfirstHost" -datastoreName "DS01" -networkName $null -Dhcp } | Should -Throw "The argument is null or empty" - {Install-ZertoVra -hostName "MyfirstHost" -datastoreName "DS01" -networkName "" -Dhcp } | Should -Throw "The argument is null or empty" - } - - it "Has a switch parameter for setting DHCP" { - Get-Command $file.BaseName | Should -HaveParameter Dhcp - Get-Command $file.BaseName | Should -HaveParameter Dhcp -Mandatory - Get-Command $file.BaseName | Should -HaveParameter Dhcp -Type 'Switch' - - } - - it "Has a mandatory string parameter for the static IP address" { - Get-Command $file.BaseName | Should -HaveParameter vraIpAddress - Get-Command $file.BaseName | Should -HaveParameter vraIpAddress -Mandatory - Get-Command $file.BaseName | Should -HaveParameter vraIpAddress -Type String - } - - it "Has a mandatory string parameter for the subnet mask" { - Get-Command $file.BaseName | Should -HaveParameter subnetMask - Get-Command $file.BaseName | Should -HaveParameter subnetMask -Mandatory - Get-Command $file.BaseName | Should -HaveParameter subnetMask -Type String - } - - it "Has a mandatory string parameter for the default gateway" { - Get-Command $file.BaseName | Should -HaveParameter defaultGateway - Get-Command $file.BaseName | Should -HaveParameter defaultGateway -Mandatory - Get-Command $file.BaseName | Should -HaveParameter defaultGateway -Type String - } - - $cases = ` - @{invalidIpAddress = "192.168.1.256"}, ` - @{invalidIpAddress = "192.168.1"}, ` - @{invalidIpAddress = "String"}, ` - @{invalidIpAddress = 192.168.1.246}, ` - @{invalidIpAddress = 32}, ` - @{invalidIpAddress = ""}, ` - @{invalidIpAddress = $null} - It "IpAddress field require valid IP addresses as a String: " -TestCases $cases { - param ( $invalidIpAddress ) - {Install-ZertoVra -hostName "MyFirstHost" -datastoreName "DS01" -networkName "MyNetwork" -vraIpAddress $invalidIpAddress -subnetMask "255.255.255.0" -defaultGateway "192.168.1.254"} | Should -Throw - } - - It "Default Gateway field require valid IP addresses as a String: " -TestCases $cases { - param ( $invalidIpAddress ) - {Install-ZertoVra -hostName "MyFirstHost" -datastoreName "DS01" -networkName "MyNetwork" -vraIpAddress '192.168.1.100' -subnetMask "255.255.255.0" -defaultGateway $invalidIpAddress} | Should -Throw - } - - It "Subnet Mask field require valid IP addresses as a String: " -TestCases $cases { - param ( $invalidIpAddress ) - {Install-ZertoVra -hostName "MyFirstHost" -datastoreName "DS01" -networkName "MyNetwork" -vraIpAddress '192.168.1.100' -subnetMask $invalidIpAddress -defaultGateway "192.168.1.254"} | Should -Throw - } - - } - - Context "$($file.BaseName)::Function Unit Tests" { - #TODO } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Invoke-ZertoFailover.Tests.ps1 b/Tests/Public/Invoke-ZertoFailover.Tests.ps1 index 8582291..fab5802 100644 --- a/Tests/Public/Invoke-ZertoFailover.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailover.Tests.ps1 @@ -1,77 +1,93 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 - } + Context "$global:function::Parameter Unit Tests" { + $ParameterTestCases = @( + @{ParameterName = 'vpgName'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'checkpointIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'commitPolicy'; Type = 'String'; Mandatory = $false; Validation = 'Set' } + @{ParameterName = 'shutdownPolicy'; Type = 'Int'; Mandatory = $false; Validation = 'Set' } + @{ParameterName = 'timeToWaitBeforeShutdownInSec'; Type = 'Int'; Mandatory = $false; Validation = 'Range' } + @{ParameterName = 'reverseProtection'; Type = 'bool'; Mandatory = $false; Validation = $null } + @{ParameterName = 'vmName'; Type = 'String[]'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'whatIf'; Type = 'Switch'; Mandatory = $false; Validation = 'ShouldProcess' } + ) - Context "$($file.BaseName)::Parameter Unit Tests" { - it "has a mandatory string parameter for the vpgName" { - Get-Command $file.BaseName | Should -HaveParameter vpgName - Get-Command $file.BaseName | Should -HaveParameter vpgName -Type string - Get-Command $file.BaseName | Should -HaveParameter vpgName -Mandatory + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type } - it "has a non-mandatory string parameter for the checkpoint" { - Get-Command $file.BaseName | Should -HaveParameter checkpointIdentifier - Get-Command $file.BaseName | Should -HaveParameter checkpointIdentifier -Type string - Get-Command $file.BaseName | Should -HaveParameter checkpointIdentifier -Not -Mandatory + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Set' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateSet] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + 'Range' { + $scriptBlock = (Get-Command $global:function).ScriptBlock + $scriptBlock | Should -match 'SupportsShouldProcess' + $scriptBlock | Should -match '\$PSCmdlet\.ShouldProcess\(.+\)' + } + + $null { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.TypeId.Count | Should -Be 2 + } + } } - it "has a non-mandatory string parameter for the commit policy" { - Get-Command $file.BaseName | Should -HaveParameter commitPolicy - Get-Command $file.BaseName | Should -HaveParameter commitPolicy -Type string - Get-Command $file.BaseName | Should -HaveParameter commitPolicy -Not -Mandatory - Get-Command $file.BaseName | Should -HaveParameter commitPolicy -DefaultValue "Rollback" + It "Commit Policy Default Value is 'RollBack'" { + Get-Command $global:function | Should -HaveParameter commitPolicy -DefaultValue "Rollback" } - it "has a non-mandatory int parameter for the shutdown policy" { - Get-Command $file.BaseName | Should -HaveParameter shutdownPolicy - Get-Command $file.BaseName | Should -HaveParameter shutdownPolicy -Type int - Get-Command $file.BaseName | Should -HaveParameter shutdownPolicy -Not -Mandatory - Get-Command $file.BaseName | Should -HaveParameter shutdownPolicy -DefaultValue 0 + It "Commit Policy Only Accecpts 'RollBack', 'Commit', or 'None'" { + (Get-Command $global:function).Parameters['commitPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -HaveCount 3 + (Get-Command $global:function).Parameters['commitPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'RollBack' + (Get-Command $global:function).Parameters['commitPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'Commit' + (Get-Command $global:function).Parameters['commitPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'None' } - it "has a non-mandatory int parameter for the time to wait before force shutdown" { - Get-Command $file.BaseName | Should -HaveParameter timeToWaitBeforeShutdownInSec - Get-Command $file.BaseName | Should -HaveParameter timeToWaitBeforeShutdownInSec -Type int - Get-Command $file.BaseName | Should -HaveParameter timeToWaitBeforeShutdownInSec -Not -Mandatory - Get-Command $file.BaseName | Should -HaveParameter timeToWaitBeforeShutdownInSec -DefaultValue 3600 + It "Shutdown Policy Default Value is '0'" { + Get-Command $global:function | Should -HaveParameter shutdownPolicy -DefaultValue 0 } - it "has a non-mandatory bool parameter for the reverse protection policy" { - Get-Command $file.BaseName | Should -HaveParameter reverseProtection - Get-Command $file.BaseName | Should -HaveParameter reverseProtection -Type bool - Get-Command $file.BaseName | Should -HaveParameter reverseProtection -Not -Mandatory + It "Shutdown Policy Only Accecpts 'RollBack', 'Commit', or 'None'" { + (Get-Command $global:function).Parameters['shutdownPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -HaveCount 3 + (Get-Command $global:function).Parameters['shutdownPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 0 + (Get-Command $global:function).Parameters['shutdownPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 1 + (Get-Command $global:function).Parameters['shutdownPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 2 } - it "has a non-mandatory array string parameter for the named VMs to be failed over" { - Get-Command $file.BaseName | Should -HaveParameter vmName - Get-Command $file.BaseName | Should -HaveParameter vmName -Type string[] - Get-Command $file.BaseName | Should -HaveParameter vmName -Not -Mandatory + it "Time to wait before shutdown in sec should have a default value of 3600" { + Get-Command $global:function | Should -HaveParameter timeToWaitBeforeShutdownInSec -DefaultValue 3600 } - it "Supports 'SupportsShouldProcess'" { - Get-Command $file.BaseName | Should -HaveParameter WhatIf - Get-Command $file.BaseName | Should -HaveParameter Confirm - $file | Should -FileContentMatch 'SupportsShouldProcess' - $file | Should -FileContentMatch '\$PSCmdlet\.ShouldProcess\(.+\)' + it "Time to wait before shutdown in sec should have a minimum value of 300 and max value of 86400" { + (Get-Command $global:function).Parameters['timeToWaitBeforeShutdownInSec'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 300 + (Get-Command $global:function).Parameters['timeToWaitBeforeShutdownInSec'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 86400 } } - Context "$($file.BaseName)::Function Unit Tests" { - #TODO + Context "$global:function::Parameter Functional Tests" { + } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global From a39f2638d1245a14373877f7628eae63ed612f70 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 11:36:30 -0400 Subject: [PATCH 185/479] Update to new test format --- .../Invoke-ZertoFailoverCommit.Tests.ps1 | 74 +++++++++++-------- 1 file changed, 43 insertions(+), 31 deletions(-) diff --git a/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 b/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 index 2fa2e2e..aec697f 100644 --- a/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 @@ -1,44 +1,56 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 - } + Context "$global:function::Parameter Unit Tests" { - Context "$($file.BaseName)::Parameter Unit Tests" { - - it "Supports 'ShouldProcess'" { - Get-Command $file.BaseName | Should -HaveParameter WhatIf - Get-Command $file.BaseName | Should -HaveParameter Confirm - $file | Should -FileContentMatch 'SupportsShouldProcess' - $file | Should -FileContentMatch '\$PSCmdlet\.ShouldProcess\(.+\)' + it "$global:function should have exactly 15 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 15 } - it "has a mandatory string parameter for the vpgName" { - Get-Command $file.BaseName | Should -HaveParameter vpgName - Get-Command $file.BaseName | Should -HaveParameter vpgName -Type string[] - Get-Command $file.BaseName | Should -HaveParameter vpgName -Mandatory + $ParameterTestCases = @( + @{ParameterName = 'vpgName'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'reverseProtection'; Type = 'switch'; Mandatory = $false; Validation = $null } + @{ParameterName = 'whatIf'; Type = 'Switch'; Mandatory = $false; Validation = 'ShouldProcess' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type } - it "has a switch parameter for reverse protection" { - Get-Command $file.BaseName | Should -HaveParameter reverseProtection - Get-Command $file.BaseName | Should -HaveParameter reverseProtection -Type switch + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'ShouldProcess' { + $scriptBlock = (Get-Command $global:function).ScriptBlock + $scriptBlock | Should -match 'SupportsShouldProcess' + $scriptBlock | Should -match '\$PSCmdlet\.ShouldProcess\(.+\)' + } + + $null { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.TypeId.Count | Should -Be 2 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } } } - Context "$($file.BaseName)::Function Unit Tests" { - #TODO + Context "$global:function::Parameter Functional Tests" { + } } + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global From 5213614299aae9f85202c099cf5ceec6bc405d3f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 11:36:46 -0400 Subject: [PATCH 186/479] Add Parameter count test --- Tests/Public/Import-ZertoVpg.Tests.ps1 | 4 ++++ Tests/Public/Install-ZertoVra.Tests.ps1 | 4 ++++ Tests/Public/Invoke-ZertoFailover.Tests.ps1 | 10 +++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Tests/Public/Import-ZertoVpg.Tests.ps1 b/Tests/Public/Import-ZertoVpg.Tests.ps1 index 4fd59b3..f0f8969 100644 --- a/Tests/Public/Import-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Import-ZertoVpg.Tests.ps1 @@ -5,6 +5,10 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 12 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 12 + } + It "Has a mandatory string array parameter for the settings file to import" { Get-Command $global:function | Should -HaveParameter settingsFile Get-Command $global:function | Should -HaveParameter settingsFile -Mandatory diff --git a/Tests/Public/Install-ZertoVra.Tests.ps1 b/Tests/Public/Install-ZertoVra.Tests.ps1 index e14e10f..03cb03d 100644 --- a/Tests/Public/Install-ZertoVra.Tests.ps1 +++ b/Tests/Public/Install-ZertoVra.Tests.ps1 @@ -5,6 +5,10 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 22 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 22 + } + $ParameterTestCases = @( @{ParameterName = 'hostName'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } @{ParameterName = 'datastoreName'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } diff --git a/Tests/Public/Invoke-ZertoFailover.Tests.ps1 b/Tests/Public/Invoke-ZertoFailover.Tests.ps1 index fab5802..11dd2f9 100644 --- a/Tests/Public/Invoke-ZertoFailover.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailover.Tests.ps1 @@ -5,6 +5,10 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 20 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 20 + } + $ParameterTestCases = @( @{ParameterName = 'vpgName'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } @{ParameterName = 'checkpointIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } @@ -39,7 +43,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 } - 'Range' { + 'ShouldProcess' { $scriptBlock = (Get-Command $global:function).ScriptBlock $scriptBlock | Should -match 'SupportsShouldProcess' $scriptBlock | Should -match '\$PSCmdlet\.ShouldProcess\(.+\)' @@ -49,6 +53,10 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes $attrs.TypeId.Count | Should -Be 2 } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } } } From 6df14f7a8d9b551e64639fa860a2f24549765f41 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 11:49:08 -0400 Subject: [PATCH 187/479] Parameter Count Test --- Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 b/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 index a499b6a..ce84a86 100644 --- a/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 +++ b/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 @@ -5,6 +5,10 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 11 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 14 + } + It "Has a mandatory string array parameter for the settings file to import" { Get-Command $global:function | Should -HaveParameter InputFile Get-Command $global:function | Should -HaveParameter InputFile -Mandatory From 202c865fe8e04050b55df8f0096b59abe255e8ec Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 11:54:28 -0400 Subject: [PATCH 188/479] Update tests to new format --- .../Invoke-ZertoFailoverRollback.Tests.ps1 | 37 +++++++++--------- Tests/Public/Invoke-ZertoForceSync.Tests.ps1 | 38 +++++++++---------- 2 files changed, 35 insertions(+), 40 deletions(-) diff --git a/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 b/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 index 89cf63f..28f1eb7 100644 --- a/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 @@ -1,28 +1,25 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 - } + Context "$global:function::Parameter Unit Tests" { - Context "$($file.BaseName)::Parameter Unit Tests" { + it "$global:function should have exactly 15 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 12 + } it "has a mandatory string parameter for the vpgName" { - Get-Command $file.BaseName | Should -HaveParameter vpgName - Get-Command $file.BaseName | Should -HaveParameter vpgName -Type string[] - Get-Command $file.BaseName | Should -HaveParameter vpgName -Mandatory + Get-Command $global:function | Should -HaveParameter vpgName + Get-Command $global:function | Should -HaveParameter vpgName -Type string[] + Get-Command $global:function | Should -HaveParameter vpgName -Mandatory } } -} \ No newline at end of file + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 b/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 index 89cf63f..2e6830d 100644 --- a/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 @@ -1,28 +1,26 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 - } + Context "$global:function::Parameter Unit Tests" { - Context "$($file.BaseName)::Parameter Unit Tests" { + it "$global:function should have exactly 15 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 12 + } it "has a mandatory string parameter for the vpgName" { - Get-Command $file.BaseName | Should -HaveParameter vpgName - Get-Command $file.BaseName | Should -HaveParameter vpgName -Type string[] - Get-Command $file.BaseName | Should -HaveParameter vpgName -Mandatory + Get-Command $global:function | Should -HaveParameter vpgName + Get-Command $global:function | Should -HaveParameter vpgName -Type string[] + Get-Command $global:function | Should -HaveParameter vpgName -Mandatory } } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global From e1720dd4f772b5fa3a173a33d4d07c8697d8be86 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 11:56:03 -0400 Subject: [PATCH 189/479] Update test description --- Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 | 2 +- Tests/Public/Invoke-ZertoForceSync.Tests.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 b/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 index 28f1eb7..84109bd 100644 --- a/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 @@ -6,7 +6,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { + it "$global:function should have exactly 12 parameters defined" { (get-command $global:function).Parameters.Count | Should -Be 12 } diff --git a/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 b/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 index 2e6830d..159e825 100644 --- a/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 @@ -6,7 +6,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { + it "$global:function should have exactly 12 parameters defined" { (get-command $global:function).Parameters.Count | Should -Be 12 } From 928d6ef4a1be7c5e89db175bac1e245f944c3967 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 12:09:15 -0400 Subject: [PATCH 190/479] Update tests to new format --- Tests/Public/Invoke-ZertoMove.Tests.ps1 | 130 +++++++++++++----------- 1 file changed, 69 insertions(+), 61 deletions(-) diff --git a/Tests/Public/Invoke-ZertoMove.Tests.ps1 b/Tests/Public/Invoke-ZertoMove.Tests.ps1 index abfb900..6217a52 100644 --- a/Tests/Public/Invoke-ZertoMove.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMove.Tests.ps1 @@ -1,74 +1,82 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 - } - - Context "$($file.BaseName)::Parameter Unit Tests" { - - it "has a mandatory string parameter for the vpgName" { - Get-Command $file.BaseName | Should -HaveParameter vpgName - Get-Command $file.BaseName | Should -HaveParameter vpgName -Type string[] - Get-Command $file.BaseName | Should -HaveParameter vpgName -Mandatory + Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 20 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 20 } - it "has a non-mandatory string parameter for commitPolicy" { - Get-Command $file.BaseName | Should -HaveParameter commitPolicy - Get-Command $file.BaseName | Should -HaveParameter commitPolicy -Type string + $ParameterTestCases = @( + @{ParameterName = 'vpgName'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'commitPolicy'; Type = 'String'; Mandatory = $false; Validation = 'Set' } + @{ParameterName = 'commitPolicyTimeout'; Type = 'Int'; Mandatory = $false; Validation = 'Range' } + @{ParameterName = 'forceShutdown'; Type = 'Switch'; Mandatory = $false; Validation = $null } + @{ParameterName = 'disableReverseProtection'; Type = 'Switch'; Mandatory = $true; Validation = $null } + @{ParameterName = 'keepSourceVms'; Type = 'Switch'; Mandatory = $true; Validation = $null } + @{ParameterName = 'ContinueOnPreScriptFailure'; Type = 'Switch'; Mandatory = $false; Validation = $null } + @{ParameterName = 'whatIf'; Type = 'Switch'; Mandatory = $false; Validation = 'ShouldProcess' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type } - it "CommitPolicy only accecpts 'Rollback', 'Commit', or 'None'" { - { Invoke-ZertoMove -vpgName "MyVpg" -commitPolicy "Rollbackk" } | Should -Throw - { Invoke-ZertoMove -vpgName "MyVpg" -commitPolicy "" } | Should -Throw - { Invoke-ZertoMove -vpgName "MyVpg" -commitPolicy $null } | Should -Throw + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Set' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateSet] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + 'ShouldProcess' { + $scriptBlock = (Get-Command $global:function).ScriptBlock + $scriptBlock | Should -match 'SupportsShouldProcess' + $scriptBlock | Should -match '\$PSCmdlet\.ShouldProcess\(.+\)' + } + + $null { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.TypeId.Count | Should -Be 2 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } } - it "has a non-mandatory int parameter for commitPolicyTimeout" { - Get-Command $file.BaseName | Should -HaveParameter commitPolicyTimeout - Get-Command $file.BaseName | Should -HaveParameter commitPolicyTimeout -Type Int + It "Commit Policy Only Accecpts 'RollBack', 'Commit', or 'None'" { + (Get-Command $global:function).Parameters['commitPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -HaveCount 3 + (Get-Command $global:function).Parameters['commitPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'RollBack' + (Get-Command $global:function).Parameters['commitPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'Commit' + (Get-Command $global:function).Parameters['commitPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'None' } - it "Commit Policy Timeout will only accecpt an int value between 5 minutes and 24 Hours" { - { Invoke-ZertoMove -vpgName "MyVpg" -commitPolicyTimeout 150 } | Should -Throw - { Invoke-ZertoMove -vpgName "MyVpg" -commitPolicyTimeout 15000000 } | Should -Throw - { Invoke-ZertoMove -vpgName "MyVpg" -commitPolicyTimeout -1350 } | Should -Throw - { Invoke-ZertoMove -vpgName "MyVpg" -commitPolicyTimeout $null } | Should -Throw - { Invoke-ZertoMove -vpgName "MyVpg" -commitPolicyTimeout "" } | Should -Throw - } - - it "has a non-mandatory switch parameter for forceShutdown" { - Get-Command $file.BaseName | Should -HaveParameter forceShutdown - Get-Command $file.BaseName | Should -HaveParameter forceShutdown -Type Switch - } - - it "has a mandatory switch parameter for disableReverseProtection" { - Get-Command $file.BaseName | Should -HaveParameter disableReverseProtection - Get-Command $file.BaseName | Should -HaveParameter disableReverseProtection -Type Switch - Get-Command $file.BaseName | Should -HaveParameter disableReverseProtection -Mandatory - } - - it "has a non-mandatory switch parameter for keepSourceVms" { - Get-Command $file.BaseName | Should -HaveParameter keepSourceVms - Get-Command $file.BaseName | Should -HaveParameter keepSourceVms -Type Switch - Get-Command $file.BaseName | Should -HaveParameter keepSourceVms -Mandatory - } - - it "has a non-mandatory switch parameter for ContinueOnPreScriptFailure" { - Get-Command $file.BaseName | Should -HaveParameter ContinueOnPreScriptFailure - Get-Command $file.BaseName | Should -HaveParameter ContinueOnPreScriptFailure -Type Switch + it "Commit Policy Timeout should have a minimum value of 300 and max value of 86400" { + (Get-Command $global:function).Parameters['commitPolicyTimeout'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 300 + (Get-Command $global:function).Parameters['commitPolicyTimeout'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 86400 } } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global From 9be00e68b1fd3dd1bea5092d932af0a8b484b252 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 12:17:33 -0400 Subject: [PATCH 191/479] Update to new test format --- .../Invoke-ZertoFailoverCommit.Tests.ps1 | 4 +- Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 | 70 +++++++++++++------ .../Public/Invoke-ZertoMoveRollback.Tests.ps1 | 37 +++++----- 3 files changed, 68 insertions(+), 43 deletions(-) diff --git a/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 b/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 index aec697f..b8abfd8 100644 --- a/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 @@ -6,8 +6,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + it "$global:function should have exactly 16 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 16 } $ParameterTestCases = @( diff --git a/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 b/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 index 89cf63f..aec697f 100644 --- a/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 @@ -1,28 +1,56 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 - } + Context "$global:function::Parameter Unit Tests" { - Context "$($file.BaseName)::Parameter Unit Tests" { + it "$global:function should have exactly 15 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 15 + } - it "has a mandatory string parameter for the vpgName" { - Get-Command $file.BaseName | Should -HaveParameter vpgName - Get-Command $file.BaseName | Should -HaveParameter vpgName -Type string[] - Get-Command $file.BaseName | Should -HaveParameter vpgName -Mandatory + $ParameterTestCases = @( + @{ParameterName = 'vpgName'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'reverseProtection'; Type = 'switch'; Mandatory = $false; Validation = $null } + @{ParameterName = 'whatIf'; Type = 'Switch'; Mandatory = $false; Validation = 'ShouldProcess' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'ShouldProcess' { + $scriptBlock = (Get-Command $global:function).ScriptBlock + $scriptBlock | Should -match 'SupportsShouldProcess' + $scriptBlock | Should -match '\$PSCmdlet\.ShouldProcess\(.+\)' + } + + $null { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.TypeId.Count | Should -Be 2 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } } } -} \ No newline at end of file + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 b/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 index 89cf63f..53c3383 100644 --- a/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 @@ -1,28 +1,25 @@ #Requires -Modules Pester -$moduleFileName = "ZertoApiWrapper.psd1" -$here = (Split-Path -Parent $MyInvocation.MyCommand.Path).Replace("Tests", "ZertoApiWrapper") -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -$file = Get-ChildItem "$here\$sut" -$modulePath = $here -replace "Public", "" -$moduleFile = Get-ChildItem "$modulePath\$moduleFileName" -Get-Module -Name ZertoApiWrapper | Remove-Module -Force -Import-Module $moduleFile -Force +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] -Describe $file.BaseName -Tag 'Unit' { +Describe $global:function -Tag 'Unit', 'Source', 'Built' { - It "is valid Powershell (Has no script errors)" { - $contents = Get-Content -Path $file -ErrorAction Stop - $errors = $null - $null = [System.Management.Automation.PSParser]::Tokenize($contents, [ref]$errors) - $errors | Should -HaveCount 0 - } + Context "$global:function::Parameter Unit Tests" { - Context "$($file.BaseName)::Parameter Unit Tests" { + it "$global:function should have exactly 14 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 14 + } it "has a mandatory string parameter for the vpgName" { - Get-Command $file.BaseName | Should -HaveParameter vpgName - Get-Command $file.BaseName | Should -HaveParameter vpgName -Type string[] - Get-Command $file.BaseName | Should -HaveParameter vpgName -Mandatory + Get-Command $global:function | Should -HaveParameter vpgName + Get-Command $global:function | Should -HaveParameter vpgName -Type string[] + Get-Command $global:function | Should -HaveParameter vpgName -Mandatory } } -} \ No newline at end of file + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global From efea4944755c5d604f66ded5cb5c27348ab79fe2 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 12:23:27 -0400 Subject: [PATCH 192/479] Update Parameter Counts --- Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 | 4 ++-- Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 b/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 index b8abfd8..aec697f 100644 --- a/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 @@ -6,8 +6,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 16 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 16 + it "$global:function should have exactly 15 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( diff --git a/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 b/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 index aec697f..b8abfd8 100644 --- a/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 @@ -6,8 +6,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + it "$global:function should have exactly 16 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 16 } $ParameterTestCases = @( From fee7cd9723d11bf93f69900e9176e142eee7ad9d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 18:16:25 -0400 Subject: [PATCH 193/479] Add Parameter Validation Tests --- Tests/Public/Get-ZAAlert.Tests.ps1 | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Tests/Public/Get-ZAAlert.Tests.ps1 b/Tests/Public/Get-ZAAlert.Tests.ps1 index e6e6083..9695510 100644 --- a/Tests/Public/Get-ZAAlert.Tests.ps1 +++ b/Tests/Public/Get-ZAAlert.Tests.ps1 @@ -6,6 +6,47 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 14 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 14 + } + + $ParameterTestCases = @( + @{ParameterName = 'zOrgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'limitTo'; Type = 'int'; Mandatory = $false; Validation = 'Range' } + @{ParameterName = 'alertIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "LimitTo Parameter should have a Min value of 1" { + (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 1 + } + + It "LimitTo Parameter should have a Max value of 1000000" { + (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 1000000 + } } Context "$global:function::Parameter Functional Tests" { From 8267474d8acdef51e6b211a0d59dbabc2d465ade Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 18:24:16 -0400 Subject: [PATCH 194/479] Update Mandatory Setting for DatastoreId --- ZertoApiWrapper/Public/Get-ZADatastore.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Get-ZADatastore.ps1 b/ZertoApiWrapper/Public/Get-ZADatastore.ps1 index 60bdc9e..14f074a 100644 --- a/ZertoApiWrapper/Public/Get-ZADatastore.ps1 +++ b/ZertoApiWrapper/Public/Get-ZADatastore.ps1 @@ -20,7 +20,7 @@ function Get-ZADatastore { [Parameter( HelpMessage = "The datastore cluster identifier. Gets a list of datastores in the cluster.", ParameterSetName = "cluster", - Mandatory = "true" + Mandatory = $true )] [ValidateNotNullOrEmpty()] [string]$clusterIdentifier, From 21bc81b0eccb32102dcdaa456164ec9fbb7e293d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 18:24:34 -0400 Subject: [PATCH 195/479] Add Parameter Tests --- Tests/Public/Get-ZADatastore.Tests.ps1 | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Tests/Public/Get-ZADatastore.Tests.ps1 b/Tests/Public/Get-ZADatastore.Tests.ps1 index e6e6083..c148811 100644 --- a/Tests/Public/Get-ZADatastore.Tests.ps1 +++ b/Tests/Public/Get-ZADatastore.Tests.ps1 @@ -5,7 +5,34 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 14 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 14 + } + $ParameterTestCases = @( + @{ParameterName = 'datastoreIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'clusterIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'siteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { From ba1e1c309e386d68681160e00b699b35a0164438 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 19:48:04 -0400 Subject: [PATCH 196/479] Add Parameter Tests --- Tests/Public/Get-ZAEvent.Tests.ps1 | 60 ++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/Tests/Public/Get-ZAEvent.Tests.ps1 b/Tests/Public/Get-ZAEvent.Tests.ps1 index e6e6083..e1e40f6 100644 --- a/Tests/Public/Get-ZAEvent.Tests.ps1 +++ b/Tests/Public/Get-ZAEvent.Tests.ps1 @@ -6,6 +6,66 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 16 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 16 + } + + $ParameterTestCases = @( + @{ParameterName = 'zOrgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'limitTo'; Type = 'int'; Mandatory = $false; Validation = 'Range' } + @{ParameterName = 'category'; Type = 'String'; Mandatory = $false; Validation = 'Set' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + 'Set' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateSet] }.Count | Should -Be 1 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "LimitTo Parameter should have a Min value of 1" { + (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 1 + } + + It "LimitTo Parameter should have a Max value of 1000000" { + (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 1000000 + } + + It "Category parameter should only have 2 options" { + (Get-Command $global:function).Parameters['category'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should Be 2 + } + + It "Category parameter should take 'events'" { + (Get-Command $global:function).Parameters['category'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'events' + } + + It "Category parameter should take 'alertsHistory'" { + (Get-Command $global:function).Parameters['category'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'alertsHistory' + } } Context "$global:function::Parameter Functional Tests" { From c83462d03c7afea54bde819c596ee8ac631e0b6c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 20:08:54 -0400 Subject: [PATCH 197/479] Add Parameter Tests --- .../Get-ZAJournalAverageHistory.Tests.ps1 | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 index e6e6083..80bf748 100644 --- a/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 @@ -6,6 +6,48 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 15 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 15 + } + + $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'interval'; Type = 'Int32'; Mandatory = $false; Validation = 'Range' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "Interval Parameter should have a Min value of 60" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + } + + It "Interval Parameter should have a Max value of 2678400" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + } } Context "$global:function::Parameter Functional Tests" { From 878622d3e2f91338027af7be95a875a7232d21fa Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 20:20:31 -0400 Subject: [PATCH 198/479] Add Parameter Tests --- .../Public/Get-ZAJournalAverageSize.Tests.ps1 | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 index e6e6083..f013489 100644 --- a/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 @@ -5,7 +5,48 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 15 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 15 + } + $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'interval'; Type = 'Int32'; Mandatory = $false; Validation = 'Range' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "Interval Parameter should have a Min value of 60" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + } + + It "Interval Parameter should have a Max value of 2678400" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + } } Context "$global:function::Parameter Functional Tests" { From 356572a1f8bfb367a11140b3a4477ea30a178c07 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 20:24:07 -0400 Subject: [PATCH 199/479] Add Parameter Tests --- Tests/Public/Get-ZAJournalBreach.Tests.ps1 | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Tests/Public/Get-ZAJournalBreach.Tests.ps1 b/Tests/Public/Get-ZAJournalBreach.Tests.ps1 index e6e6083..b0761f1 100644 --- a/Tests/Public/Get-ZAJournalBreach.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalBreach.Tests.ps1 @@ -5,7 +5,34 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 14 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 14 + } + $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { From 7fe361dba7c05caa3f4b7b08c640c999701874f6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 20:26:24 -0400 Subject: [PATCH 200/479] Add Parameter Tests --- .../Public/Get-ZAJournalHistoryStat.Tests.ps1 | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 b/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 index e6e6083..b0761f1 100644 --- a/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 @@ -5,7 +5,34 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 14 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 14 + } + $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { From aaa505c7905cdcec4c4c75e487b72c2ecbee286a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 20:30:22 -0400 Subject: [PATCH 201/479] Add Parameter Tests --- .../Get-ZAJournalSiteAverageHistory.Tests.ps1 | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 index e6e6083..6583c27 100644 --- a/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 @@ -5,7 +5,48 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 15 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 15 + } + $ParameterTestCases = @( + @{ParameterName = 'recoverySiteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'interval'; Type = 'Int32'; Mandatory = $false; Validation = 'Range' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "Interval Parameter should have a Min value of 60" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + } + + It "Interval Parameter should have a Max value of 2678400" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + } } Context "$global:function::Parameter Functional Tests" { From fc3a2a0193eb1abd9f3e6b56fba6ede182c96773 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 20:31:53 -0400 Subject: [PATCH 202/479] Add Parameter Tests --- .../Get-ZAJournalSiteAverageSize.Tests.ps1 | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 index e6e6083..6583c27 100644 --- a/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 @@ -5,7 +5,48 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 15 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 15 + } + $ParameterTestCases = @( + @{ParameterName = 'recoverySiteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'interval'; Type = 'Int32'; Mandatory = $false; Validation = 'Range' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "Interval Parameter should have a Min value of 60" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + } + + It "Interval Parameter should have a Max value of 2678400" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + } } Context "$global:function::Parameter Functional Tests" { From 6bc6f902fd4c706be83bdb77ab12ab9948886ae3 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 20:33:19 -0400 Subject: [PATCH 203/479] Add Parameter Tests --- .../Get-ZAJournalSiteHistoryStat.Tests.ps1 | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 index e6e6083..6583c27 100644 --- a/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 @@ -5,7 +5,48 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 15 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 15 + } + $ParameterTestCases = @( + @{ParameterName = 'recoverySiteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'interval'; Type = 'Int32'; Mandatory = $false; Validation = 'Range' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "Interval Parameter should have a Min value of 60" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + } + + It "Interval Parameter should have a Max value of 2678400" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + } } Context "$global:function::Parameter Functional Tests" { From c578ec428ee08744884f8f8846e708930ffa91f1 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 20:35:26 -0400 Subject: [PATCH 204/479] Add Parameter Tests --- .../Get-ZAJournalSiteHistorySummary.Tests.ps1 | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 index e6e6083..6583c27 100644 --- a/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 @@ -5,7 +5,48 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 15 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 15 + } + $ParameterTestCases = @( + @{ParameterName = 'recoverySiteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'interval'; Type = 'Int32'; Mandatory = $false; Validation = 'Range' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "Interval Parameter should have a Min value of 60" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + } + + It "Interval Parameter should have a Max value of 2678400" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + } } Context "$global:function::Parameter Functional Tests" { From c8da65120058355be03784330046f0a07f686333 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 20:37:32 -0400 Subject: [PATCH 205/479] Add Parameter Tests --- .../Get-ZAJournalSiteSizeStat.Tests.ps1 | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 index e6e6083..6583c27 100644 --- a/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 @@ -5,7 +5,48 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 15 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 15 + } + $ParameterTestCases = @( + @{ParameterName = 'recoverySiteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'interval'; Type = 'Int32'; Mandatory = $false; Validation = 'Range' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "Interval Parameter should have a Min value of 60" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + } + + It "Interval Parameter should have a Max value of 2678400" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + } } Context "$global:function::Parameter Functional Tests" { From 79542e8f7ff7d992b2ff013754454ab6ae9f0c21 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 20:41:05 -0400 Subject: [PATCH 206/479] Add Parameter Tests --- .../Get-ZAJournalStatusProportion.Tests.ps1 | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 b/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 index e6e6083..b0761f1 100644 --- a/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 @@ -5,7 +5,34 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 14 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 14 + } + $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { From 96803e1ad560927049df5563231652dcab1f75d1 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 20:42:12 -0400 Subject: [PATCH 207/479] Add Parameter Tests --- .../Public/Get-ZAJournalStorageStat.Tests.ps1 | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 b/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 index e6e6083..b0761f1 100644 --- a/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 @@ -5,7 +5,34 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 14 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 14 + } + $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { From 5e12656a4a865a2effdb0d76670e0c3cd8156b5b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 20:44:35 -0400 Subject: [PATCH 208/479] Add Parameter Tests --- Tests/Public/Get-ZAJournalSummary.Tests.ps1 | 27 +++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Tests/Public/Get-ZAJournalSummary.Tests.ps1 b/Tests/Public/Get-ZAJournalSummary.Tests.ps1 index e6e6083..b0761f1 100644 --- a/Tests/Public/Get-ZAJournalSummary.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSummary.Tests.ps1 @@ -5,7 +5,34 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 14 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 14 + } + $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { From d2eddea4bc94e47072a7a8b27440cdcffe525e36 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 20:51:01 -0400 Subject: [PATCH 209/479] Add Parameter Tests --- Tests/Public/Get-ZALicense.Tests.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tests/Public/Get-ZALicense.Tests.ps1 b/Tests/Public/Get-ZALicense.Tests.ps1 index e6e6083..c7e8462 100644 --- a/Tests/Public/Get-ZALicense.Tests.ps1 +++ b/Tests/Public/Get-ZALicense.Tests.ps1 @@ -5,7 +5,9 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - + it "$global:function should have exactly 11 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 11 + } } Context "$global:function::Parameter Functional Tests" { From 6a924067c9278aadfd86a0cac4c1e77d3faf06ac Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 21 Jul 2019 20:57:25 -0400 Subject: [PATCH 210/479] Add Parameter Tests --- Tests/Public/Get-ZAMonitoring.Tests.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Tests/Public/Get-ZAMonitoring.Tests.ps1 b/Tests/Public/Get-ZAMonitoring.Tests.ps1 index e6e6083..69c36ca 100644 --- a/Tests/Public/Get-ZAMonitoring.Tests.ps1 +++ b/Tests/Public/Get-ZAMonitoring.Tests.ps1 @@ -5,7 +5,14 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 12 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 12 + } + it "$global:function has a non-mandatory string parameter for the zOrgIdentifier" { + Get-Command $global:function | Should -HaveParameter zOrgIdentifier -Type String + Get-Command $global:function | Should -HaveParameter zOrgIdentifier -not -Mandatory + } } Context "$global:function::Parameter Functional Tests" { From e07b99613e7a6f0b29e0d2410c5a5637aca5d6c3 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jul 2019 17:08:17 -0400 Subject: [PATCH 211/479] Add Parameter Tests --- .../Get-ZANetworkSiteAverageIOPS.Tests.ps1 | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 index e6e6083..df1588a 100644 --- a/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 @@ -5,7 +5,50 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 17 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 17 + } + $ParameterTestCases = @( + @{ParameterName = 'protectedSiteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'recoverySiteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'zOrgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'interval'; Type = 'Int32'; Mandatory = $false; Validation = 'Range' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "Interval Parameter should have a Min value of 60" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + } + + It "Interval Parameter should have a Max value of 2678400" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + } } Context "$global:function::Parameter Functional Tests" { From 1be09bd7345181c6cb55598622e8dfba73f443eb Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jul 2019 19:52:54 -0400 Subject: [PATCH 212/479] Add Parameter Tests --- ...-ZANetworkSiteAveragePerformance.Tests.ps1 | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 index e6e6083..df1588a 100644 --- a/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 @@ -5,7 +5,50 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 17 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 17 + } + $ParameterTestCases = @( + @{ParameterName = 'protectedSiteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'recoverySiteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'zOrgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'interval'; Type = 'Int32'; Mandatory = $false; Validation = 'Range' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "Interval Parameter should have a Min value of 60" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + } + + It "Interval Parameter should have a Max value of 2678400" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + } } Context "$global:function::Parameter Functional Tests" { From b294f3e6ada66c08f07cc175a95e9e775f97a637 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jul 2019 19:54:39 -0400 Subject: [PATCH 213/479] Add Parameter Tests --- Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 | 34 ++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 index e6e6083..80f948f 100644 --- a/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 @@ -5,7 +5,41 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 16 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 16 + } + $ParameterTestCases = @( + @{ParameterName = 'protectedSiteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'recoverySiteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'zOrgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { From b5a637fe603f1e7fb6af0f58018bdd3d94b7b595 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jul 2019 19:59:02 -0400 Subject: [PATCH 214/479] Add Parameter Tests --- .../Public/Get-ZANetworkSiteSummary.Tests.ps1 | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 index e6e6083..80f948f 100644 --- a/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 @@ -5,7 +5,41 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 16 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 16 + } + $ParameterTestCases = @( + @{ParameterName = 'protectedSiteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'recoverySiteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'zOrgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { From e7512020103cd1c8eddc56320d8573433cf6ae4e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jul 2019 20:03:52 -0400 Subject: [PATCH 215/479] Add Parameter Tests --- .../Get-ZANetworkVpgAverageIOPS.Tests.ps1 | 41 +++++++++++++++++++ ...t-ZANetworkVpgAveragePerformance.Tests.ps1 | 41 +++++++++++++++++++ 2 files changed, 82 insertions(+) diff --git a/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 index e6e6083..191f7a9 100644 --- a/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 @@ -5,7 +5,48 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 + } + $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'interval'; Type = 'Int32'; Mandatory = $false; Validation = 'Range' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "Interval Parameter should have a Min value of 60" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + } + + It "Interval Parameter should have a Max value of 2678400" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + } } Context "$global:function::Parameter Functional Tests" { diff --git a/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 index e6e6083..191f7a9 100644 --- a/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 @@ -5,7 +5,48 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 + } + $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'interval'; Type = 'Int32'; Mandatory = $false; Validation = 'Range' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "Interval Parameter should have a Min value of 60" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + } + + It "Interval Parameter should have a Max value of 2678400" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + } } Context "$global:function::Parameter Functional Tests" { From 28fabd592c058f4cfe6f2fe9aa27140f71ece754 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jul 2019 20:09:03 -0400 Subject: [PATCH 216/479] Add Parameter Tests --- Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 | 32 +++++++++++++++++++ .../Public/Get-ZANetworkVpgSummary.Tests.ps1 | 32 +++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 index e6e6083..e9026db 100644 --- a/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 @@ -5,7 +5,39 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 + } + $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { diff --git a/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 index e6e6083..e9026db 100644 --- a/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 @@ -5,7 +5,39 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 + } + $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { From ad6b154d851393d82e8d4b39a2ebe29fe2f883d7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jul 2019 20:52:34 -0400 Subject: [PATCH 217/479] Add Parameter Tests --- .../Public/Get-ZARPOAccountAverage.Tests.ps1 | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 b/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 index e6e6083..18f58ae 100644 --- a/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 +++ b/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 @@ -5,7 +5,34 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 + } + $ParameterTestCases = @( + @{ParameterName = 'zOrgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { From 1d6c2289e831a29460ce2b30ed7f11283b20bd32 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jul 2019 21:20:45 -0400 Subject: [PATCH 218/479] Add Parameter Tests --- Tests/Public/Get-ZARPOAverage.Tests.ps1 | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Tests/Public/Get-ZARPOAverage.Tests.ps1 b/Tests/Public/Get-ZARPOAverage.Tests.ps1 index e6e6083..8619700 100644 --- a/Tests/Public/Get-ZARPOAverage.Tests.ps1 +++ b/Tests/Public/Get-ZARPOAverage.Tests.ps1 @@ -5,7 +5,48 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 + } + $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'Interval'; Type = 'Int32'; Mandatory = $false; Validation = 'Range' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "Interval Parameter should have a Min value of 60" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + } + + It "Interval Parameter should have a Max value of 2678400" { + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + } } Context "$global:function::Parameter Functional Tests" { From c6b37c24a61b2f7d996cb5667768f1500a16d3b8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jul 2019 21:22:24 -0400 Subject: [PATCH 219/479] Add Parameter Tests --- Tests/Public/Get-ZARPOBreach.Tests.ps1 | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Tests/Public/Get-ZARPOBreach.Tests.ps1 b/Tests/Public/Get-ZARPOBreach.Tests.ps1 index e6e6083..38456f9 100644 --- a/Tests/Public/Get-ZARPOBreach.Tests.ps1 +++ b/Tests/Public/Get-ZARPOBreach.Tests.ps1 @@ -5,7 +5,34 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 + } + $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { From 51a1e0fb033953ee27b98fe1f9f45232b0e49a96 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jul 2019 21:27:14 -0400 Subject: [PATCH 220/479] Add Parameter Tests --- Tests/Public/Get-ZARPOStat.Tests.ps1 | 27 +++++++++++++++++++ .../Get-ZARPOStatusProportion.Tests.ps1 | 27 +++++++++++++++++++ Tests/Public/Get-ZARPOSummary.Tests.ps1 | 27 +++++++++++++++++++ 3 files changed, 81 insertions(+) diff --git a/Tests/Public/Get-ZARPOStat.Tests.ps1 b/Tests/Public/Get-ZARPOStat.Tests.ps1 index e6e6083..38456f9 100644 --- a/Tests/Public/Get-ZARPOStat.Tests.ps1 +++ b/Tests/Public/Get-ZARPOStat.Tests.ps1 @@ -5,7 +5,34 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 + } + $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { diff --git a/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 b/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 index e6e6083..38456f9 100644 --- a/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 +++ b/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 @@ -5,7 +5,34 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 + } + $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { diff --git a/Tests/Public/Get-ZARPOSummary.Tests.ps1 b/Tests/Public/Get-ZARPOSummary.Tests.ps1 index e6e6083..38456f9 100644 --- a/Tests/Public/Get-ZARPOSummary.Tests.ps1 +++ b/Tests/Public/Get-ZARPOSummary.Tests.ps1 @@ -5,7 +5,34 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 + } + $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { From c96836c0008a9520df2987bc6377e00210de9c09 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jul 2019 21:46:31 -0400 Subject: [PATCH 221/479] Add Parameter Tests --- Tests/Public/Get-ZASite.Tests.ps1 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Tests/Public/Get-ZASite.Tests.ps1 b/Tests/Public/Get-ZASite.Tests.ps1 index e6e6083..fd61b07 100644 --- a/Tests/Public/Get-ZASite.Tests.ps1 +++ b/Tests/Public/Get-ZASite.Tests.ps1 @@ -5,6 +5,17 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 12 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 12 + } + + It "zOrgIdentifier Parameter should be present and of 'String' Type" { + Get-Command $global:function | Should -HaveParameter zOrgIdentifier -Type String -Mandatory:$false + } + + It "zOrgIdentifier has the NotNullOrEmpty Validator" { + (Get-Command $global:function).Parameters['zOrgIdentifier'].Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should Be 1 + } } From baf6aa50eec7ac131f217904fee5815e736f3af1 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jul 2019 21:55:28 -0400 Subject: [PATCH 222/479] Add Parameter Tests --- Tests/Public/Get-ZASitePair.Tests.ps1 | 27 +++++++++++++++++++++++ Tests/Public/Get-ZASiteTopology.Tests.ps1 | 25 +++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/Tests/Public/Get-ZASitePair.Tests.ps1 b/Tests/Public/Get-ZASitePair.Tests.ps1 index e6e6083..18f58ae 100644 --- a/Tests/Public/Get-ZASitePair.Tests.ps1 +++ b/Tests/Public/Get-ZASitePair.Tests.ps1 @@ -5,7 +5,34 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 + } + $ParameterTestCases = @( + @{ParameterName = 'zOrgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { diff --git a/Tests/Public/Get-ZASiteTopology.Tests.ps1 b/Tests/Public/Get-ZASiteTopology.Tests.ps1 index e6e6083..f1136ba 100644 --- a/Tests/Public/Get-ZASiteTopology.Tests.ps1 +++ b/Tests/Public/Get-ZASiteTopology.Tests.ps1 @@ -5,7 +5,32 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 12 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 12 + } + $ParameterTestCases = @( + @{ParameterName = 'zOrgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { From 27694899390daecac9605cea7b30e708210d8c73 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 23 Jul 2019 12:27:11 -0400 Subject: [PATCH 223/479] Create Parameter Tests --- Tests/Public/Get-ZATask.Tests.ps1 | 40 +++++++++++++++++++++++++++++ Tests/Public/Get-ZAVolume.Tests.ps1 | 32 +++++++++++++++++++++-- Tests/Public/Get-ZAVpg.Tests.ps1 | 30 ++++++++++++++++++++-- Tests/Public/Get-ZAzOrg.Tests.ps1 | 4 ++- 4 files changed, 101 insertions(+), 5 deletions(-) diff --git a/Tests/Public/Get-ZATask.Tests.ps1 b/Tests/Public/Get-ZATask.Tests.ps1 index e6e6083..7e712d4 100644 --- a/Tests/Public/Get-ZATask.Tests.ps1 +++ b/Tests/Public/Get-ZATask.Tests.ps1 @@ -5,7 +5,47 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 + } + $ParameterTestCases = @( + @{ParameterName = 'zOrgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'limitTo'; Type = 'Int'; Mandatory = $false; Validation = 'Range' } + @{ParameterName = 'taskIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "Interval Parameter should have a Min value of 1" { + (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 1 + } + + It "Interval Parameter should have a Max value of 1000000" { + (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 1000000 + } } Context "$global:function::Parameter Functional Tests" { diff --git a/Tests/Public/Get-ZAVolume.Tests.ps1 b/Tests/Public/Get-ZAVolume.Tests.ps1 index e6e6083..c4b6a8c 100644 --- a/Tests/Public/Get-ZAVolume.Tests.ps1 +++ b/Tests/Public/Get-ZAVolume.Tests.ps1 @@ -5,11 +5,39 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 + } - } + $ParameterTestCases = @( + @{ParameterName = 'siteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'clusterIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'datastoreIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + ) - Context "$global:function::Parameter Functional Tests" { + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + Context "$global:function::Parameter Functional Tests" { + + } } } diff --git a/Tests/Public/Get-ZAVpg.Tests.ps1 b/Tests/Public/Get-ZAVpg.Tests.ps1 index e6e6083..ae44aa0 100644 --- a/Tests/Public/Get-ZAVpg.Tests.ps1 +++ b/Tests/Public/Get-ZAVpg.Tests.ps1 @@ -5,11 +5,37 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 13 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 13 + } - } + $ParameterTestCases = @( + @{ParameterName = 'zOrgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + ) - Context "$global:function::Parameter Functional Tests" { + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + Context "$global:function::Parameter Functional Tests" { + + } } } diff --git a/Tests/Public/Get-ZAzOrg.Tests.ps1 b/Tests/Public/Get-ZAzOrg.Tests.ps1 index e6e6083..8ac00f2 100644 --- a/Tests/Public/Get-ZAzOrg.Tests.ps1 +++ b/Tests/Public/Get-ZAzOrg.Tests.ps1 @@ -5,7 +5,9 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - + It "$global:function should have exactly 11 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 11 + } } Context "$global:function::Parameter Functional Tests" { From 4e7d30ef332bf8c8605234c74f53a839e7cdbe8e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 23 Jul 2019 12:30:30 -0400 Subject: [PATCH 224/479] Add NullOrEmpty validation test --- Tests/Public/Get-ZertoDatastore.Tests.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tests/Public/Get-ZertoDatastore.Tests.ps1 b/Tests/Public/Get-ZertoDatastore.Tests.ps1 index 6727a99..5deb346 100644 --- a/Tests/Public/Get-ZertoDatastore.Tests.ps1 +++ b/Tests/Public/Get-ZertoDatastore.Tests.ps1 @@ -10,6 +10,10 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Get-Command $global:function | Should -HaveParameter datastoreIdentifier Get-Command $global:function | Should -HaveParameter datastoreIdentifier -Type String[] } + + It "datastoreIdentifier parameter does not take null or empty values" { + (Get-Command $global:function).Parameters['datastoreIdentifier'].Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.count | Should Be 1 + } } Context "$global:function::Parameter Functional Tests" { From fd1619351edc8eca8b8dc3faa9ea6257ddca952e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 23 Jul 2019 12:51:13 -0400 Subject: [PATCH 225/479] Update Parameter Tests --- Tests/Public/Get-ZertoEvent.Tests.ps1 | 103 ++++++++++++++++++++++ ZertoApiWrapper/Public/Get-ZertoEvent.ps1 | 2 +- 2 files changed, 104 insertions(+), 1 deletion(-) diff --git a/Tests/Public/Get-ZertoEvent.Tests.ps1 b/Tests/Public/Get-ZertoEvent.Tests.ps1 index e6e6083..b257e26 100644 --- a/Tests/Public/Get-ZertoEvent.Tests.ps1 +++ b/Tests/Public/Get-ZertoEvent.Tests.ps1 @@ -5,7 +5,110 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 28 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 28 + } + $ParameterTestCases = @( + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'vpg'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'eventType'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'siteName'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'siteIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'zOrgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'entityType'; Type = 'String'; Mandatory = $false; Validation = 'Set' } + @{ParameterName = 'userName'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'category'; Type = 'String'; Mandatory = $false; Validation = 'Set' } + @{ParameterName = 'eventCategory'; Type = 'String'; Mandatory = $false; Validation = 'Set' } + @{ParameterName = 'alertIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'eventId'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'categories'; Type = 'Switch'; Mandatory = $true; Validation = $null } + @{ParameterName = 'entities'; Type = 'Switch'; Mandatory = $true; Validation = $null } + @{ParameterName = 'types'; Type = 'Switch'; Mandatory = $true; Validation = $null } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Set' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateSet] }.Count | Should -Be 1 + } + + $null { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.TypeId.Count | Should -Be 2 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "entityType parameter only accecpts 4 different values" { + (Get-Command $global:function).Parameters['entityType'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should be 4 + } + + It "entityType parameter accecpts 'VPG' as a Value" { + (Get-Command $global:function).Parameters['entityType'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'VPG' + } + + It "entityType parameter accecpts 'VRA' as a Value" { + (Get-Command $global:function).Parameters['entityType'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'VRA' + } + + It "entityType parameter accecpts 'Unknown' as a Value" { + (Get-Command $global:function).Parameters['entityType'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'Unknown' + } + + It "entityType parameter accecpts 'Site' as a Value" { + (Get-Command $global:function).Parameters['entityType'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'Site' + } + + It "category parameter only accecpts 3 different values" { + (Get-Command $global:function).Parameters['category'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should be 3 + } + + It "category parameter accecpts 'All' as a Value" { + (Get-Command $global:function).Parameters['category'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'All' + } + + It "category parameter accecpts 'events' as a Value" { + (Get-Command $global:function).Parameters['category'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'events' + } + + It "category parameter accecpts 'alerts' as a Value" { + (Get-Command $global:function).Parameters['category'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'alerts' + } + + It "eventCategory parameter only accecpts 3 different values" { + (Get-Command $global:function).Parameters['eventCategory'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should be 3 + } + + It "eventCategory parameter accecpts 'All' as a Value" { + (Get-Command $global:function).Parameters['eventCategory'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'All' + } + + It "eventCategory parameter accecpts 'events' as a Value" { + (Get-Command $global:function).Parameters['eventCategory'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'events' + } + + It "eventCategory parameter accecpts 'alerts' as a Value" { + (Get-Command $global:function).Parameters['eventCategory'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'alerts' + } } Context "$global:function::Parameter Functional Tests" { diff --git a/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 b/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 index 1c45ee8..76584f6 100644 --- a/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 @@ -69,7 +69,7 @@ function Get-ZertoEvent { ParameterSetName = "filter", HelpMessage = "The type of event to return. This filter behaves in the same way as the eventCategory filter. Possible Values are: Possible Values are: 'All', 'Events', 'Alerts'" )] - [ValidateNotNullOrEmpty()] + [ValidateSet('All','Events','Alerts')] [string]$category, [Parameter( ParameterSetName = "filter", From 73884ef022c546af93ba5e3f5f084346c2c650c8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 23 Jul 2019 12:57:01 -0400 Subject: [PATCH 226/479] Update Parameter Tests --- Tests/Public/Get-ZertoLicense.Tests.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tests/Public/Get-ZertoLicense.Tests.ps1 b/Tests/Public/Get-ZertoLicense.Tests.ps1 index e6e6083..8ac00f2 100644 --- a/Tests/Public/Get-ZertoLicense.Tests.ps1 +++ b/Tests/Public/Get-ZertoLicense.Tests.ps1 @@ -5,7 +5,9 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - + It "$global:function should have exactly 11 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 11 + } } Context "$global:function::Parameter Functional Tests" { From 8b0def7c50f8020f395e64cd815bf1741a9f17d2 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 23 Jul 2019 12:59:23 -0400 Subject: [PATCH 227/479] Update Parameter Tests --- Tests/Public/Get-ZertoLocalSite.Tests.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tests/Public/Get-ZertoLocalSite.Tests.ps1 b/Tests/Public/Get-ZertoLocalSite.Tests.ps1 index 4fea226..fe3af42 100644 --- a/Tests/Public/Get-ZertoLocalSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoLocalSite.Tests.ps1 @@ -5,7 +5,11 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "Has a non-mandatory switch parameter for the pairing Statuses" { + It "$global:function should have exactly 12 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 12 + } + + It "Has a non-mandatory switch parameter for the pairing Statuses" { Get-Command $global:function | Should -HaveParameter pairingstatuses Get-Command $global:function | Should -HaveParameter pairingstatuses -Type switch } From 5c2e16d5c6224270dd35fbca7fe1799f130661a4 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 23 Jul 2019 13:13:24 -0400 Subject: [PATCH 228/479] Add Parameter Validation --- ZertoApiWrapper/Public/Get-ZertoPeerSite.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/ZertoApiWrapper/Public/Get-ZertoPeerSite.ps1 b/ZertoApiWrapper/Public/Get-ZertoPeerSite.ps1 index 8f64673..cb86c53 100644 --- a/ZertoApiWrapper/Public/Get-ZertoPeerSite.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoPeerSite.ps1 @@ -22,6 +22,7 @@ function Get-ZertoPeerSite { ParameterSetName = "filter", HelpMessage = "The name of a peer site for which information is to be returned. The name is case-sensitive." )] + [ValidateNotNullOrEmpty()] [string]$peerName, [Parameter ( ParameterSetName = "filter", From 916fbb6c4c90040c67feeb2e97d2b949963a4171 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 23 Jul 2019 13:13:38 -0400 Subject: [PATCH 229/479] Add Parameter Validation Tests --- Tests/Public/Get-ZertoPeerSite.Tests.ps1 | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Tests/Public/Get-ZertoPeerSite.Tests.ps1 b/Tests/Public/Get-ZertoPeerSite.Tests.ps1 index e6e6083..2583c97 100644 --- a/Tests/Public/Get-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoPeerSite.Tests.ps1 @@ -5,7 +5,43 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 18 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 18 + } + $ParameterTestCases = @( + @{ParameterName = 'pairingStatuses'; Type = 'Switch'; Mandatory = $true; Validation = $null } + @{ParameterName = 'siteIdentifier'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'peerName'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'paringStatus'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'location'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'hostName'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'port'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + $null { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.TypeId.Count | Should -Be 2 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } } Context "$global:function::Parameter Functional Tests" { From 551eac5d5a966bcae8b95f61781f5ceafb4bb6be Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 26 Jul 2019 11:06:07 -0400 Subject: [PATCH 230/479] Update release notes for testing changes --- .gitignore | 1 + RELEASENOTES.md | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index be77f6b..ee2dd02 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ BuiltTestResults.xml SourceTestResults.xml publish/* CodeCoverage.xml +scratch diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 33751db..4a6b468 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -10,3 +10,7 @@ * Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/36) where the Zerto Analytics Rest Request function was not checking for the token before attempting a connection. * Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/40) where the `Get-ZAVpg` method would return a 404 error when a `-vpgIdentifier` parameter was specified. + +### General Updates + +* Updated the way that tests are invoked and parsed to ensure that both source and built module files are tested. This will ensure that what is being shipped passes all tests along with testing of the source files. From 7b07fb0fd7c638aedb809f58895aff4b53036fd9 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 29 Jul 2019 08:50:25 -0400 Subject: [PATCH 231/479] Update method to add VMs to Object --- ZertoApiWrapper/Public/New-ZertoVpg.ps1 | 51 +++++++++++-------------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 index a4885f5..bdbc18b 100644 --- a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 @@ -164,64 +164,63 @@ function New-ZertoVpg { begin { # Create an identifiers table, and start converting names to identifiers. - $identifiersTable = @{} + $identifiersTable = @{ } $identifiersTable['recoverySiteIdentifier'] = $(Get-ZertoPeerSite -peerName $recoverySite).siteIdentifier $peerSiteNetworks = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -networks) - $identifiersTable['failoverNetworkIdentifier'] = $peerSiteNetworks | Where-Object {$_.VirtualizationNetworkName -like $recoveryNetwork} | Select-Object -ExpandProperty NetworkIdentifier - $identifiersTable['testNetworkIdentifier'] = $peerSiteNetworks | Where-Object {$_.VirtualizationNetworkName -like $testNetwork} | Select-Object -ExpandProperty NetworkIdentifier - $identifiersTable['folderIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -folders | Where-Object {$_.FolderName -like $recoveryFolder}).folderIdentifier + $identifiersTable['failoverNetworkIdentifier'] = $peerSiteNetworks | Where-Object { $_.VirtualizationNetworkName -like $recoveryNetwork } | Select-Object -ExpandProperty NetworkIdentifier + $identifiersTable['testNetworkIdentifier'] = $peerSiteNetworks | Where-Object { $_.VirtualizationNetworkName -like $testNetwork } | Select-Object -ExpandProperty NetworkIdentifier + $identifiersTable['folderIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -folders | Where-Object { $_.FolderName -like $recoveryFolder }).folderIdentifier if ($PSBoundParameters.ContainsKey("zorg")) { - $identifiersTable['zorgIdentifier'] = $(Get-ZertoZorg | Where-Object {$_.ZorgName -like $zorg}).ZorgIdentifier + $identifiersTable['zorgIdentifier'] = $(Get-ZertoZorg | Where-Object { $_.ZorgName -like $zorg }).ZorgIdentifier } if ($PSBoundParameters.ContainsKey("serviceProfile")) { - $identifiersTable['serviceProfileIdentifier'] = $(Get-ZertoServiceProfile -siteIdentifier $identifiersTable['recoverySiteIdentifier'] | Where-Object {$_.ServiceProfileName -like $serviceProfile}).serviceProfileIdentifier + $identifiersTable['serviceProfileIdentifier'] = $(Get-ZertoServiceProfile -siteIdentifier $identifiersTable['recoverySiteIdentifier'] | Where-Object { $_.ServiceProfileName -like $serviceProfile }).serviceProfileIdentifier } if ($PSBoundParameters.ContainsKey('journalDatastore')) { - $identifiersTable['journalDatastore'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastores | Where-Object {$_.DatastoreName -like $journalDatastore}).DatastoreIdentifier + $identifiersTable['journalDatastore'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastores | Where-Object { $_.DatastoreName -like $journalDatastore }).DatastoreIdentifier } # Get identifiers based on parameter set name switch ($PSCmdlet.ParameterSetName) { "recoveryClusterDatastoreCluster" { - $identifiersTable['clusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -hostclusters | Where-Object {$_.VirtualizationClusterName -like $recoveryCluster}).ClusterIdentifier - $identifiersTable['datastoreClusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastoreclusters | Where-Object {$_.DatastoreClusterName -like $datastoreCluster}).DatastoreClusterIdentifier + $identifiersTable['clusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -hostclusters | Where-Object { $_.VirtualizationClusterName -like $recoveryCluster }).ClusterIdentifier + $identifiersTable['datastoreClusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastoreclusters | Where-Object { $_.DatastoreClusterName -like $datastoreCluster }).DatastoreClusterIdentifier } "recoveryClusterDatastore" { - $identifiersTable['clusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -hostclusters | Where-Object {$_.VirtualizationClusterName -like $recoveryCluster}).ClusterIdentifier - $identifiersTable['datastoreIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastores | Where-Object {$_.DatastoreName -like $datastore}).DatastoreIdentifier + $identifiersTable['clusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -hostclusters | Where-Object { $_.VirtualizationClusterName -like $recoveryCluster }).ClusterIdentifier + $identifiersTable['datastoreIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastores | Where-Object { $_.DatastoreName -like $datastore }).DatastoreIdentifier } "recoveryHostDatastoreCluster" { - $identifiersTable['recoveryHostIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -hosts | Where-Object {$_.VirtualizationHostName -like $recoveryHost}).HostIdentifier - $identifiersTable['datastoreClusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastoreclusters | Where-Object {$_.DatastoreClusterName -like $datastoreCluster}).DatastoreClusterIdentifier + $identifiersTable['recoveryHostIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -hosts | Where-Object { $_.VirtualizationHostName -like $recoveryHost }).HostIdentifier + $identifiersTable['datastoreClusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastoreclusters | Where-Object { $_.DatastoreClusterName -like $datastoreCluster }).DatastoreClusterIdentifier } "recoveryHostDatastore" { - $identifiersTable['recoveryHostIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -hosts | Where-Object {$_.VirtualizationHostName -like $recoveryHost}).HostIdentifier - $identifiersTable['datastoreIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastores | Where-Object {$_.DatastoreName -like $datastore}).DatastoreIdentifier + $identifiersTable['recoveryHostIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -hosts | Where-Object { $_.VirtualizationHostName -like $recoveryHost }).HostIdentifier + $identifiersTable['datastoreIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastores | Where-Object { $_.DatastoreName -like $datastore }).DatastoreIdentifier } "recoveryResourcePoolDatastoreCluster" { - $identifiersTable['recoveryResourcePoolIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -resourcepools | Where-Object {$_.ResourcePoolName -like $recoveryResourcePool}).ResourcePoolIdentifier - $identifiersTable['datastoreClusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastoreclusters | Where-Object {$_.DatastoreClusterName -like $datastoreCluster}).DatastoreClusterIdentifier + $identifiersTable['recoveryResourcePoolIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -resourcepools | Where-Object { $_.ResourcePoolName -like $recoveryResourcePool }).ResourcePoolIdentifier + $identifiersTable['datastoreClusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastoreclusters | Where-Object { $_.DatastoreClusterName -like $datastoreCluster }).DatastoreClusterIdentifier } "recoveryResourcePoolDatastore" { - $identifiersTable['recoveryResourcePoolIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -resourcepools | Where-Object {$_.ResourcePoolName -like $recoveryResourcePool}).ResourcePoolIdentifier - $identifiersTable['datastoreIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastores | Where-Object {$_.DatastoreName -like $datastore}).DatastoreIdentifier + $identifiersTable['recoveryResourcePoolIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -resourcepools | Where-Object { $_.ResourcePoolName -like $recoveryResourcePool }).ResourcePoolIdentifier + $identifiersTable['datastoreIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastores | Where-Object { $_.DatastoreName -like $datastore }).DatastoreIdentifier } } $unprotectedVms = Get-ZertoUnprotectedVm $protectedVms = Get-ZertoProtectedVm # Create array of VM identifiers - $vmIdentifiers = @() $vmIdentifiers = foreach ($vm in $protectedVm) { # If the VM is unprotected, get the identifier - $vmIdentifier = $unprotectedVms | Where-Object {$_.vmName -like $vm} | Select-Object -ExpandProperty vmIdentifier + $vmIdentifier = $unprotectedVms | Where-Object { $_.vmName -like $vm } | Select-Object -ExpandProperty vmIdentifier # If the VM is not unprotected, check the protected VMs if ( -not $vmIdentifier) { # Get all identifiers to test if the VM is eligible to be a member of an additional VPG - $results = $protectedVms | Where-Object {$_.VmName -like $vm} | Select-Object -ExpandProperty vmIdentifier + $results = $protectedVms | Where-Object { $_.VmName -like $vm } | Select-Object -ExpandProperty vmIdentifier # If VM is currently a member of 3 VPGs, skip it. If it cannot be found, skip it. Otherwise, set the identifier if ($results.count -eq 3) { Write-Warning "$vm is already a part of 3 VPGs and cannot be part of an additional VPG. Skipping $vm" @@ -314,13 +313,7 @@ function New-ZertoVpg { $baseSettings.Recovery.DefaultDatastoreIdentifier = $identifiersTable['datastoreIdentifier'] } } - # If only 1 VM is selected, force VMs settings to be an array. - If ($vmIdentifiers.count -eq 1) { - $basesettings.Vms = @() - $baseSettings.Vms += $vmIdentifiers - } else { - $baseSettings.Vms = $vmIdentifiers - } + $basesettings.Vms += $vmIdentifiers if ($identifiersTable.ContainsKey('journalDatastore')) { $baseSettings.Journal.DatastoreIdentifier = $identifiersTable['journalDatastore'] } From f5c81a0766e3aa5d6f5d4f87398e44dc5d2c37d9 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 1 Aug 2019 11:50:46 -0400 Subject: [PATCH 232/479] Update RELEASENOTES.md --- RELEASENOTES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 4a6b468..a08b308 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -5,6 +5,7 @@ * Added two functions to aid in bulk updating of NIC information for protected VMs. ([Issue 38](https://github.com/ZertoPublic/ZertoApiWrapper/issues/38)) * [Export-ZertoVmNicSetting](https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Export-ZertoVmNicSettings.md) * [Import-ZertoVmNicSetting](https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Import-ZertoVmNicSettings.md) +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/43) where a VPG being created with a single VM member would not be parsed by the API correctly using PowerShell 5.1 ### Zerto Analytics @@ -14,3 +15,4 @@ ### General Updates * Updated the way that tests are invoked and parsed to ensure that both source and built module files are tested. This will ensure that what is being shipped passes all tests along with testing of the source files. +* Added additional parameter validation tests to several of the functions. On-going effort to complete stand alone unit testing of each function. From a9ea273d557c217d471f5007756e4da32a7dff13 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 1 Aug 2019 11:51:04 -0400 Subject: [PATCH 233/479] Bump Version for Release --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 9084fa2..26aaba0 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.1.0 +1.2.0 From b9598e7e0bc3968e57fa70a71a917873f922b1d5 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 1 Aug 2019 14:11:59 -0400 Subject: [PATCH 234/479] Add Aug Release in recent updates. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 042daa0..5bdc2f7 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ PS> Install-Module -name ZertoApiWrapper ## Recent Updates +* August 1st, 2019: August Release. See [Release Notes](https://github.com/ZertoPublic/ZertoApiWrapper/releases/tag/1.2.0.20190801). * June 16th, 2019: Added functionality for Zerto Analytics. * May 31st, 2019: Implement logic to allow use of this module in both Windows PowerShell 5.1 and PowerShell Core. * March 15th, 2019: Implement Export and Import Functionality. Please See [Export-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Export-ZertoVpg.md) and [Import-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVpg.md) for assistance. No current pre-seed support. From 6cc2e8d61d1298fee508c1e128a38253809c0bff Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 4 Sep 2019 15:45:17 -0400 Subject: [PATCH 235/479] Correct Example Number Typo --- docs/Edit-ZertoVra.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Edit-ZertoVra.md b/docs/Edit-ZertoVra.md index 37b894a..428e5b5 100644 --- a/docs/Edit-ZertoVra.md +++ b/docs/Edit-ZertoVra.md @@ -49,7 +49,7 @@ PS C:\>Edit-ZertoVra -vraIdentifier $vraIdentifier -vraIpAddress "192.168.1.101" Updates the VRA IP address to 192.168.1.101, subnet mask to 255.255.252.0, and default gateway to 192.168.1.1 -### Example 3 +### Example 4 ```powershell PS C:\>Edit-ZertoVra -vraIdentifier $vraIdentifier -defaultGateway "192.168.1.1" ``` From 32f6a6eebc21e134e16e8fa8fb271f7cc4a70930 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 3 Oct 2019 14:32:05 -0400 Subject: [PATCH 236/479] Update function to use new token parameter --- ZertoApiWrapper/Public/Add-ZertoPeerSite.ps1 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/ZertoApiWrapper/Public/Add-ZertoPeerSite.ps1 b/ZertoApiWrapper/Public/Add-ZertoPeerSite.ps1 index ecf104e..9cbd5db 100644 --- a/ZertoApiWrapper/Public/Add-ZertoPeerSite.ps1 +++ b/ZertoApiWrapper/Public/Add-ZertoPeerSite.ps1 @@ -6,21 +6,30 @@ function Add-ZertoPeerSite { Mandatory = $true, HelpMessage = "Target Hostname or IP address to pair the localsite to." )] - [ValidateScript( {$_ -match [IPAddress]$_ } )] + [ValidateScript( { $_ -match [IPAddress]$_ } )] [string]$targetHost, [Parameter( HelpMessage = "Target communication port. Default is 9081" )] [ValidateRange(1024, 65535)] - [int]$targetPort = 9081 + [int]$targetPort = 9081, + [Parameter( + HelpMessage = "The generated token from the destination site. Note: This is only supported when both sites support pairing authentication. This was implemented to support ZVR 7.5 and later." + )] + [ValidateNotNullOrEmpty()] + [string]$token ) begin { - $baseUri = "peersites" - $body = @{"HostName" = $targetHost; "Port" = $targetPort} } process { + $baseUri = "peersites" + if ($PSBoundParameters.Keys.Contains("token")) { + $body = @{ "HostName" = $targetHost; "Port" = $targetPort; "Token" = $token } + } else { + $body = @{ "HostName" = $targetHost; "Port" = $targetPort } + } if ($PSCmdlet.ShouldProcess("Pairing with Site $targetHost")) { Invoke-ZertoRestRequest -uri $baseUri -body $($body | ConvertTo-Json) -method "POST" } From 0657607f3a7dd0de4ade430743cb1bbb6a97955d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 3 Oct 2019 14:32:36 -0400 Subject: [PATCH 237/479] Update Tests to New format and add token parameter tests --- Tests/Public/Add-ZertoPeerSite.Tests.ps1 | 72 ++++++++++++++++-------- 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 index 35927f8..bdf4f52 100644 --- a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 @@ -9,34 +9,55 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - It "Has a mandatory string parameter for the target host" { - Get-Command $global:function | Should -HaveParameter TargetHost -Mandatory -Type String + It "$global:function should have exactly 16 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 16 } - It "Will not take a non-ip address as a 'TargetHost'" { - { Add-ZertoPeerSite -targetHost 'MyZVMHost' -targetPort '9081' } | Should -Throw - { Add-ZertoPeerSite -targetHost '192.168.1.266' -targetPort '9081' } | Should -Throw - { Add-ZertoPeerSite -targetHost '192.168.1' -targetPort '9081' } | Should -Throw - { Add-ZertoPeerSite -targetHost $null -targetPort '9081' } | Should -Throw + $ParameterTestCases = @( + @{ParameterName = 'targetHost'; Type = 'String'; Mandatory = $true; Validation = 'Script' } + @{ParameterName = 'targetPort'; Type = 'Int32'; Mandatory = $false; Validation = 'Range' } + @{ParameterName = 'token'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type } - It "Has a non-mandatory string parameter for the target port with default value of 9081" { - Get-Command Add-ZertoPeerSite | Should -HaveParameter TargetPort -Not -Mandatory - Get-Command Add-ZertoPeerSite | Should -HaveParameter TargetPort -Type Int32 - Get-Command Add-ZertoPeerSite | Should -HaveParameter TargetPort -DefaultValue 9081 + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'Script' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateScript] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } } - It "Will not take a non-int as a port" { - { Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort 'string' } | Should -Throw - { Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort $true } | Should -Throw - { Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort $null } | Should -Throw + It "targetPort Parameter should have a default value of 9081" { + Get-Command $global:function | Should -HaveParameter targetPort -DefaultValue 9081 } - It "Will fail if the specified port is outside of the range 1024 - 65535" { - { Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort 1023 } | Should -Throw - { Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort 65536 } | Should -Throw - { Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort 0 } | Should -Throw - { Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort -1 } | Should -Throw + It "targetPort Parameter should have a Min value of 1024" { + (Get-Command $global:function).Parameters['targetPort'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 1024 + } + + It "targetPort Parameter should have a Max value of 65535" { + (Get-Command $global:function).Parameters['targetPort'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 65535 } It "Supports 'SupportsShouldProcess'" { @@ -52,19 +73,26 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { return (Get-Content "$global:here\Mocks\TaskId.txt") } - It "Returns a string value" { + It "Returns a string value when no Token Passed" { $results = Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort '9081' $results | Should -Not -BeNullOrEmpty $results | Should -BeOfType "String" $results | Should -BeExactly "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a" } + It "Returns a string value when a Token is passed" { + $results = Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort '9081' -token "NotARealTokenString" + $results | Should -Not -BeNullOrEmpty + $results | Should -BeOfType "String" + $results | Should -BeExactly "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a" + } + It "Does not return a taskId if '-whatif' is used" { $results = Add-ZertoPeerSite -targetHost '192.168.1.100' -targetPort '9081' -WhatIf $results | Should -BeNullOrEmpty } - Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -Exactly 1 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -Exactly 2 } } Remove-Variable -Name here -Scope Global From 28fb42d56a493428a03fc3a356433e27c84e1f02 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 3 Oct 2019 14:33:01 -0400 Subject: [PATCH 238/479] Update documentation for token parameter and example. --- docs/Add-ZertoPeerSite.md | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/docs/Add-ZertoPeerSite.md b/docs/Add-ZertoPeerSite.md index 2589547..7fafff4 100644 --- a/docs/Add-ZertoPeerSite.md +++ b/docs/Add-ZertoPeerSite.md @@ -13,7 +13,8 @@ Pairs the current Zerto Virtual Manager to the target Zerto Virtual Manager ## SYNTAX ``` -Add-ZertoPeerSite [-targetHost] [[-targetPort] ] [-WhatIf] [-Confirm] [] +Add-ZertoPeerSite [-targetHost] [[-targetPort] ] [-token ] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -23,10 +24,17 @@ Pairs the current Zerto Virtual Manager to the target Zerto Virtual Manager by l ### Example 1 ```powershell -PS C:\> Add-ZertoPeerSite -targetHost "192.168.2.100" -targetPort "9081" +PS C:\> Add-ZertoPeerSite -targetHost "192.168.2.100" ``` -Pairs the current Zerto Virtual Manager to the Zerto Virtual Manager at IP address 192.168.2.100. +Pairs the current Zerto Virtual Manager to the Zerto Virtual Manager at IP address 192.168.2.100. Use this method when pairing Zerto Virtual Managers that are prior to version 7.5 + +### Example 2 +```powershell +PS C:\> Add-ZertoPeerSite -targetHost "192.168.2.100" -token "GeneratedFromTargetZVM" +``` + +Pairs the current Zerto Virtual Manager to the Zerto Virtual Manager at IP address 192.168.2.100. Use this method when pairing Zerto Virtual Managers that are version 7.5 or later. ## PARAMETERS @@ -61,6 +69,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -token +The generated token from the destination site. Note: This is only supported when both sites support pairing authentication. This was implemented to support ZVR 7.5 and later. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Confirm Prompts you for confirmation before running the cmdlet. From d78fc28b1ce219ab8a5cf6a40519b9333f8d970a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 3 Oct 2019 14:33:17 -0400 Subject: [PATCH 239/479] Add ShouldProcess support to help file. --- docs/Import-ZertoVmNicSetting.md | 33 +++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/Import-ZertoVmNicSetting.md b/docs/Import-ZertoVmNicSetting.md index f2a8d62..f16815a 100644 --- a/docs/Import-ZertoVmNicSetting.md +++ b/docs/Import-ZertoVmNicSetting.md @@ -13,7 +13,7 @@ Using a CSV file, will import updated Live and Test network settings for protect ## SYNTAX ``` -Import-ZertoVmNicSetting [-InputFile] [] +Import-ZertoVmNicSetting [-InputFile] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -47,6 +47,36 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### CommonParameters This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). @@ -57,4 +87,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES ## RELATED LINKS + [Zerto Virtual Manager REST API VpgSettings end point documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.110.html%23) From 842c7ceeec0a1d74ac1b55250dacc8d964646f78 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 3 Oct 2019 16:54:56 -0400 Subject: [PATCH 240/479] Added release notes for this update. --- RELEASENOTES.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index a08b308..a1cfdee 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -2,17 +2,9 @@ ### Zerto Virtual Manager -* Added two functions to aid in bulk updating of NIC information for protected VMs. ([Issue 38](https://github.com/ZertoPublic/ZertoApiWrapper/issues/38)) - * [Export-ZertoVmNicSetting](https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Export-ZertoVmNicSettings.md) - * [Import-ZertoVmNicSetting](https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Import-ZertoVmNicSettings.md) -* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/43) where a VPG being created with a single VM member would not be parsed by the API correctly using PowerShell 5.1 +* [Zerto version 7.5 has been released.](https://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Release%20Notes.pdf) As part of this release Zerto has added API functionality that requires the following updates. + * A token is now required to pair two sites together. The need is discussed in [Issue 46](https://github.com/ZertoPublic/ZertoApiWrapper/issues/46). To implement this change a `-token` parameter has been added to the `Add-ZertoPeerSite` function. ### Zerto Analytics -* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/36) where the Zerto Analytics Rest Request function was not checking for the token before attempting a connection. -* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/40) where the `Get-ZAVpg` method would return a 404 error when a `-vpgIdentifier` parameter was specified. - ### General Updates - -* Updated the way that tests are invoked and parsed to ensure that both source and built module files are tested. This will ensure that what is being shipped passes all tests along with testing of the source files. -* Added additional parameter validation tests to several of the functions. On-going effort to complete stand alone unit testing of each function. From 0a90d51735dbb1c02d4d9f397c8d4cdc5ce5a80a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 7 Oct 2019 11:23:10 -0400 Subject: [PATCH 241/479] Create New-ZertoPairingToken.ps1 --- .../Public/New-ZertoPairingToken.ps1 | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ZertoApiWrapper/Public/New-ZertoPairingToken.ps1 diff --git a/ZertoApiWrapper/Public/New-ZertoPairingToken.ps1 b/ZertoApiWrapper/Public/New-ZertoPairingToken.ps1 new file mode 100644 index 0000000..2eca94d --- /dev/null +++ b/ZertoApiWrapper/Public/New-ZertoPairingToken.ps1 @@ -0,0 +1,23 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function New-ZertoPairingToken { + [CmdletBinding(SupportsShouldProcess = $true)] + param ( + + ) + + begin { + + } + + process { + $uri = "peersites/generatetoken" + $body = @{ } + if ($PSCmdlet.ShouldProcess("Obtaining Pairing token from $script:zvmServer")) { + Invoke-ZertoRestRequest -uri $uri -method "POST" -body $($body | ConvertTo-Json) + } + } + + end { + + } +} From e1ba8412ff1d5c5f767a0d242f032a1e1461686a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 7 Oct 2019 11:23:13 -0400 Subject: [PATCH 242/479] Create New-ZertoPairingToken.Tests.ps1 --- Tests/Public/New-ZertoPairingToken.Tests.ps1 | 51 ++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Tests/Public/New-ZertoPairingToken.Tests.ps1 diff --git a/Tests/Public/New-ZertoPairingToken.Tests.ps1 b/Tests/Public/New-ZertoPairingToken.Tests.ps1 new file mode 100644 index 0000000..51ccce7 --- /dev/null +++ b/Tests/Public/New-ZertoPairingToken.Tests.ps1 @@ -0,0 +1,51 @@ +#Requires -Modules Pester +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] + +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + BeforeAll { + $script:ScriptBlock = (Get-Command $global:function).ScriptBlock + } + + Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 13 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 13 + } + + It "Supports 'SupportsShouldProcess'" { + Get-Command $global:function | Should -HaveParameter WhatIf + Get-Command $global:function | Should -HaveParameter Confirm + $script:ScriptBlock | Should -match 'SupportsShouldProcess' + $script:ScriptBlock | Should -match '\$PSCmdlet\.ShouldProcess\(.+\)' + } + } + + Context "$global:function::Parameter Functional Tests" { + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest { + return (Get-Content -Raw "$global:here\Mocks\PairingToken.json" | ConvertFrom-Json) + } + + It "Returns a Token" { + $Token = New-ZertoPairingToken + $Token | Should -Not -Be $Null + $Token.Token | Should -Be "TH15ISN0T4R3AL70KEN" + } + + It "Returns a ExpirationDate" { + $Token = New-ZertoPairingToken + $Token | Should -Not -Be $Null + $Token.UtcExpirationDate | Should -Be "10/09/2019 12:55 PM" + } + + It "Does not return a taskId if '-whatif' is used" { + $results = New-ZertoPairingToken -WhatIf + $results | Should -BeNullOrEmpty + } + + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -Exactly 2 + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global From 90a17045af201a777eb3ec599436d25cd218873e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 7 Oct 2019 11:23:19 -0400 Subject: [PATCH 243/479] Create PairingToken.Json --- Tests/Public/Mocks/PairingToken.Json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Tests/Public/Mocks/PairingToken.Json diff --git a/Tests/Public/Mocks/PairingToken.Json b/Tests/Public/Mocks/PairingToken.Json new file mode 100644 index 0000000..1b34001 --- /dev/null +++ b/Tests/Public/Mocks/PairingToken.Json @@ -0,0 +1,4 @@ +{ + "Token": "TH15ISN0T4R3AL70KEN", + "UtcExpirationDate": "10/09/2019 12:55 PM" +} From f907acd14a634946a5da5f4efe7782eb54b59046 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 7 Oct 2019 11:23:24 -0400 Subject: [PATCH 244/479] Create New-ZertoPairingToken.md --- docs/New-ZertoPairingToken.md | 77 +++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 docs/New-ZertoPairingToken.md diff --git a/docs/New-ZertoPairingToken.md b/docs/New-ZertoPairingToken.md new file mode 100644 index 0000000..ee5f55a --- /dev/null +++ b/docs/New-ZertoPairingToken.md @@ -0,0 +1,77 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/New-ZertoPairingToken.md +schema: 2.0.0 +--- + +# New-ZertoPairingToken + +## SYNOPSIS +Generates a new pairing token to be used during pairing ZVM to ZVM operations. + +## SYNTAX + +``` +New-ZertoPairingToken [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Generates a new pairing token to be used during pairing ZVM to ZVM operations. This token is valid until used or 48 hours have passed, whichever comes first. This feature is only required when pairing two Zerto sites that are both operating Zerto version 7.5 or greater. To use this feature you will need to generate a pairing token from the destination site. Once that token is generated you will use that token to pair the source site to the destination site either via the GUI or via the `Add-ZertoPeerSite` function. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> New-ZertoPairingToken +``` + +Generates an object that will contain the pairing token and expiration date and time. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS +[Zerto REST API Peer Sites End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.046.html%23) From 29a79bbb923b7ebd4906dba15ed57614923f9d00 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 8 Oct 2019 12:31:34 -0400 Subject: [PATCH 245/479] Correct extension case. --- Tests/Public/Mocks/{PairingToken.Json => PairingToken.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Tests/Public/Mocks/{PairingToken.Json => PairingToken.json} (100%) diff --git a/Tests/Public/Mocks/PairingToken.Json b/Tests/Public/Mocks/PairingToken.json similarity index 100% rename from Tests/Public/Mocks/PairingToken.Json rename to Tests/Public/Mocks/PairingToken.json From e706470395691432315419ffbc6d35ae9d2e5c3d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 8 Oct 2019 12:37:11 -0400 Subject: [PATCH 246/479] Add `New-ZertoPairingToken` to Release notes. --- RELEASENOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index a1cfdee..0cddecd 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -4,6 +4,7 @@ * [Zerto version 7.5 has been released.](https://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Release%20Notes.pdf) As part of this release Zerto has added API functionality that requires the following updates. * A token is now required to pair two sites together. The need is discussed in [Issue 46](https://github.com/ZertoPublic/ZertoApiWrapper/issues/46). To implement this change a `-token` parameter has been added to the `Add-ZertoPeerSite` function. + * A new function has been added; `New-ZertoPairingToken`. This function will allow users to generate a pairing authentication token from the target ZVM to be used in the pairing process. [Issue 47](https://github.com/ZertoPublic/ZertoApiWrapper/issues) covers additional details. ### Zerto Analytics From 5984bc93c9a8f7cfa5030361cb3e27485ebe04ec Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 12 Oct 2019 22:26:13 -0400 Subject: [PATCH 247/479] Create Copy-ZertoVpg Function --- ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 | 49 ++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 diff --git a/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 new file mode 100644 index 0000000..67ef11c --- /dev/null +++ b/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 @@ -0,0 +1,49 @@ +function Copy-ZertoVpg { + [CmdletBinding()] + param ( + # VPG Name to Clone + [Parameter(Mandatory, + HelpMessage = "Name of the VPG to clone")] + [ValidateNotNullOrEmpty()] + [String]$VpgName, + # Name of VMs to add to the VPG + [Parameter(Mandatory, + HelpMessage = "Name(s) of the Virtual Machine(s) to add to the VPG")] + [ValidateNotNullOrEmpty()] + [String[]]$VMs + ) + + begin { + + } + + process { + $VpgIdToCopy = @{ VpgIdentifier = (Get-ZertoVpg -vpgName $VpgName).vpgIdentifier } + if ( $null -eq $VpgIdToCopy.VpgIdentifier ) { + Write-Error -Message "Unable to find a VPG with the name: $VpgName. Please check the name and try again." + Break + } elseif ($VpgIdToCopy.VpgIdentifier.Count -gt 1) { + Write-Error -Message "More than one VPG was returned when searching for the VPG name: $VpgName. Please try again." + Break + } + $BaseUri = "vpgSettings/copyVpgSettings" + $UnprotectedVms = Get-ZertoUnprotectedVm + $ProtectedVms = Get-ZertoProtectedVm + $VMsToAdd = foreach ($VM in $VMs) { + if ($UnprotectedVms.VmName -contains $VM) { + $UnprotectedVms | Where-Object { $_.VmName -like $VM } | Select-Object -ExpandProperty VmIdentifier + } elseif ($ProtectedVms.VmName -contains $VM) { + $ProtectedVms | Where-Object { $_.VmName -like $VM } | Select-Object -ExpandProperty VmIdentifier + } else { + Write-Warning -Message "Unable to find VM with Name $VM. Skipping." + } + } + $NewVpgId = Invoke-ZertoRestRequest -Uri $BaseUri -body ($VpgIdToCopy | ConvertTo-Json) -Method "POST" + $Uri = "{0}/{1}/vms" -f $BaseUri, $NewVpgId.VpgIdentifier + Invoke-ZertoRestRequest -Uri $Uri -Body ($VMsToAdd | ConvertTo-Json) -Method "PUT" + } + + end { + + } +} From 42b923cef5f9852929269cfaa607318886bd6b79 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 22 Oct 2019 13:26:10 -0400 Subject: [PATCH 248/479] Create EvacuateVra Function --- .../Public/Invoke-ZertoEvacuateVra.ps1 | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 diff --git a/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 new file mode 100644 index 0000000..9e6eb0f --- /dev/null +++ b/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 @@ -0,0 +1,58 @@ +function Invoke-ZertoEvacuateVra { + [CmdletBinding(SupportsShouldProcess, DefaultParameterSetName = "VraIdentifier")] + param ( + # HostName Option + [Parameter( + Mandatory, + HelpMessage = "Name of the Host to Evacuate", + ParameterSetName = "HostName" + )] + [String]$HostName, + # VRA Option + [Parameter( + Mandatory, + HelpMessage = "Name of the VRA to Evacuate", + ParameterSetName = "VraName" + )] + [String]$VraName, + # VRAIdentifier Option + [Parameter( + Mandatory, + HelpMessage, "Identifier of the VRA to be evacuated", + ParameterSetName = "VraIdentifier", + ValueFromPipelineByPropertyName, + ValueFromPipeline + )] + [Alias("VraId", "Identifier")] + [String]$VraIdentifier + ) + + begin { + + } + + process { + switch ($PSCmdlet.ParameterSetName) { + "HostName" { + $VraName = "Z-VRA-" + $HostName + Invoke-ZertoEvacuateVra -VraName $VraName + } + + "VraName" { + $VraIdentifier = (Get-ZertoVra -vraName $VraName).Identifier + Invoke-ZertoEvacuateVra -VraIdentifier $VraIdentifier + } + + "VraIdentifier" { + $Uri = "vras/{0}/changerecoveryvra/execute" -f $VraIdentifier + if ($PSCmdlet.ShouldProcess($VraIdentifier, "Evacuating VRA with Identifier:")) { + Invoke-ZertoRestRequest -Uri $Uri -Method "POST" + } + } + } + } + + end { + + } +} From 28d66806a552c051e4659d108137787b68147201 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 22 Oct 2019 13:31:10 -0400 Subject: [PATCH 249/479] Add ExternalHelp Def --- ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 index 9e6eb0f..0fd15f4 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 @@ -1,3 +1,4 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Invoke-ZertoEvacuateVra { [CmdletBinding(SupportsShouldProcess, DefaultParameterSetName = "VraIdentifier")] param ( From 4a0885f731cdaacedc32d5eeda8ad0b16f33c701 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 22 Oct 2019 13:35:49 -0400 Subject: [PATCH 250/479] Fix Help Message Typo --- ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 index 0fd15f4..c1100a6 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 @@ -19,7 +19,7 @@ function Invoke-ZertoEvacuateVra { # VRAIdentifier Option [Parameter( Mandatory, - HelpMessage, "Identifier of the VRA to be evacuated", + HelpMessage = "Identifier of the VRA to be evacuated", ParameterSetName = "VraIdentifier", ValueFromPipelineByPropertyName, ValueFromPipeline From 30422d0421973fdb81fac166b7cd9c0f6c275614 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 23 Oct 2019 09:52:09 -0400 Subject: [PATCH 251/479] Create Invoke-ZertoEvacuateVra.md --- docs/Invoke-ZertoEvacuateVra.md | 147 ++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 docs/Invoke-ZertoEvacuateVra.md diff --git a/docs/Invoke-ZertoEvacuateVra.md b/docs/Invoke-ZertoEvacuateVra.md new file mode 100644 index 0000000..bea1ad3 --- /dev/null +++ b/docs/Invoke-ZertoEvacuateVra.md @@ -0,0 +1,147 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZertoEvacuateVra.md +schema: 2.0.0 +--- + +# Invoke-ZertoEvacuateVra + +## SYNOPSIS +This operation will move all VMs currently replicating to the selected host or VRA to different hosts based on internal Zerto algorithms. + +## SYNTAX + +### VraIdentifier (Default) +``` +Invoke-ZertoEvacuateVra -VraIdentifier [-WhatIf] [-Confirm] [] +``` + +### HostName +``` +Invoke-ZertoEvacuateVra -HostName [-WhatIf] [-Confirm] [] +``` + +### VraName +``` +Invoke-ZertoEvacuateVra -VraName [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +This operation will move all VMs currently replicating to the selected host or VRA to different hosts based on internal Zerto algorithms. + +This will return a Zerto Task Identifier so the task progress can be tracked. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Invoke-ZertoEvacuateVra -HostName 'host01' +``` + +Will move all VMs currently replicating to the selected host to different hosts. + +### Example 2 +```powershell +PS C:\> Invoke-ZertoEvacuateVra -VraName 'Z-VRA-host01' +``` + +Will move all VMs currently replicating to the selected VRA to different VRAs. + +### Example 3 +```powershell +PS C:\> Invoke-ZertoEvacuateVra -VraIdentifier '1234-1234-4312-9856' +``` + +Will move all VMs currently replicating to the selected VRA to different VRAs. + +## PARAMETERS + +### -HostName +HostName Option + +```yaml +Type: String +Parameter Sets: HostName +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VraIdentifier +VRAIdentifier Option + +```yaml +Type: String +Parameter Sets: VraIdentifier +Aliases: VraId, Identifier + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -VraName +VRA Option + +```yaml +Type: String +Parameter Sets: VraName +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS +[Zerto REST API Evacuate VRA End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.129.html%23) + From 7641d283071196cd6d3d936d2ef704f53204ef4b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 23 Oct 2019 10:00:42 -0400 Subject: [PATCH 252/479] Add parameter validation --- ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 index c1100a6..72a9cab 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 @@ -8,6 +8,7 @@ function Invoke-ZertoEvacuateVra { HelpMessage = "Name of the Host to Evacuate", ParameterSetName = "HostName" )] + [ValidateNotNullOrEmpty()] [String]$HostName, # VRA Option [Parameter( @@ -15,6 +16,7 @@ function Invoke-ZertoEvacuateVra { HelpMessage = "Name of the VRA to Evacuate", ParameterSetName = "VraName" )] + [ValidateNotNullOrEmpty()] [String]$VraName, # VRAIdentifier Option [Parameter( @@ -25,6 +27,7 @@ function Invoke-ZertoEvacuateVra { ValueFromPipeline )] [Alias("VraId", "Identifier")] + [ValidateNotNullOrEmpty()] [String]$VraIdentifier ) From 07de073bf137b1650ddc9d46b2497a7d4cf2af6d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 24 Oct 2019 07:25:38 -0400 Subject: [PATCH 253/479] Create Invoke-ZertoEvacuateVra.Tests.ps1 --- .../Public/Invoke-ZertoEvacuateVra.Tests.ps1 | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 diff --git a/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 b/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 new file mode 100644 index 0000000..c518f90 --- /dev/null +++ b/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 @@ -0,0 +1,53 @@ +#Requires -Modules Pester +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] + +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + it "$global:function should have exactly 16 parameters defined" { + (get-command $global:function).Parameters.Count | Should -Be 16 + } + + $ParameterTestCases = @( + @{ParameterName = 'hostName'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty'; ParameterSet = @('hostName') } + @{ParameterName = 'vraName'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' ; ParameterSet = @('vraName') } + @{ParameterName = 'vraIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' ; ParameterSet = @('vraIdentifier') } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + $null { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.TypeId.Count | Should -Be 2 + } + } + } + + It " parameter is part of the correct ParameterSet(s)" -TestCases $ParameterTestCases { + param($ParameterName, $ParameterSet) + $commandParameterSets = (Get-Command $global:function).Parameters[$ParameterName].ParameterSets + foreach ($Set in $ParameterSet) { + $commandParameterSets.ContainsKey($Set) | Should -BeTrue + } + } + } + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global From 3d8acf03f68ac7231373d3d7012b405591438249 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 24 Oct 2019 13:50:52 -0400 Subject: [PATCH 254/479] Update Tests to include set counts --- Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 b/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 index c518f90..47629c7 100644 --- a/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 16 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 16 + It "$global:function should have exactly 16 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 16 } $ParameterTestCases = @( @@ -41,6 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { foreach ($Set in $ParameterSet) { $commandParameterSets.ContainsKey($Set) | Should -BeTrue } + $commandParameterSets.Count | Should -Be $ParameterSet.Count } } From b4a7df970c1fa0ad01bca00fc270ef581ab590a3 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 24 Oct 2019 13:51:26 -0400 Subject: [PATCH 255/479] Correct VraIdentifier Property --- ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 index 72a9cab..d01ae9e 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoEvacuateVra.ps1 @@ -43,7 +43,7 @@ function Invoke-ZertoEvacuateVra { } "VraName" { - $VraIdentifier = (Get-ZertoVra -vraName $VraName).Identifier + $VraIdentifier = (Get-ZertoVra -vraName $VraName).VraIdentifier Invoke-ZertoEvacuateVra -VraIdentifier $VraIdentifier } From 1ca3d6704b6dcffff3cef0ff3cff0f3178e975b9 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 25 Oct 2019 13:49:59 -0400 Subject: [PATCH 256/479] Update Release Notes for Evacuate Function --- RELEASENOTES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 0cddecd..88b7fb5 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -4,7 +4,8 @@ * [Zerto version 7.5 has been released.](https://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Release%20Notes.pdf) As part of this release Zerto has added API functionality that requires the following updates. * A token is now required to pair two sites together. The need is discussed in [Issue 46](https://github.com/ZertoPublic/ZertoApiWrapper/issues/46). To implement this change a `-token` parameter has been added to the `Add-ZertoPeerSite` function. - * A new function has been added; `New-ZertoPairingToken`. This function will allow users to generate a pairing authentication token from the target ZVM to be used in the pairing process. [Issue 47](https://github.com/ZertoPublic/ZertoApiWrapper/issues) covers additional details. + * A new function has been added; `New-ZertoPairingToken`. This function will allow users to generate a pairing authentication token from the target ZVM to be used in the pairing process. [Issue 47](https://github.com/ZertoPublic/ZertoApiWrapper/issues/47) covers additional details. + * A new function has been added; `Invoke-ZertoEvacuateVra`. This function will allow users to evacuate a target VRA by specifying a Host Name, VRA Name, or VRA Identifier. All VMs currently replicating to the specified location will be migrated to different targets. [Issue 51](https://github.com/ZertoPublic/ZertoApiWrapper/issues/51) ### Zerto Analytics From 10785df8a99ef7cea480d156452949f4e28f92c6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 12 Oct 2019 22:26:13 -0400 Subject: [PATCH 257/479] Create Copy-ZertoVpg Function --- ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 | 49 ++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 diff --git a/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 new file mode 100644 index 0000000..67ef11c --- /dev/null +++ b/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 @@ -0,0 +1,49 @@ +function Copy-ZertoVpg { + [CmdletBinding()] + param ( + # VPG Name to Clone + [Parameter(Mandatory, + HelpMessage = "Name of the VPG to clone")] + [ValidateNotNullOrEmpty()] + [String]$VpgName, + # Name of VMs to add to the VPG + [Parameter(Mandatory, + HelpMessage = "Name(s) of the Virtual Machine(s) to add to the VPG")] + [ValidateNotNullOrEmpty()] + [String[]]$VMs + ) + + begin { + + } + + process { + $VpgIdToCopy = @{ VpgIdentifier = (Get-ZertoVpg -vpgName $VpgName).vpgIdentifier } + if ( $null -eq $VpgIdToCopy.VpgIdentifier ) { + Write-Error -Message "Unable to find a VPG with the name: $VpgName. Please check the name and try again." + Break + } elseif ($VpgIdToCopy.VpgIdentifier.Count -gt 1) { + Write-Error -Message "More than one VPG was returned when searching for the VPG name: $VpgName. Please try again." + Break + } + $BaseUri = "vpgSettings/copyVpgSettings" + $UnprotectedVms = Get-ZertoUnprotectedVm + $ProtectedVms = Get-ZertoProtectedVm + $VMsToAdd = foreach ($VM in $VMs) { + if ($UnprotectedVms.VmName -contains $VM) { + $UnprotectedVms | Where-Object { $_.VmName -like $VM } | Select-Object -ExpandProperty VmIdentifier + } elseif ($ProtectedVms.VmName -contains $VM) { + $ProtectedVms | Where-Object { $_.VmName -like $VM } | Select-Object -ExpandProperty VmIdentifier + } else { + Write-Warning -Message "Unable to find VM with Name $VM. Skipping." + } + } + $NewVpgId = Invoke-ZertoRestRequest -Uri $BaseUri -body ($VpgIdToCopy | ConvertTo-Json) -Method "POST" + $Uri = "{0}/{1}/vms" -f $BaseUri, $NewVpgId.VpgIdentifier + Invoke-ZertoRestRequest -Uri $Uri -Body ($VMsToAdd | ConvertTo-Json) -Method "PUT" + } + + end { + + } +} From 8b3a3b3b0b373094c92b4895c99aed6e2f915617 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 4 Nov 2019 16:20:31 -0500 Subject: [PATCH 258/479] Update Connect-ZertoServer.md --- docs/Connect-ZertoServer.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/Connect-ZertoServer.md b/docs/Connect-ZertoServer.md index 8c657b7..160ac31 100644 --- a/docs/Connect-ZertoServer.md +++ b/docs/Connect-ZertoServer.md @@ -106,5 +106,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS [Zerto REST API Session End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.068.html%23) + [PSCredential Documentation](https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.pscredential?view=pscore-6.0.0) + [Get-Credential Documentation](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/get-credential?view=powershell-6) From 5f978d7b1a686864779fb4fa03464817a40ee1c8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 7 Nov 2019 17:43:18 -0500 Subject: [PATCH 259/479] Fix AddVM Logic --- ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 | 38 +++++++++++++++++------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 index 67ef11c..3a22c37 100644 --- a/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 @@ -1,12 +1,17 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Copy-ZertoVpg { - [CmdletBinding()] + [CmdletBinding(SupportsShouldProcess)] param ( # VPG Name to Clone [Parameter(Mandatory, HelpMessage = "Name of the VPG to clone")] [ValidateNotNullOrEmpty()] - [String]$VpgName, - # Name of VMs to add to the VPG + [String]$SourceVpgName, + # New VPG Name + [Parameter(Mandatory, + HelpMessage = "Name to assign the newly created VPG")] + [ValidateNotNullOrEmpty()] + [String]$NewVpgName, # Name of VMs to add to the VPG [Parameter(Mandatory, HelpMessage = "Name(s) of the Virtual Machine(s) to add to the VPG")] [ValidateNotNullOrEmpty()] @@ -18,12 +23,12 @@ function Copy-ZertoVpg { } process { - $VpgIdToCopy = @{ VpgIdentifier = (Get-ZertoVpg -vpgName $VpgName).vpgIdentifier } + $VpgIdToCopy = @{ VpgIdentifier = (Get-ZertoVpg -vpgName $SourceVpgName).vpgIdentifier } if ( $null -eq $VpgIdToCopy.VpgIdentifier ) { - Write-Error -Message "Unable to find a VPG with the name: $VpgName. Please check the name and try again." + Write-Error -Message "Unable to find a VPG with the name: $SourceVpgName. Please check the name and try again." Break } elseif ($VpgIdToCopy.VpgIdentifier.Count -gt 1) { - Write-Error -Message "More than one VPG was returned when searching for the VPG name: $VpgName. Please try again." + Write-Error -Message "More than one VPG was returned when searching for the VPG name: $SourceVpgName. Please try again." Break } $BaseUri = "vpgSettings/copyVpgSettings" @@ -31,16 +36,27 @@ function Copy-ZertoVpg { $ProtectedVms = Get-ZertoProtectedVm $VMsToAdd = foreach ($VM in $VMs) { if ($UnprotectedVms.VmName -contains $VM) { - $UnprotectedVms | Where-Object { $_.VmName -like $VM } | Select-Object -ExpandProperty VmIdentifier + $VmId = $UnprotectedVms | Where-Object { $_.VmName -like $VM } | Select-Object -ExpandProperty VmIdentifier } elseif ($ProtectedVms.VmName -contains $VM) { - $ProtectedVms | Where-Object { $_.VmName -like $VM } | Select-Object -ExpandProperty VmIdentifier + $VmId = $ProtectedVms | Where-Object { $_.VmName -like $VM } | Select-Object -ExpandProperty VmIdentifier } else { Write-Warning -Message "Unable to find VM with Name $VM. Skipping." } + $returnObject = New-Object PSObject + $returnObject | Add-Member -MemberType NoteProperty -Name "VmIdentifier" -Value $VmId + $returnObject } - $NewVpgId = Invoke-ZertoRestRequest -Uri $BaseUri -body ($VpgIdToCopy | ConvertTo-Json) -Method "POST" - $Uri = "{0}/{1}/vms" -f $BaseUri, $NewVpgId.VpgIdentifier - Invoke-ZertoRestRequest -Uri $Uri -Body ($VMsToAdd | ConvertTo-Json) -Method "PUT" + if ($PSCmdlet.ShouldProcess("$VMsToAdd", "Copying $SourceVpgName to $NewVpgName with Settings")) { + $NewVpgId = Invoke-ZertoRestRequest -Uri $BaseUri -Body ($VpgIdToCopy | ConvertTo-Json) -Method "POST" + $Uri = "{0}/{1}/vms" -f "vpgSettings", $NewVpgId + $null = Invoke-ZertoRestRequest -Uri $Uri -Body ($VMsToAdd | ConvertTo-Json) -Method "POST" + $Uri = "vpgSettings/{0}" -f $NewVpgId + $CurrentSettings = Invoke-ZertoRestRequest -Uri $Uri + $CurrentSettings.Basic.Name = $NewVpgName + $Null = Invoke-ZertoRestRequest -Uri $Uri -Method "Put" -Body $($CurrentSettings | ConvertTo-Json -Depth 20) + Save-ZertoVpgSetting -vpgSettingsIdentifier $NewVpgId + } + } end { From 11ab03be0ae568e60ea092566ae0a14d49b0ece1 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 7 Nov 2019 17:43:29 -0500 Subject: [PATCH 260/479] Create Tests --- Tests/Public/Copy-ZertoVpg.Tests.ps1 | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Tests/Public/Copy-ZertoVpg.Tests.ps1 diff --git a/Tests/Public/Copy-ZertoVpg.Tests.ps1 b/Tests/Public/Copy-ZertoVpg.Tests.ps1 new file mode 100644 index 0000000..cd53274 --- /dev/null +++ b/Tests/Public/Copy-ZertoVpg.Tests.ps1 @@ -0,0 +1,56 @@ +#Requires -Modules Pester +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] + +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + BeforeAll { + $script:ScriptBlock = (Get-Command $global:function).ScriptBlock + } + + Context "$($global:function)::Parameter Unit Tests" { + + It "$global:function should have exactly 16 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 16 + } + + $ParameterTestCases = @( + @{ParameterName = 'SourceVpgName'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'NewVpgName'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'VMs'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + $null { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.TypeId.Count | Should -Be 2 + } + } + } + + It "Supports 'SupportsShouldProcess'" { + Get-Command $global:function | Should -HaveParameter WhatIf + Get-Command $global:function | Should -HaveParameter Confirm + $script:ScriptBlock | Should -match 'SupportsShouldProcess' + $script:ScriptBlock | Should -match '\$PSCmdlet\.ShouldProcess\(.+\)' + } + } + + Context "$($global:function)::Function Unit Tests" { + + } +} + +Remove-Variable -Name function -Scope Global +Remove-Variable -Name here -Scope Global From 213b6029e4bc31b0404bc739cd21284dbad1772c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 7 Nov 2019 17:43:40 -0500 Subject: [PATCH 261/479] Create Documentation --- docs/Copy-ZertoVpg.md | 127 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 docs/Copy-ZertoVpg.md diff --git a/docs/Copy-ZertoVpg.md b/docs/Copy-ZertoVpg.md new file mode 100644 index 0000000..6e5436b --- /dev/null +++ b/docs/Copy-ZertoVpg.md @@ -0,0 +1,127 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Copy-ZertoVpg.md +schema: 2.0.0 +--- + +# Copy-ZertoVpg + +## SYNOPSIS +Copy an existing VPG settings object to create a new VPG with the same settings. New VMs must be added to the copied VPG. + +## SYNTAX + +``` +Copy-ZertoVpg -SourceVpgName -NewVpgName [-VMs] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +Copy an existing VPG settings object to create a new VPG with the same settings. New VMs must be added to the copied VPG. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Copy-ZertoVpg -SourceVpgName 'MyVpg' -NewVpgName 'MyNewVpg' -VMs 'VmToAdd01' +``` + +Copies the settings of 'MyVpg' into a new VPG 'MyNewVpg' adding one VM, 'VmToAdd01' + +### Example 2 +```powershell +PS C:\> Copy-ZertoVpg -SourceVpgName 'MyVpg' -NewVpgName 'MyNewVpg' -VMs 'VmToAdd01', 'VmToAdd02' +``` + +Copies the settings of 'MyVpg' into a new VPG 'MyNewVpg' adding two VMs, 'VmToAdd01' and 'VmToAdd02' + +## PARAMETERS + +### -NewVpgName +Name to assign the newly created VPG + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceVpgName +Name of the VPG to clone + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VMs +Name of VMs to add to the VPG + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Clone VPG API Endpoint Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.119.html%23) From cdae2039935bc5b21edac07f9378fcf1bd56c1f5 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 7 Nov 2019 17:44:06 -0500 Subject: [PATCH 262/479] Fix Documentation Formatting --- docs/Invoke-ZertoEvacuateVra.md | 1 + docs/New-ZertoPairingToken.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/Invoke-ZertoEvacuateVra.md b/docs/Invoke-ZertoEvacuateVra.md index bea1ad3..aa0b2e9 100644 --- a/docs/Invoke-ZertoEvacuateVra.md +++ b/docs/Invoke-ZertoEvacuateVra.md @@ -143,5 +143,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES ## RELATED LINKS + [Zerto REST API Evacuate VRA End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.129.html%23) diff --git a/docs/New-ZertoPairingToken.md b/docs/New-ZertoPairingToken.md index ee5f55a..09987b9 100644 --- a/docs/New-ZertoPairingToken.md +++ b/docs/New-ZertoPairingToken.md @@ -74,4 +74,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES ## RELATED LINKS + [Zerto REST API Peer Sites End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.046.html%23) From d6562de9bffd244802c1bf6f2164d875b2d13e54 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 7 Nov 2019 21:37:03 -0500 Subject: [PATCH 263/479] Update for Copy-ZertoVpg --- RELEASENOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 88b7fb5..b97d8b5 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -6,6 +6,7 @@ * A token is now required to pair two sites together. The need is discussed in [Issue 46](https://github.com/ZertoPublic/ZertoApiWrapper/issues/46). To implement this change a `-token` parameter has been added to the `Add-ZertoPeerSite` function. * A new function has been added; `New-ZertoPairingToken`. This function will allow users to generate a pairing authentication token from the target ZVM to be used in the pairing process. [Issue 47](https://github.com/ZertoPublic/ZertoApiWrapper/issues/47) covers additional details. * A new function has been added; `Invoke-ZertoEvacuateVra`. This function will allow users to evacuate a target VRA by specifying a Host Name, VRA Name, or VRA Identifier. All VMs currently replicating to the specified location will be migrated to different targets. [Issue 51](https://github.com/ZertoPublic/ZertoApiWrapper/issues/51) + * A function has been added; `Copy-ZertoVpg`. This function will allow users to copy the settings of a single VPG and add new VMs to it. There is currently no customization beyond specifying the VMs to be placed in the newly created VPG. Should additional edits \ updates be required, they should be done post creation. [Issue 54](https://github.com/ZertoPublic/ZertoApiWrapper/issues/54) ### Zerto Analytics From d6862f75d1bd97b02cdc6638927d75cce0d560ad Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 7 Nov 2019 22:35:40 -0500 Subject: [PATCH 264/479] Fix Bug when Adding Additional VMs --- ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 index 3a22c37..4608c6e 100644 --- a/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 @@ -49,7 +49,9 @@ function Copy-ZertoVpg { if ($PSCmdlet.ShouldProcess("$VMsToAdd", "Copying $SourceVpgName to $NewVpgName with Settings")) { $NewVpgId = Invoke-ZertoRestRequest -Uri $BaseUri -Body ($VpgIdToCopy | ConvertTo-Json) -Method "POST" $Uri = "{0}/{1}/vms" -f "vpgSettings", $NewVpgId - $null = Invoke-ZertoRestRequest -Uri $Uri -Body ($VMsToAdd | ConvertTo-Json) -Method "POST" + foreach ($VM in $VMsToAdd) { + $null = Invoke-ZertoRestRequest -Uri $Uri -Body ($VM | ConvertTo-Json) -Method "POST" + } $Uri = "vpgSettings/{0}" -f $NewVpgId $CurrentSettings = Invoke-ZertoRestRequest -Uri $Uri $CurrentSettings.Basic.Name = $NewVpgName From c47614727ab27760fc0d8204bc0a3125f134b28c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 28 Nov 2019 10:41:26 -0500 Subject: [PATCH 265/479] Fix Verbose Typo --- ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 | 2 +- ZertoApiWrapper/Public/Start-ZertoFailoverTest.ps1 | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 index da397a6..2f82592 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 @@ -89,7 +89,7 @@ function Invoke-ZertoMove { Write-Error "VPG: $name not found. Please check the name and try again. Skipping" } else { $uri = "{0}/{1}/move" -f $baseUri, $vpgId - if ($PSCmdlet.ShouldProcess("Moving VPG: $name wiht settings: $($body | convertto-json)")) { + if ($PSCmdlet.ShouldProcess("Moving VPG: $name with settings: $($body | convertto-json)")) { Invoke-ZertoRestRequest -uri $uri -method "POST" -body $($body | ConvertTo-Json) } } diff --git a/ZertoApiWrapper/Public/Start-ZertoFailoverTest.ps1 b/ZertoApiWrapper/Public/Start-ZertoFailoverTest.ps1 index ee044e3..c889e0c 100644 --- a/ZertoApiWrapper/Public/Start-ZertoFailoverTest.ps1 +++ b/ZertoApiWrapper/Public/Start-ZertoFailoverTest.ps1 @@ -27,11 +27,12 @@ function Start-ZertoFailoverTest { if ( -not $vpgIdentifier) { Write-Error "VPG: $vpgName Not Found. Please check the name and try again!" -ErrorAction Stop } + $body = @{ } if ( $PSBoundParameters.ContainsKey('vmName') ) { $vpgVmInformation = Get-ZertoProtectedVm -vpgName $vpgName - [System.Collections.ArrayList]$vmIdentifiers = @() + $vmIdentifiers = [System.Collections.Generic.List[string]]::new() foreach ( $name in $vmName ) { - $selectedVm = $vpgVmInformation | Where-Object {$_.VmName.toLower() -eq $name.toLower()} + $selectedVm = $vpgVmInformation | Where-Object { $_.VmName.toLower() -eq $name.toLower() } if ($null -eq $selectedVm) { Write-Error "VM: $name NOT found in VPG $vpgName. Check the name and try again." -ErrorAction Stop } elseif ($vmIdentifiers.Contains($selectedVm.vmIdentifier.toString())) { From f094263882183290f761b795eda9f585ac5b1b22 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 28 Nov 2019 10:55:59 -0500 Subject: [PATCH 266/479] Update RELEASENOTES.md --- RELEASENOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index b97d8b5..8113f71 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -7,6 +7,7 @@ * A new function has been added; `New-ZertoPairingToken`. This function will allow users to generate a pairing authentication token from the target ZVM to be used in the pairing process. [Issue 47](https://github.com/ZertoPublic/ZertoApiWrapper/issues/47) covers additional details. * A new function has been added; `Invoke-ZertoEvacuateVra`. This function will allow users to evacuate a target VRA by specifying a Host Name, VRA Name, or VRA Identifier. All VMs currently replicating to the specified location will be migrated to different targets. [Issue 51](https://github.com/ZertoPublic/ZertoApiWrapper/issues/51) * A function has been added; `Copy-ZertoVpg`. This function will allow users to copy the settings of a single VPG and add new VMs to it. There is currently no customization beyond specifying the VMs to be placed in the newly created VPG. Should additional edits \ updates be required, they should be done post creation. [Issue 54](https://github.com/ZertoPublic/ZertoApiWrapper/issues/54) + * Fixed [issue 57](https://github.com/ZertoPublic/ZertoApiWrapper/issues/57) where a `Start-ZertoFailoverTest` would throw an error complaining about validating the body parameter. This has been fixed and tested against Zerto Virtual Manager 7.5 Update 1 with Windows PowerShell 5.1 and PowerShell Core 6.2. ### Zerto Analytics From 9d21eb64098951bde5803985e0fc8c31911da81d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 1 Dec 2019 17:05:40 -0500 Subject: [PATCH 267/479] Format Release Notes --- RELEASENOTES.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 8113f71..7905bb9 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -5,10 +5,6 @@ * [Zerto version 7.5 has been released.](https://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Release%20Notes.pdf) As part of this release Zerto has added API functionality that requires the following updates. * A token is now required to pair two sites together. The need is discussed in [Issue 46](https://github.com/ZertoPublic/ZertoApiWrapper/issues/46). To implement this change a `-token` parameter has been added to the `Add-ZertoPeerSite` function. * A new function has been added; `New-ZertoPairingToken`. This function will allow users to generate a pairing authentication token from the target ZVM to be used in the pairing process. [Issue 47](https://github.com/ZertoPublic/ZertoApiWrapper/issues/47) covers additional details. - * A new function has been added; `Invoke-ZertoEvacuateVra`. This function will allow users to evacuate a target VRA by specifying a Host Name, VRA Name, or VRA Identifier. All VMs currently replicating to the specified location will be migrated to different targets. [Issue 51](https://github.com/ZertoPublic/ZertoApiWrapper/issues/51) - * A function has been added; `Copy-ZertoVpg`. This function will allow users to copy the settings of a single VPG and add new VMs to it. There is currently no customization beyond specifying the VMs to be placed in the newly created VPG. Should additional edits \ updates be required, they should be done post creation. [Issue 54](https://github.com/ZertoPublic/ZertoApiWrapper/issues/54) - * Fixed [issue 57](https://github.com/ZertoPublic/ZertoApiWrapper/issues/57) where a `Start-ZertoFailoverTest` would throw an error complaining about validating the body parameter. This has been fixed and tested against Zerto Virtual Manager 7.5 Update 1 with Windows PowerShell 5.1 and PowerShell Core 6.2. - -### Zerto Analytics - -### General Updates +* A new function has been added; `Invoke-ZertoEvacuateVra`. This function will allow users to evacuate a target VRA by specifying a Host Name, VRA Name, or VRA Identifier. All VMs currently replicating to the specified location will be migrated to different targets. [Issue 51](https://github.com/ZertoPublic/ZertoApiWrapper/issues/51) +* A function has been added; `Copy-ZertoVpg`. This function will allow users to copy the settings of a single VPG and add new VMs to it. There is currently no customization beyond specifying the VMs to be placed in the newly created VPG. Should additional edits \ updates be required, they should be done post creation. [Issue 54](https://github.com/ZertoPublic/ZertoApiWrapper/issues/54) +* Fixed [issue 57](https://github.com/ZertoPublic/ZertoApiWrapper/issues/57) where a `Start-ZertoFailoverTest` would throw an error complaining about validating the body parameter. This has been fixed and tested against Zerto Virtual Manager 7.5 Update 1 with Windows PowerShell 5.1 and PowerShell Core 6.2. From 82cf4cb732220363c73a2c9643445b36d2f437f7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 1 Dec 2019 17:05:53 -0500 Subject: [PATCH 268/479] Bump Version for Release --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 26aaba0..f0bb29e 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.2.0 +1.3.0 From 2cb35165a949b0035dcba71b1fc18d3d71a7e013 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 1 Dec 2019 17:09:57 -0500 Subject: [PATCH 269/479] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5bdc2f7..28a8c2f 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ PS> Install-Module -name ZertoApiWrapper ## Recent Updates +* December 1st, 2019: November Release. See [Release Notes](https://github.com/ZertoPublic/ZertoApiWrapper/releases/tag/1.3.0.20191201). * August 1st, 2019: August Release. See [Release Notes](https://github.com/ZertoPublic/ZertoApiWrapper/releases/tag/1.2.0.20190801). * June 16th, 2019: Added functionality for Zerto Analytics. * May 31st, 2019: Implement logic to allow use of this module in both Windows PowerShell 5.1 and PowerShell Core. @@ -40,7 +41,6 @@ PS> Install-Module -name ZertoApiWrapper ## TODO -* Complete Help Markdown Files * JFLR Functionality * Create VPG (Per-VM modification and Backup Settings) * Edit VPG From 270470f858cd7806199d3d22388d6975e63ab45a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 18 Dec 2019 13:06:11 -0500 Subject: [PATCH 270/479] Update Nic Object Logic --- .../Public/Export-ZertoVmNicSetting.ps1 | 52 ++++++++++--------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 b/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 index bef7b42..110b125 100644 --- a/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 +++ b/ZertoApiWrapper/Public/Export-ZertoVmNicSetting.ps1 @@ -45,33 +45,37 @@ function Export-ZertoVmNicSetting { $null = Remove-ZertoVpgSettingsIdentifier -vpgSettingsIdentifier $settingsId $networkMap = Get-Map -InputObject $networks -key "NetworkIdentifier" -value "VirtualizationNetworkName" foreach ($vm in $vmSettings) { - $nicInfo = [PSCustomObject]@{ - VPGName = $group.VPGName - VMName = $vmMap[$($vm.vmIdentifier)] - NicIdentifier = $vm.nics.NicIdentifier - LiveNetwork = $networkMap[$vm.nics.failover.Hypervisor.NetworkIdentifier] - LiveShouldReplaceMac = $vm.nics.failover.Hypervisor.ShouldReplaceMacAddress - LiveIsDHCP = $vm.Nics.failover.Hypervisor.IpConfig.IsDhcp - LiveIpAddress = $vm.nics.failover.Hypervisor.IpConfig.StaticIp - LiveIpSubnetMask = $vm.nics.failover.Hypervisor.IpConfig.SubnetMask - LiveIpDefaultGateway = $vm.nics.failover.Hypervisor.IpConfig.Gateway - LivePrimaryDns = $vm.nics.failover.Hypervisor.IpConfig.PrimaryDns - LiveSecondayDns = $vm.nics.failover.Hypervisor.IpConfig.SecondaryDns - LiveDnsSuffix = $vm.nics.failover.Hypervisor.DnsSuffix - TestNetwork = $networkMap[$vm.nics.failoverTest.Hypervisor.NetworkIdentifier] - TestShouldReplaceMac = $vm.nics.failoverTest.Hypervisor.ShouldReplaceMacAddress - TestIsDHCP = $vm.Nics.failoverTest.Hypervisor.IpConfig.IsDhcp - TestIpAddress = $vm.nics.failoverTest.Hypervisor.IpConfig.StaticIp - TestIpSubnetMask = $vm.nics.failoverTest.Hypervisor.IpConfig.SubnetMask - TestIpDefaultGateway = $vm.nics.failoverTest.Hypervisor.IpConfig.Gateway - TestPrimaryDns = $vm.nics.failoverTest.Hypervisor.IpConfig.PrimaryDns - TestSecondayDns = $vm.nics.failoverTest.Hypervisor.IpConfig.SecondaryDns - TestDnsSuffix = $vm.nics.failoverTest.Hypervisor.DnsSuffix + if ($vm.nics.count -gt 0) { + foreach ($nic in $vm.nics) { + $nicInfo = [PSCustomObject]@{ + VPGName = $group.VPGName + VMName = $vmMap[$vm.vmIdentifier] + NicIdentifier = $nic.NicIdentifier + LiveNetwork = $networkMap[$nic.failover.Hypervisor.NetworkIdentifier] + LiveShouldReplaceMac = $nic.failover.Hypervisor.ShouldReplaceMacAddress + LiveIsDHCP = $nic.failover.Hypervisor.IpConfig.IsDhcp + LiveIpAddress = $nic.failover.Hypervisor.IpConfig.StaticIp + LiveIpSubnetMask = $nic.failover.Hypervisor.IpConfig.SubnetMask + LiveIpDefaultGateway = $nic.failover.Hypervisor.IpConfig.Gateway + LivePrimaryDns = $nic.failover.Hypervisor.IpConfig.PrimaryDns + LiveSecondayDns = $nic.failover.Hypervisor.IpConfig.SecondaryDns + LiveDnsSuffix = $nic.failover.Hypervisor.DnsSuffix + TestNetwork = $networkMap[$nic.failoverTest.Hypervisor.NetworkIdentifier] + TestShouldReplaceMac = $nic.failoverTest.Hypervisor.ShouldReplaceMacAddress + TestIsDHCP = $nic.failoverTest.Hypervisor.IpConfig.IsDhcp + TestIpAddress = $nic.failoverTest.Hypervisor.IpConfig.StaticIp + TestIpSubnetMask = $nic.failoverTest.Hypervisor.IpConfig.SubnetMask + TestIpDefaultGateway = $nic.failoverTest.Hypervisor.IpConfig.Gateway + TestPrimaryDns = $nic.failoverTest.Hypervisor.IpConfig.PrimaryDns + TestSecondayDns = $nic.failoverTest.Hypervisor.IpConfig.SecondaryDns + TestDnsSuffix = $nic.failoverTest.Hypervisor.DnsSuffix + } + $nicInfo + } } - $nicInfo } } - $nicSettings | Export-Csv -Path $OutputFile + $nicSettings | Export-Csv -Path $OutputFile -NoTypeInformation } end { From 05783a1f37a531d0f55367c5c8a53f847f5bdd0c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 19 Dec 2019 18:49:13 -0500 Subject: [PATCH 271/479] Update Import Logic --- .../Public/Import-ZertoVmNicSetting.ps1 | 71 ++++++++++--------- 1 file changed, 38 insertions(+), 33 deletions(-) diff --git a/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 b/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 index 0a59888..104e325 100644 --- a/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 +++ b/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 @@ -44,15 +44,28 @@ function Import-ZertoVmNicSetting { [string]::IsNullOrWhiteSpace($Vm.LiveShouldReplaceMac) -or [string]::IsNullOrWhiteSpace($Vm.TestNetwork) -or [string]::IsNullOrWhiteSpace($Vm.TestShouldReplaceMac)) { - Write-Error "$($Vm.VMName) does not contain all the required data. Please check the CSV entry for this item and try again." -ErrorAction Continue + Write-Error "$($Vm.VMName) does not contain all the required data. Please check the CSV entry for this item and try again. You are required to provide the VPGName, VMName, NicIdentifier, LiveNetwork, and ShouldReplaceMacAddress for each Nic." -ErrorAction Continue } else { $uri = "vpgSettings/{0}/vms/{1}" -f $vpgSettingsId, $vmMap[$vm.VMName] $VmNicSettings = Get-ZertoVpgSetting -vpgSettingsIdentifier $vpgSettingsId -vmIdentifier $vmMap[$vm.VMName] foreach ($nic in $VmNicSettings.nics) { if ($nic.NicIdentifier -eq $vm.NicIdentifier) { - $nic.failover.Hypervisor.NetworkIdentifier = $NetworkMap[$vm.LiveNetwork] - $nic.failover.Hypervisor.ShouldReplaceMacAddress = $vm.LiveShouldReplaceMac - if ($null -eq $nic.failover.Hypervisor.IpConfig -and ($null -ne $vm.LiveIsDHCP -or $null -ne $vm.LiveIpAddress)) { + $NicUri = "{0}/nics/{1}" -f $uri, $nic.NicIdentifier + Invoke-ZertoRestRequest -uri $NicUri -Method "DELETE" + $nicSettings = Invoke-ZertoRestRequest -uri $NicUri -Method "GET" + $nicSettings.failover.Hypervisor.NetworkIdentifier = $NetworkMap[$vm.LiveNetwork] + $nicSettings.failover.Hypervisor.ShouldReplaceMacAddress = $vm.LiveShouldReplaceMac + if ($vm.LiveIsDHCP -imatch "true") { + $IpConfig = [PSCustomObject]@{ + IsDhcp = $vm.LiveIsDHCP + PrimaryDns = $vm.LivePrimaryDns + SecondaryDns = $vm.LiveSecondayDns + } + $nicSettings.failover.Hypervisor.IpConfig = $IpConfig + $nicSettings.failover.Hypervisor.DnsSuffix = $vm.LiveDnsSuffix + } elseif (($vm.LiveIsDHCP -imatch "false" -or + [string]::IsNullOrWhiteSpace($vm.LiveIsDHCP)) -and + -not [string]::IsNullOrWhiteSpace($vm.LiveIpAddress)) { $IpConfig = [PSCustomObject]@{ IsDhcp = $vm.LiveIsDHCP StaticIp = $vm.LiveIpAddress @@ -61,21 +74,22 @@ function Import-ZertoVmNicSetting { PrimaryDns = $vm.LivePrimaryDns SecondaryDns = $vm.LiveSecondayDns } - $nic.failover.Hypervisor.IpConfig = $IpConfig - } elseif ($null -eq $nic.failover.Hypervisor.IpConfig -and $null -eq $vm.LiveIsDHCP -and $null -eq $vm.LiveIpAddress) { - $nic.failover.Hypervisor.IpConfig = $null - } else { - $nic.failover.Hypervisor.IpConfig.IsDhcp = $vm.LiveIsDHCP - $nic.failover.Hypervisor.IpConfig.StaticIp = $vm.LiveIpAddress - $nic.failover.Hypervisor.IpConfig.SubnetMask = $vm.LiveIpSubnetMask - $nic.failover.Hypervisor.IpConfig.Gateway = $vm.LiveIpDefaultGateway - $nic.failover.Hypervisor.IpConfig.PrimaryDns = $vm.LivePrimaryDns - $nic.failover.Hypervisor.IpConfig.SecondaryDns = $vm.LiveSecondayDns + $nicSettings.failover.Hypervisor.IpConfig = $IpConfig + $nicSettings.failover.Hypervisor.DnsSuffix = $vm.LiveDnsSuffix } - $nic.failover.Hypervisor.DnsSuffix = $vm.LiveDnsSuffix - $nic.failoverTest.Hypervisor.NetworkIdentifier = $NetworkMap[$vm.TestNetwork] - $nic.failoverTest.Hypervisor.ShouldReplaceMacAddress = $vm.TestShouldReplaceMac - if ($null -eq $nic.failoverTest.Hypervisor.IpConfig -and ($null -ne $vm.TestIsDHCP -or $null -ne $vm.TestIpAddress)) { + $nicSettings.failoverTest.Hypervisor.NetworkIdentifier = $NetworkMap[$vm.TestNetwork] + $nicSettings.failoverTest.Hypervisor.ShouldReplaceMacAddress = $vm.TestShouldReplaceMac + if ($vm.TestIsDHCP -imatch "true" ) { + $IpConfig = [PsCustomObject]@{ + IsDhcp = $vm.TestIsDHCP + PrimaryDns = $vm.TestPrimaryDns + SecondaryDns = $vm.TestSecondayDns + } + $nicSettings.failoverTest.Hypervisor.IpConfig = $IpConfig + $nicSettings.failoverTest.Hypervisor.DnsSuffix = $vm.TestDnsSuffix + } elseif (($vm.TestIsDHCP -imatch "false" -or + [string]::IsNullOrWhiteSpace($vm.TestIsDHCP)) -and + -not [string]::IsNullOrWhiteSpace($vm.TestIpAddress)) { $IpConfig = [PsCustomObject]@{ IsDhcp = $vm.TestIsDHCP StaticIp = $vm.TestIpAddress @@ -84,24 +98,15 @@ function Import-ZertoVmNicSetting { PrimaryDns = $vm.TestPrimaryDns SecondaryDns = $vm.TestSecondayDns } - $nic.failoverTest.Hypervisor.IpConfig = $IpConfig - } elseif ($null -eq $nic.failoverTest.Hypervisor.IpConfig -and $null -eq $vm.TestIsDHCP -and $null -eq $vm.TestIpAddress) { - $nic.failoverTest.Hypervisor.IpConfig = $null - } else { - $nic.failoverTest.Hypervisor.IpConfig.IsDhcp = $vm.TestIsDHCP - $nic.failoverTest.Hypervisor.IpConfig.StaticIp = $vm.TestIpAddress - $nic.failoverTest.Hypervisor.IpConfig.SubnetMask = $vm.TestIpSubnetMask - $nic.failoverTest.Hypervisor.IpConfig.Gateway = $vm.TestIpDefaultGateway - $nic.failoverTest.Hypervisor.IpConfig.PrimaryDns = $vm.TestPrimaryDns - $nic.failoverTest.Hypervisor.IpConfig.SecondaryDns = $vm.TestSecondayDns + $nicSettings.failoverTest.Hypervisor.IpConfig = $IpConfig + $nicSettings.failoverTest.Hypervisor.DnsSuffix = $vm.TestDnsSuffix + } + Write-Verbose "Putting Updated Config for VM: $($vm.name), NIC: $($nic.nicidentifier) in VPG: $Vpg" + if ($PSCmdlet.ShouldProcess($vm.NicIdentifier, "Updating Nic")) { + Invoke-ZertoRestRequest -uri $NicUri -Method "PUT" -Body ($nicSettings | ConvertTo-Json -Depth 10) > $null } - $nic.failoverTest.Hypervisor.DnsSuffix = $vm.TestDnsSuffix } } - Write-Verbose "Putting Updated Config for VM: $($vm.vmname) in Vpg: $Vpg" - if ($PSCmdlet.ShouldProcess($vm.NicIdentifier, "Updating Nic")) { - Invoke-ZertoRestRequest -uri $uri -Method "PUT" -Body ($VmNicSettings | ConvertTo-Json -Depth 10) > $null - } } } Write-Verbose "Saving updated configuration for VPG: $Vpg" From 003396998c41ae3ac95bcd24de690ad2c333b12b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 20 Dec 2019 21:09:12 -0500 Subject: [PATCH 272/479] Eliminate Blank Output --- ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 b/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 index 104e325..bd9a51d 100644 --- a/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 +++ b/ZertoApiWrapper/Public/Import-ZertoVmNicSetting.ps1 @@ -51,7 +51,7 @@ function Import-ZertoVmNicSetting { foreach ($nic in $VmNicSettings.nics) { if ($nic.NicIdentifier -eq $vm.NicIdentifier) { $NicUri = "{0}/nics/{1}" -f $uri, $nic.NicIdentifier - Invoke-ZertoRestRequest -uri $NicUri -Method "DELETE" + Invoke-ZertoRestRequest -uri $NicUri -Method "DELETE" > $null $nicSettings = Invoke-ZertoRestRequest -uri $NicUri -Method "GET" $nicSettings.failover.Hypervisor.NetworkIdentifier = $NetworkMap[$vm.LiveNetwork] $nicSettings.failover.Hypervisor.ShouldReplaceMacAddress = $vm.LiveShouldReplaceMac From 6c92dff447a0c36c49197a587c68235561eebe94 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 20 Dec 2019 22:56:04 -0500 Subject: [PATCH 273/479] Update Description with new logic --- docs/Import-ZertoVmNicSetting.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/Import-ZertoVmNicSetting.md b/docs/Import-ZertoVmNicSetting.md index f16815a..b09da42 100644 --- a/docs/Import-ZertoVmNicSetting.md +++ b/docs/Import-ZertoVmNicSetting.md @@ -19,7 +19,13 @@ Import-ZertoVmNicSetting [-InputFile] [-WhatIf] [-Confirm] [ Date: Fri, 20 Dec 2019 22:56:20 -0500 Subject: [PATCH 274/479] Update Online Help Link --- docs/Import-ZertoVmNicSetting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Import-ZertoVmNicSetting.md b/docs/Import-ZertoVmNicSetting.md index b09da42..d65b8fc 100644 --- a/docs/Import-ZertoVmNicSetting.md +++ b/docs/Import-ZertoVmNicSetting.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZertoZsspSession.md +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVmNicSetting.md schema: 2.0.0 --- From 1962dda15c7ac1bdc5f0b3d60a17d1a2b0d2c521 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 22 Dec 2019 10:07:17 -0500 Subject: [PATCH 275/479] Remove vpgIdentifier Parameter vpgIdentifier Parameter as added as a parameter by mistake. The API does not accecpt this as a filter. --- .../Public/Get-ZertoRecoveryReport.ps1 | 6 ------ docs/Get-ZertoRecoveryReport.md | 16 ---------------- 2 files changed, 22 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZertoRecoveryReport.ps1 b/ZertoApiWrapper/Public/Get-ZertoRecoveryReport.ps1 index c15ba9c..fded034 100644 --- a/ZertoApiWrapper/Public/Get-ZertoRecoveryReport.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoRecoveryReport.ps1 @@ -26,12 +26,6 @@ function Get-ZertoRecoveryReport { )] [ValidateNotNullOrEmpty()] [string]$pageSize, - [Parameter( - ParameterSetName = "filter", - HelpMessage = "The internal identifier of the VPG. You can specify more than one VPG, separated by commas." - )] - [ValidateNotNullOrEmpty()] - [string]$vpgIdentifier, [Parameter( ParameterSetName = "filter", HelpMessage = "The name of the VPG. You can specify more than one VPG, separated by commas." diff --git a/docs/Get-ZertoRecoveryReport.md b/docs/Get-ZertoRecoveryReport.md index 488169d..d8361bf 100644 --- a/docs/Get-ZertoRecoveryReport.md +++ b/docs/Get-ZertoRecoveryReport.md @@ -142,22 +142,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -vpgIdentifier -The internal identifier of the VPG. -You can specify more than one VPG, separated by commas. - -```yaml -Type: String -Parameter Sets: filter -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -vpgName The name of the VPG. You can specify more than one VPG, separated by commas. From 5b9243a02f5972b6f080bf278b0a2c02e8fc09bc Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 22 Dec 2019 10:16:27 -0500 Subject: [PATCH 276/479] Updated releasenotes with changes --- RELEASENOTES.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 7905bb9..36bc38e 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -2,9 +2,4 @@ ### Zerto Virtual Manager -* [Zerto version 7.5 has been released.](https://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Release%20Notes.pdf) As part of this release Zerto has added API functionality that requires the following updates. - * A token is now required to pair two sites together. The need is discussed in [Issue 46](https://github.com/ZertoPublic/ZertoApiWrapper/issues/46). To implement this change a `-token` parameter has been added to the `Add-ZertoPeerSite` function. - * A new function has been added; `New-ZertoPairingToken`. This function will allow users to generate a pairing authentication token from the target ZVM to be used in the pairing process. [Issue 47](https://github.com/ZertoPublic/ZertoApiWrapper/issues/47) covers additional details. -* A new function has been added; `Invoke-ZertoEvacuateVra`. This function will allow users to evacuate a target VRA by specifying a Host Name, VRA Name, or VRA Identifier. All VMs currently replicating to the specified location will be migrated to different targets. [Issue 51](https://github.com/ZertoPublic/ZertoApiWrapper/issues/51) -* A function has been added; `Copy-ZertoVpg`. This function will allow users to copy the settings of a single VPG and add new VMs to it. There is currently no customization beyond specifying the VMs to be placed in the newly created VPG. Should additional edits \ updates be required, they should be done post creation. [Issue 54](https://github.com/ZertoPublic/ZertoApiWrapper/issues/54) -* Fixed [issue 57](https://github.com/ZertoPublic/ZertoApiWrapper/issues/57) where a `Start-ZertoFailoverTest` would throw an error complaining about validating the body parameter. This has been fixed and tested against Zerto Virtual Manager 7.5 Update 1 with Windows PowerShell 5.1 and PowerShell Core 6.2. +* Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/60) in the `Get-ZertoRecoveryReport` function where the `-VpgIdentifier` parameter was not working. This parameter is not accepted by the API as a valid filter and is ignored. This parameter has been removed from the function. From 4c98b7513438a958ffa26c83dcd7d42aaf048da7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 22 Dec 2019 10:48:07 -0500 Subject: [PATCH 277/479] Update RELEASENOTES.md --- RELEASENOTES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 36bc38e..4d97ada 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -3,3 +3,5 @@ ### Zerto Virtual Manager * Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/60) in the `Get-ZertoRecoveryReport` function where the `-VpgIdentifier` parameter was not working. This parameter is not accepted by the API as a valid filter and is ignored. This parameter has been removed from the function. +* Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/60) where the `Export-ZertoVpgNicSetting` function would not properly execute when run against a VM with no NICs attached. +* In reviewing the `Export-ZertoVpgNicSetting`, a review of the `Import-ZertoVpgNicSetting` was completed and it was determined to update the import logic based on various test cases. Along with this, it is now possible to reset the NIC settings to the default state with the `Import-ZertoVpgNicSetting` command. Please review the [Import-ZertoVpgNicSetting help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVmNicSetting.md) to review the updated options and import logic. From a36a7cb37ae30f22b84f2979a5e80aac6b18534b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 28 Feb 2020 08:15:15 -0500 Subject: [PATCH 278/479] Cleanup documentation --- docs/Get-ZertoRecoveryReport.md | 2 +- docs/Import-ZertoVmNicSetting.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/Get-ZertoRecoveryReport.md b/docs/Get-ZertoRecoveryReport.md index d8361bf..d316621 100644 --- a/docs/Get-ZertoRecoveryReport.md +++ b/docs/Get-ZertoRecoveryReport.md @@ -20,7 +20,7 @@ Get-ZertoRecoveryReport [] ### filter ``` Get-ZertoRecoveryReport [-startTime ] [-endTime ] [-pageNumber ] [-pageSize ] - [-vpgIdentifier ] [-vpgName ] [-recoveryType ] [-state ] [] + [-vpgName ] [-recoveryType ] [-state ] [] ``` ## DESCRIPTION diff --git a/docs/Import-ZertoVmNicSetting.md b/docs/Import-ZertoVmNicSetting.md index d65b8fc..1c9a226 100644 --- a/docs/Import-ZertoVmNicSetting.md +++ b/docs/Import-ZertoVmNicSetting.md @@ -26,7 +26,6 @@ Each entry in the CSV will be for one VM and a single NIC attached to that VM. E This logic is applied to both the Live and Test settings individually. It is recommended to use the `Export-ZertoVpgNicSetting` to dump all current settings and then modify a copy of the exported file with only the settings you wish to update. Import the copied file and if you need to revert, Import the original. - ## EXAMPLES ### Example 1 From e19f9b34f549a9b97ab035502ce84ee21b8f03a0 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 28 Feb 2020 08:15:53 -0500 Subject: [PATCH 279/479] Update function to allow pipeline operations --- Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 | 2 +- .../Public/Checkpoint-ZertoVpg.ps1 | 22 +++++++++++-------- docs/Checkpoint-ZertoVpg.md | 6 ++--- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 b/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 index f580a6f..7ae3eea 100644 --- a/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 @@ -16,7 +16,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$($global:function)::Parameter Unit Tests" { It "Has a parameter for the VpgName that is Mandatory" { - Get-Command $global:function | Should -HaveParameter vpgName -Mandatory -Type String + Get-Command $global:function | Should -HaveParameter vpgName -Mandatory -Type 'String[]' } It "Has a parameter for the CheckpointName that is Mandatory" { diff --git a/ZertoApiWrapper/Public/Checkpoint-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Checkpoint-ZertoVpg.ps1 index e8d94b7..c0dd1a4 100644 --- a/ZertoApiWrapper/Public/Checkpoint-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Checkpoint-ZertoVpg.ps1 @@ -4,10 +4,12 @@ function Checkpoint-ZertoVpg { param( [Parameter( Mandatory = $true, - HelpMessage = "Name of the VPG to tag." + HelpMessage = "Name of the VPG to tag.", + ValueFromPipeline = $true, + ValueFromPipelineByPropertyName = $true )] [ValidateNotNullOrEmpty()] - [string]$vpgName, + [string[]]$vpgName, [Parameter( Mandatory = $true, HelpMessage = "Text to tag the checkpoint with." @@ -18,16 +20,18 @@ function Checkpoint-ZertoVpg { begin { $baseUri = "vpgs" - $vpgIdentifier = $(get-zertovpg -name $vpgName).vpgIdentifier - $body = @{"checkpointName" = $checkpointName} } process { - if ($vpgIdentifier) { - $uri = "{0}/{1}/Checkpoints" -f $baseUri, $vpgIdentifier - Invoke-ZertoRestRequest -uri $uri -body $($body | ConvertTo-Json) -method "POST" - } else { - Write-Output "Cannot find VPG named $vpgName. Please check the name and try again." + foreach ($name in $vpgName) { + $vpgIdentifier = $(get-zertovpg -name $name).vpgIdentifier + if ($vpgIdentifier) { + $uri = "{0}/{1}/Checkpoints" -f $baseUri, $vpgIdentifier + $body = @{"checkpointName" = $checkpointName} + Invoke-ZertoRestRequest -uri $uri -body $($body | ConvertTo-Json) -method "POST" + } else { + Write-Output "Cannot find VPG named $name. Please check the name and try again." + } } } diff --git a/docs/Checkpoint-ZertoVpg.md b/docs/Checkpoint-ZertoVpg.md index d7cfbf5..7951d3c 100644 --- a/docs/Checkpoint-ZertoVpg.md +++ b/docs/Checkpoint-ZertoVpg.md @@ -13,7 +13,7 @@ Add a tagged checkpoint to a specified VPG ## SYNTAX ``` -Checkpoint-ZertoVpg [-vpgName] [-checkpointName] [] +Checkpoint-ZertoVpg [-vpgName] [-checkpointName] [] ``` ## DESCRIPTION @@ -49,14 +49,14 @@ Accept wildcard characters: False Name of the VPG to tag. ```yaml -Type: String +Type: String[] Parameter Sets: (All) Aliases: Required: True Position: 0 Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False ``` From fde7f67e45f2c34765e3210e41605f790bb4e29e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 2 Mar 2020 09:41:09 -0500 Subject: [PATCH 280/479] Update RELEASENOTES.md --- RELEASENOTES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 4d97ada..d392c98 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -3,5 +3,6 @@ ### Zerto Virtual Manager * Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/60) in the `Get-ZertoRecoveryReport` function where the `-VpgIdentifier` parameter was not working. This parameter is not accepted by the API as a valid filter and is ignored. This parameter has been removed from the function. -* Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/60) where the `Export-ZertoVpgNicSetting` function would not properly execute when run against a VM with no NICs attached. +* Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/61) where the `Export-ZertoVpgNicSetting` function would not properly execute when run against a VM with no NICs attached. * In reviewing the `Export-ZertoVpgNicSetting`, a review of the `Import-ZertoVpgNicSetting` was completed and it was determined to update the import logic based on various test cases. Along with this, it is now possible to reset the NIC settings to the default state with the `Import-ZertoVpgNicSetting` command. Please review the [Import-ZertoVpgNicSetting help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVmNicSetting.md) to review the updated options and import logic. +* Refactored the `Checkpoint-ZertoVpg` command to allow pipeline input (ByValue and ByProperty) for the VpgName parameter. From 18185612bb87055c39699d45a034c9601858a216 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 2 Mar 2020 09:51:23 -0500 Subject: [PATCH 281/479] Fixed recovery switch typo --- ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 b/ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 index 39a59e3..cf64840 100644 --- a/ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 @@ -211,7 +211,8 @@ function Get-ZertoVpgSetting { Mandatory = $true, HelpMessage = "Get VPG Recovery Settings" )] - [switch]$rcovery, + [Alias("rcovery")] + [switch]$recovery, [Parameter( ParameterSetName = "scripting", Mandatory = $true, From 772848beeff1af9e68d0dea1e0cf105145f83c22 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 2 Mar 2020 09:53:55 -0500 Subject: [PATCH 282/479] Updated help file to reflect typo correction --- docs/Get-ZertoVpgSetting.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Get-ZertoVpgSetting.md b/docs/Get-ZertoVpgSetting.md index d7e0411..8b671cc 100644 --- a/docs/Get-ZertoVpgSetting.md +++ b/docs/Get-ZertoVpgSetting.md @@ -56,7 +56,7 @@ Get-ZertoVpgSetting -vpgSettingsIdentifier [-scripting] [ [-rcovery] [] +Get-ZertoVpgSetting -vpgSettingsIdentifier [-recovery] [] ``` ### priority @@ -288,13 +288,13 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -rcovery +### -recovery Get VPG Recovery Settings ```yaml Type: SwitchParameter Parameter Sets: recovery -Aliases: +Aliases: rcovery Required: True Position: Named From 37165e18a79d86806417d38a878ec155e6551180 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 2 Mar 2020 10:00:45 -0500 Subject: [PATCH 283/479] Typo Correction Update --- RELEASENOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index d392c98..ede0d6b 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -6,3 +6,4 @@ * Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/61) where the `Export-ZertoVpgNicSetting` function would not properly execute when run against a VM with no NICs attached. * In reviewing the `Export-ZertoVpgNicSetting`, a review of the `Import-ZertoVpgNicSetting` was completed and it was determined to update the import logic based on various test cases. Along with this, it is now possible to reset the NIC settings to the default state with the `Import-ZertoVpgNicSetting` command. Please review the [Import-ZertoVpgNicSetting help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVmNicSetting.md) to review the updated options and import logic. * Refactored the `Checkpoint-ZertoVpg` command to allow pipeline input (ByValue and ByProperty) for the VpgName parameter. +* Corrected a parameter typo in the `Get-ZertoVpgSetting` function. The misspelt parameter was added as an alias to ensure any existing scripts using the parameter continue to function. From 4c32bbe057e488b73f99a3ead4695a9e0d086938 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 5 Mar 2020 21:43:32 -0500 Subject: [PATCH 284/479] Update to PwSh Version 7 --- .vscode/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 77c8224..7331185 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,5 +4,5 @@ "editor.insertSpaces": true, "editor.tabSize": 4, "powershell.codeFormatting.preset": "OTBS", - "terminal.integrated.shell.windows": "c:/Program Files/PowerShell/6/pwsh.exe" + "terminal.integrated.shell.windows": "c:/Program Files/PowerShell/7/pwsh.exe" } From bc02e796d652bc892dfa514a140cd15b90a4e3a6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 5 Mar 2020 21:43:52 -0500 Subject: [PATCH 285/479] Refactor for DRY --- ZertoApiWrapper/Public/Get-ZertoVpg.ps1 | 28 +++++++++++-------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 index d151152..6990526 100644 --- a/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 @@ -160,7 +160,6 @@ function Get-ZertoVpg { ) begin { $baseUri = "vpgs" - $returnObject = @() } Process { @@ -169,14 +168,13 @@ function Get-ZertoVpg { # When called with no parameters, return all values "main" { - $returnObject = Invoke-ZertoRestRequest -uri $baseUri + $uri = $baseUri } # When called with protectionGroupIdentifier, query for each id provided "protectionGroupIdentifier" { - $returnObject = foreach ( $vpgId in $protectionGroupIdentifier ) { - $uri = "{0}/{1}" -f $baseUri, $vpgId - Invoke-ZertoRestRequest -uri $uri + $uri = foreach ( $vpgId in $protectionGroupIdentifier ) { + "{0}/{1}" -f $baseUri, $vpgId } } @@ -185,7 +183,7 @@ function Get-ZertoVpg { $filter = $false if ( $PSBoundParameters.ContainsKey("startDate") -or $PSBoundParameters.ContainsKey("endDate") ) { $filter = $true - $filterTable = @{} + $filterTable = @{ } foreach ( $param in $PSBoundParameters.GetEnumerator() ) { if ( $param.key -eq "startDate" -or $param.key -eq "endDate") { $filterTable[$param.key] = $param.value @@ -193,21 +191,19 @@ function Get-ZertoVpg { } $filter = Get-ZertoApiFilter -filterTable $filterTable } - $returnObject = foreach ( $id in $protectionGroupIdentifier ) { + $uri = foreach ( $id in $protectionGroupIdentifier ) { if ( $filter ) { - $uri = "{0}/{1}/checkpoints{2}" -f $baseUri, $id, $filter + "{0}/{1}/checkpoints{2}" -f $baseUri, $id, $filter } else { - $uri = "{0}/{1}/checkpoints" -f $baseUri, $id + "{0}/{1}/checkpoints" -f $baseUri, $id } - Invoke-ZertoRestRequest -uri $uri } } # When stats are requested "stats" { - $returnObject = foreach ( $id in $protectionGroupIdentifier ) { - $uri = "{0}/{1}/checkpoints/stats" -f $baseUri, $id - Invoke-ZertoRestRequest -uri $uri + $uri = foreach ( $id in $protectionGroupIdentifier ) { + "{0}/{1}/checkpoints/stats" -f $baseUri, $id } } @@ -215,18 +211,18 @@ function Get-ZertoVpg { "filter" { $filter = Get-ZertoApiFilter -filterTable $PSBoundParameters $uri = "{0}{1}" -f $baseUri, $filter - $returnObject = Invoke-ZertoRestRequest -uri $uri } # Default is to build URI based on ParameterSetName and return results. default { $uri = "{0}/{1}" -f $baseUri, $PSCmdlet.ParameterSetName.ToLower() - $returnObject = Invoke-ZertoRestRequest -uri $uri } } + foreach ($entry in $uri) { + Invoke-ZertoRestRequest -uri $entry + } } End { - return $returnObject } } From fad3ca0e2746a02c00912649d4e3ee5e2bbe216f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 6 Mar 2020 10:01:17 -0500 Subject: [PATCH 286/479] Update RELEASENOTES.md --- RELEASENOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index ede0d6b..9267c2c 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -7,3 +7,4 @@ * In reviewing the `Export-ZertoVpgNicSetting`, a review of the `Import-ZertoVpgNicSetting` was completed and it was determined to update the import logic based on various test cases. Along with this, it is now possible to reset the NIC settings to the default state with the `Import-ZertoVpgNicSetting` command. Please review the [Import-ZertoVpgNicSetting help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVmNicSetting.md) to review the updated options and import logic. * Refactored the `Checkpoint-ZertoVpg` command to allow pipeline input (ByValue and ByProperty) for the VpgName parameter. * Corrected a parameter typo in the `Get-ZertoVpgSetting` function. The misspelt parameter was added as an alias to ensure any existing scripts using the parameter continue to function. +* Refactored the `Get-ZertoVpg` command to remove repetitive commands and variables that are no longer required. From 13592df6aa4f4aaaad7fb8d7602ecf84de1eadd5 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 6 Mar 2020 10:33:12 -0500 Subject: [PATCH 287/479] Move ZARestRequest to Public Function --- .../Invoke-ZARestRequest.Test.ps1} | 0 ZertoApiWrapper/{Private => Public}/Invoke-ZARestRequest.ps1 | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Tests/{Private/Invoke-ZARestRequest.Tests.ps1 => Public/Invoke-ZARestRequest.Test.ps1} (100%) rename ZertoApiWrapper/{Private => Public}/Invoke-ZARestRequest.ps1 (100%) diff --git a/Tests/Private/Invoke-ZARestRequest.Tests.ps1 b/Tests/Public/Invoke-ZARestRequest.Test.ps1 similarity index 100% rename from Tests/Private/Invoke-ZARestRequest.Tests.ps1 rename to Tests/Public/Invoke-ZARestRequest.Test.ps1 diff --git a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 b/ZertoApiWrapper/Public/Invoke-ZARestRequest.ps1 similarity index 100% rename from ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 rename to ZertoApiWrapper/Public/Invoke-ZARestRequest.ps1 From 779ee1415e5095ab9b4450489cef7ec5522caf23 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 6 Mar 2020 10:38:41 -0500 Subject: [PATCH 288/479] Move IZRR to public --- Tests/{Private => Public}/Invoke-ZertoRestRequest.Tests.ps1 | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Tests/{Private => Public}/Invoke-ZertoRestRequest.Tests.ps1 (100%) diff --git a/Tests/Private/Invoke-ZertoRestRequest.Tests.ps1 b/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 similarity index 100% rename from Tests/Private/Invoke-ZertoRestRequest.Tests.ps1 rename to Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 From dc4dd1ad050d9fa0b9637826df53a74b04062ec6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 6 Mar 2020 10:40:21 -0500 Subject: [PATCH 289/479] Move IZRR function to public --- ZertoApiWrapper/{Private => Public}/Invoke-ZertoRestRequest.ps1 | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ZertoApiWrapper/{Private => Public}/Invoke-ZertoRestRequest.ps1 (100%) diff --git a/ZertoApiWrapper/Private/Invoke-ZertoRestRequest.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoRestRequest.ps1 similarity index 100% rename from ZertoApiWrapper/Private/Invoke-ZertoRestRequest.ps1 rename to ZertoApiWrapper/Public/Invoke-ZertoRestRequest.ps1 From 526093afc64cc2455fcecfe0b2750314b1654918 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 6 Mar 2020 13:31:59 -0500 Subject: [PATCH 290/479] Fix the Tests extension --- ...voke-ZARestRequest.Test.ps1 => Invoke-ZARestRequest.Tests.ps1} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Tests/Public/{Invoke-ZARestRequest.Test.ps1 => Invoke-ZARestRequest.Tests.ps1} (100%) diff --git a/Tests/Public/Invoke-ZARestRequest.Test.ps1 b/Tests/Public/Invoke-ZARestRequest.Tests.ps1 similarity index 100% rename from Tests/Public/Invoke-ZARestRequest.Test.ps1 rename to Tests/Public/Invoke-ZARestRequest.Tests.ps1 From 40331c26f93b0cc965279cb0847456dbb73c1984 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 6 Mar 2020 13:42:20 -0500 Subject: [PATCH 291/479] Update ZARestRequest and associated tests. --- Tests/Public/Invoke-ZARestRequest.Tests.ps1 | 6 ----- .../Public/Invoke-ZARestRequest.ps1 | 24 ++++++++++++++----- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Tests/Public/Invoke-ZARestRequest.Tests.ps1 b/Tests/Public/Invoke-ZARestRequest.Tests.ps1 index 78bb6f3..c545e56 100644 --- a/Tests/Public/Invoke-ZARestRequest.Tests.ps1 +++ b/Tests/Public/Invoke-ZARestRequest.Tests.ps1 @@ -12,7 +12,6 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { @{ParameterName = 'uri'; Type = 'String'; Mandatory = $true; TestName = 'URI' } @{ParameterName = 'method'; Type = 'String'; Mandatory = $false; TestName = 'Method' } @{ParameterName = 'body'; Type = 'String'; Mandatory = $false; TestName = 'Body' } - @{ParameterName = 'contentType'; Type = 'String'; Mandatory = $false; TestName = 'contentType' } ) It "Parameter present and Type test for: " -TestCases $testCases { @@ -29,14 +28,9 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Get-Command $global:function | Should -HaveParameter Method -DefaultValue "GET" } - It "ContentType parameter default is 'application/json'" { - Get-Command $global:function | Should -HaveParameter contentType -DefaultValue "application/json" - } - $NotNullOrEmptyTests = @( @{ParameterName = 'uri'; TestName = 'Uri' } @{ParameterName = 'body'; TestName = 'Body' } - @{ParameterName = 'contentType'; TestName = 'ContentType' } ) It " parameter does not accecpt a null or empty value" -TestCases $NotNullOrEmptyTests { diff --git a/ZertoApiWrapper/Public/Invoke-ZARestRequest.ps1 b/ZertoApiWrapper/Public/Invoke-ZARestRequest.ps1 index 0304c88..52aab99 100644 --- a/ZertoApiWrapper/Public/Invoke-ZARestRequest.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZARestRequest.ps1 @@ -1,26 +1,38 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Invoke-ZARestRequest { [cmdletbinding()] param( # Parameter help description - [Parameter(Mandatory)] + [Parameter( + Mandatory, + Helpmessage = "URI endpoint to be utilized. When submitting the URI, only the endpoint needs to be submitted. Please review the help documentation for examples." + )] [ValidateNotNullOrEmpty()] [string]$uri, + [Parameter( + Helpmessage = "API method to be used. GET, PUT, POST, or DELETE. Refer to documentation for the API endpoint to ensure the correct method is being used. If unspecified, defaults to GET" + )] [ValidateSet("GET", "PUT", "POST", "DELETE")] [string]$method = "GET", + [Parameter( + Helpmessage = "Body to be submitted to the REST API endpoint. This needs to be submitted in JSON format" + )] [ValidateNotNullOrEmpty()] - [string]$body, - [ValidateNotNullOrEmpty()] - [string]$contentType = "application/json" + [string]$body + ) + # While the API can use XML or JSON, this module is built on JSON functionality. Currently forcing all + # content types and language to JSON. + [string]$contentType = "application/json" # Check to see if the required variables are present and currently valid if ( -not ((Test-Path variable:script:zaLastActionTime) -and (Test-Path variable:script:zaHeaders)) ) { Throw "Zerto Analytics Connection does not Exist. Please run Connect-ZertoAnalytics first to establish a connection" - } elseif ( (Test-Path variable:script:zaHeaders) -and $([datetime]$script:zaLastActionTime).addMinutes(60) -lt $(get-date) ) { + } elseif ( (Test-Path variable:script:zaHeaders) -and $([datetime]$script:zaLastActionTime).addMinutes(60) -lt $(Get-Date) ) { Throw "Authorization Token has Expired. Please re-authorize to the Zerto Analytics Portal" } else { # Update the last action time and submit the request based on PS Version. - Set-Variable -Name zaLastActionTime -Scope Script -Value $(Get-date).Ticks + Set-Variable -Name zaLastActionTime -Scope Script -Value $(Get-Date).Ticks $submittedUri = "https://analytics.api.zerto.com/v2/{0}" -f $uri if ($PSVersionTable.PSVersion.Major -ge 6) { Invoke-RestMethod -Uri $submittedUri -Method $method -Body $body -Headers $Script:zaHeaders -ContentType $contentType -TimeoutSec 100 From 569d9e264c0693c2598ef56a3ecd3fa814bb5eff Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 6 Mar 2020 13:42:39 -0500 Subject: [PATCH 292/479] Update ZertoRestRequest and associated Tests --- .../Public/Invoke-ZertoRestRequest.Tests.ps1 | 4 --- .../Public/Invoke-ZertoRestRequest.ps1 | 33 +++++++++++++++---- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 b/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 index df40da6..f7a23d5 100644 --- a/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 @@ -14,9 +14,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $ParameterNameTestCases = @( @{ParameterName = "uri"; Type = "String"; Mandatory = $true; DefaultValue = $null; TestName = "URI" } @{ParameterName = "method"; Type = "String"; Mandatory = $false; DefaultValue = 'GET'; TestName = "Method" } - @{ParameterName = "apiVersion"; Type = "String"; Mandatory = $false; DefaultValue = 'v1'; TestName = "API Version" } @{ParameterName = "body"; Type = "String"; Mandatory = $false; DefaultValue = $null; TestName = "Body" } - @{ParameterName = "contentType"; Type = "String"; Mandatory = $false; DefaultValue = 'application/json'; TestName = "Content Type" } @{ParameterName = "credential"; Type = "PSCredential"; Mandatory = $false; DefaultValue = $null; TestName = "Credential" } @{ParameterName = "returnHeaders"; Type = "Switch"; Mandatory = $false; DefaultValue = $null; TestName = "Return Headers" } ) @@ -36,9 +34,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $ParameterValidationTestCases = @( @{ParameterName = "URI"; TestName = "URI" } - @{ParameterName = "apiVersion"; TestName = "Api Version" } @{ParameterName = "body"; TestName = "Body" } - @{ParameterName = "contentType"; TestName = "Content Type" } ) It " parameter cannot be null or empty" -TestCases $ParameterValidationTestCases { diff --git a/ZertoApiWrapper/Public/Invoke-ZertoRestRequest.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoRestRequest.ps1 index 4a3f642..97430ab 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoRestRequest.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoRestRequest.ps1 @@ -1,20 +1,39 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Invoke-ZertoRestRequest { [cmdletbinding()] param( + # Parameter help description + [Parameter( + Helpmessage = "API method to be used. GET, PUT, POST, or DELETE. Refer to documentation for the API endpoint to ensure the correct method is being used. If unspecified, defaults to GET" + )] [ValidateSet("GET", "PUT", "POST", "DELETE")] [string]$method = "GET", - [Parameter(Mandatory)] + [Parameter( + Mandatory, + Helpmessage = "URI endpoint to be utilized. When submitting the URI, only the endpoint needs to be submitted. Please review the help documentation for examples." + )] [ValidateNotNullOrEmpty()] [string]$uri, - [ValidateNotNullOrEmpty()] - [string]$apiVersion = "v1", + [Parameter( + Helpmessage = "Body to be submitted to the REST API endpoint. This needs to be submitted in JSON format" + )] [ValidateNotNullOrEmpty()] [string]$body, - [ValidateNotNullOrEmpty()] - [string]$contentType = "application/json", + [Parameter( + Helpmessage = "PSCredential object. This is ONLY used when authenticating with the ZVM. No other endpoints require this and generally is not used." + )] [PSCredential]$credential, + [Parameter( + Helpmessage = "Use this switch if you would like the request headers returned along with the body. Useful for troubleshooting to get HTTP error codes." + )] [switch]$returnHeaders ) + # API version. Currently this is locked at v1 in all versions of Zerto. Should this change, will look + # at making this as parameter to be selected during function call. + $apiVersion = "v1" + # While the API can use XML or JSON, this module is built on JSON functionality. Currently forcing all + # content types and language to JSON. + $contentType = "application/json" $callerErrorActionPreference = $ErrorActionPreference # If the ZVM server and Port not defined, Stop Call if ( -not ((Test-Path variable:script:zvmServer) -and (Test-Path variable:script:zvmPort)) ) { @@ -22,7 +41,7 @@ function Invoke-ZertoRestRequest { } # If the Headers exist and the Last action was more than 30 minutes ago, Session is Expired - if ( (Test-Path variable:script:zvmHeaders) -and $([datetime]$script:zvmLastAction).addMinutes(30) -lt $(get-date) ) { + if ( (Test-Path variable:script:zvmHeaders) -and $([datetime]$script:zvmLastAction).addMinutes(30) -lt $(Get-Date) ) { Throw "Authorization Token has Expired. Please re-authorize to the Zerto Virtual Manager" } else { @@ -30,7 +49,7 @@ function Invoke-ZertoRestRequest { $submittedURI = "https://{0}:{1}/{2}/{3}" -f $script:zvmServer, $script:zvmPort, $apiVersion, $uri try { # Set the zvmLastAction time and try to submit the REST Request - $script:zvmLastAction = (get-date).Ticks + $script:zvmLastAction = (Get-Date).Ticks # If running PwSh - Use this Invoke-RestMethod with passed Variables if ($PSVersionTable.PSVersion.Major -ge 6) { $apiRequestResults = Invoke-RestMethod -Uri $submittedURI -Headers $script:zvmHeaders -Method $method -Body $body -ContentType $contentType -Credential $credential -SkipCertificateCheck -ResponseHeadersVariable responseHeaders -TimeoutSec 100 From 7cde687d709901fffe5fb9dfec9f593d52a9716a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 6 Mar 2020 13:42:58 -0500 Subject: [PATCH 293/479] Create Documentation for Newly Public Functions --- docs/Invoke-ZARestRequest.md | 100 +++++++++++++++++++++ docs/Invoke-ZertoRestRequest.md | 154 ++++++++++++++++++++++++++++++++ 2 files changed, 254 insertions(+) create mode 100644 docs/Invoke-ZARestRequest.md create mode 100644 docs/Invoke-ZertoRestRequest.md diff --git a/docs/Invoke-ZARestRequest.md b/docs/Invoke-ZARestRequest.md new file mode 100644 index 0000000..187e60d --- /dev/null +++ b/docs/Invoke-ZARestRequest.md @@ -0,0 +1,100 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZARestRequest.md +schema: 2.0.0 +--- + +# Invoke-ZARestRequest + +## SYNOPSIS +Function used to submit a REST request to the Zerto Analytics Portal. Should be used when attempting to submit a request inside a ZertoApiWrapper function or if attempting to perform an operation not currently covered in a ZertoApiWrapper function. + +## SYNTAX + +``` +Invoke-ZARestRequest [-uri] [[-method] ] [[-body] ] [] +``` + +## DESCRIPTION +Function used to submit a REST request to the Zerto Analytics Portal. Should be used when attempting to submit a request inside a ZertoApiWrapper function or if attempting to perform an operation not currently covered in a ZertoApiWrapper function. To function properly, you will have to have completed a connection to a Zerto Virtual Manager with the `Connect-ZertoAnalytics` function. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method GET +``` + +Submits a GET request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint'. Check the API documentation for the endpoint to ensure the URI is formatted correctly. Typically a GET request does not require a BODY parameter. + +### Example 1 +```powershell +PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method POST -Body $Body +``` + +Submits a PUT request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint' with a Body parameter. Check the API documentation for the endpoint to ensure the URI is formatted correctly and the format of the Body variable. The command above assumes that the $Body variable is an object that can be formatted into JSON. + +## PARAMETERS + +### -body +Body to be submitted to the REST API endpoint. +This needs to be submitted in JSON format + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -method +API method to be used. +GET, PUT, POST, or DELETE. +Refer to documentation for the API endpoint to ensure the correct method is being used. +If unspecified, defaults to GET + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: GET +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -uri +Parameter help description + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics API Endpoint Documentation](https://docs.api.zerto.com/) diff --git a/docs/Invoke-ZertoRestRequest.md b/docs/Invoke-ZertoRestRequest.md new file mode 100644 index 0000000..b2ad214 --- /dev/null +++ b/docs/Invoke-ZertoRestRequest.md @@ -0,0 +1,154 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZertoRestRequest.md +schema: 2.0.0 +--- + +# Invoke-ZertoRestRequest + +## SYNOPSIS +Function used to submit a REST request to the Zerto Virtual Manager. Should be used when attempting to submit a request inside a ZertoApiWrapper function or if attempting to perform an operation not currently covered in a ZertoApiWrapper function. + +## SYNTAX + +``` +Invoke-ZertoRestRequest [[-method] ] [-uri] [[-body] ] [[-credential] ] + [-returnHeaders] [] +``` + +## DESCRIPTION +Function used to submit a REST request to the Zerto Virtual Manager. Should be used when attempting to submit a request inside a ZertoApiWrapper function or if attempting to perform an operation not currently covered in a ZertoApiWrapper function. To function properly, you will have to have completed a connection to a Zerto Virtual Manager with the `Connect-ZertoServer` function. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method POST -Body $Body +``` + +Submits a POST request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint' with a Body parameter. Check the API documentation for the endpoint to ensure the URI is formatted correctly and the format of the Body variable. The command above assumes that the $Body variable is a string properly formatted for JSON + +### Example 2 +```powershell +PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method POST -Body ($Body | ConvertTo-Json) +``` + +Submits a POST request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint' with a Body parameter. Check the API documentation for the endpoint to ensure the URI is formatted correctly and the format of the Body variable. The command above assumes that the $Body variable is an object that can be formatted into JSON. + +### Example 3 +```powershell +PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method PUT -Body $Body +``` + +Submits a PUT request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint' with a Body parameter. Check the API documentation for the endpoint to ensure the URI is formatted correctly and the format of the Body variable. The command above assumes that the $Body variable is a string properly formatted for JSON + +### Example 4 +```powershell +PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method DELETE +``` + +Submits a DELETE request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint'. Check the API documentation for the endpoint to ensure the URI is formatted correctly. Typically a DELETE request does not require a BODY parameter. + +### Example 5 +```powershell +PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method GET +``` + +Submits a GET request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint'. Check the API documentation for the endpoint to ensure the URI is formatted correctly. Typically a GET request does not require a BODY parameter. + +## PARAMETERS + +### -body +Body to be submitted to the REST API endpoint. +This needs to be submitted in JSON format + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -credential +PSCredential object. +This is ONLY used when authenticating with the ZVM. +No other endpoints require this and generally is not used. + +```yaml +Type: PSCredential +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -method +Parameter help description + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: GET +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -returnHeaders +Use this switch if you would like the request headers returned along with the body. +Useful for troubleshooting to get HTTP error codes. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -uri +URI endpoint to be utilized. +When submitting the URI, only the endpoint needs to be submitted. +Please review the help documentation for examples. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Virtual Replication API Endpoint Documentation](https://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20(ZVM)%20-%20vSphere%20Online%20Help/content/intro/book_in_portal_-_zvr_restful_apis.htm) From b0edd9026fdd331394ea9ac2cac38958e41facd7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 6 Mar 2020 14:08:12 -0500 Subject: [PATCH 294/479] Update RELEASENOTES.md --- RELEASENOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 9267c2c..891d95c 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -8,3 +8,4 @@ * Refactored the `Checkpoint-ZertoVpg` command to allow pipeline input (ByValue and ByProperty) for the VpgName parameter. * Corrected a parameter typo in the `Get-ZertoVpgSetting` function. The misspelt parameter was added as an alias to ensure any existing scripts using the parameter continue to function. * Refactored the `Get-ZertoVpg` command to remove repetitive commands and variables that are no longer required. +* Moved `Invoke-ZertoRestRequest` and `Invoke-ZARestRequest` to be public functions. As there become more and more scenarios where there are not prebuilt functions to accomplish complex specialized tasks, it became apparent that these functions could be leveraged to make the experience and workflow easier. From a891a4914df420d2d98397522917eace1cb2d5f3 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 8 Mar 2020 14:39:34 -0400 Subject: [PATCH 295/479] Create Get-ZAPlannerSite.ps1 --- ZertoApiWrapper/Public/Get-ZAPlannerSite.ps1 | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 ZertoApiWrapper/Public/Get-ZAPlannerSite.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZAPlannerSite.ps1 b/ZertoApiWrapper/Public/Get-ZAPlannerSite.ps1 new file mode 100644 index 0000000..44adc6c --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAPlannerSite.ps1 @@ -0,0 +1,22 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAPlannerSite { + [cmdletbinding()] + param( + [Parameter( + HelpMessage = "The site identifier(s) for which to return detailed information." + )] + [ValidateNotNullOrEmpty()] + [string[]]$siteIdentifier + ) + $uri = "planner/sites" + if ( -not [String]::IsNullorEmpty($siteIdentifier) ) { + $entry = foreach ($id in $siteIdentifier) { + "{0}/{1}" -f $uri, $id + } + } else { + $entry = $uri + } + foreach ($uri in $entry) { + Invoke-ZARestRequest -uri $uri + } +} From d35d9d7cf40f5b2bdc79bb87c44958191bbca5d8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 8 Mar 2020 14:40:22 -0400 Subject: [PATCH 296/479] Create Get-ZAPlannerStatsReport.ps1 --- .../Public/Get-ZAPlannerStatsReport.ps1 | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 ZertoApiWrapper/Public/Get-ZAPlannerStatsReport.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZAPlannerStatsReport.ps1 b/ZertoApiWrapper/Public/Get-ZAPlannerStatsReport.ps1 new file mode 100644 index 0000000..e1d6f69 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAPlannerStatsReport.ps1 @@ -0,0 +1,60 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAPlannerStatsReport { + [cmdletbinding()] + param( + [Parameter( + Mandatory, + HelpMessage = "The site identifier(s) for which to return detailed information." + )] + [ValidateNotNullOrEmpty()] + [string]$siteIdentifier, + [Parameter( + Mandatory, + HelpMessage = "Type of target recovery site." + )] + [ValidateSet('azure', 'vcenter', 'vcd', 'scvmm', 'aws')] + [string]$recoveryType, + [Parameter( + Mandatory, + HelpMessage = "Identifiers of the VMs you want to recover at the target recovery site." + )] + [ValidateNotNullOrEmpty()] + [string[]]$vmIdentifier, + [Parameter( + HelpMessage = "The desired journal history in hours. The default is 24 hours. Limited to a 1 hour up to 720 hours, or the equivalent of 30 days" + )] + [ValidateRange(1, 720)] + [Int]$desiredJournalHistory = 24, + [Parameter( + HelpMessage = "The earliest timestamp of an event to return, in RFC 3339 standard. ('1970-01-01T00:00:00Z'). The default is one year ago." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The latest timestamp of an event to return, in RFC 3339 standard. ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + $uri = "planner/reports/stats" + $body = @{ + siteIdentifier = $siteIdentifier + recoveryType = $recoveryType + desiredJournalHistory = $desiredJournalHistory + vms = New-Object System.Collections.Generic.List[psobject] + } + if ( -not [String]::IsNullOrEmpty($startDate) ) { + $body['startDate'] = $startDate + } + if ( -not [String]::IsNullOrEmpty($endDate) ) { + $body['endDate'] = $endDate + } + foreach ($vmId in $vmIdentifier) { + $body['vms'].Add(@{'identifier' = $vmId; 'desiredJournalHistory' = $desiredJournalHistory }) + } + ($body | ConvertTo-Json) + $reportId = Invoke-ZARestRequest -uri $uri -method POST -body ($body | ConvertTo-Json) + $reportId.reportId + $uri = '{0}?reportId={1}' -f $uri, $reportId.reportId + Invoke-ZARestRequest -uri $uri +} From 169e628c7b59c9e0f8fc3eb3aadb97e03a72fb30 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 8 Mar 2020 14:57:19 -0400 Subject: [PATCH 297/479] Remove Debugging Output --- ZertoApiWrapper/Public/Get-ZAPlannerStatsReport.ps1 | 2 -- 1 file changed, 2 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZAPlannerStatsReport.ps1 b/ZertoApiWrapper/Public/Get-ZAPlannerStatsReport.ps1 index e1d6f69..e247c86 100644 --- a/ZertoApiWrapper/Public/Get-ZAPlannerStatsReport.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAPlannerStatsReport.ps1 @@ -52,9 +52,7 @@ function Get-ZAPlannerStatsReport { foreach ($vmId in $vmIdentifier) { $body['vms'].Add(@{'identifier' = $vmId; 'desiredJournalHistory' = $desiredJournalHistory }) } - ($body | ConvertTo-Json) $reportId = Invoke-ZARestRequest -uri $uri -method POST -body ($body | ConvertTo-Json) - $reportId.reportId $uri = '{0}?reportId={1}' -f $uri, $reportId.reportId Invoke-ZARestRequest -uri $uri } From 1317a6c039a36fc12451e29231aa535ceb767a68 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 8 Mar 2020 17:33:24 -0400 Subject: [PATCH 298/479] Create Get-ZAPlannerJournalSizeReport.ps1 --- .../Public/Get-ZAPlannerJournalSizeReport.ps1 | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 ZertoApiWrapper/Public/Get-ZAPlannerJournalSizeReport.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZAPlannerJournalSizeReport.ps1 b/ZertoApiWrapper/Public/Get-ZAPlannerJournalSizeReport.ps1 new file mode 100644 index 0000000..5ea91a5 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAPlannerJournalSizeReport.ps1 @@ -0,0 +1,58 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAPlannerJournalSizeReport { + [cmdletbinding()] + param( + [Parameter( + Mandatory, + HelpMessage = "The site identifier(s) for which to return detailed information." + )] + [ValidateNotNullOrEmpty()] + [string]$siteIdentifier, + [Parameter( + Mandatory, + HelpMessage = "Type of target recovery site." + )] + [ValidateSet('azure', 'vcenter', 'vcd', 'scvmm', 'aws')] + [string]$recoveryType, + [Parameter( + Mandatory, + HelpMessage = "Identifiers of the VMs you want to recover at the target recovery site." + )] + [ValidateNotNullOrEmpty()] + [string[]]$vmIdentifier, + [Parameter( + HelpMessage = "The desired journal history in hours. The default is 24 hours. Limited to a 1 hour up to 720 hours, or the equivalent of 30 days" + )] + [ValidateRange(1, 720)] + [Int]$desiredJournalHistory = 24, + [Parameter( + HelpMessage = "The earliest timestamp of an event to return, in RFC 3339 standard. ('1970-01-01T00:00:00Z'). The default is one year ago." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The latest timestamp of an event to return, in RFC 3339 standard. ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + $uri = "planner/reports/stats/journal-size" + $body = @{ + siteIdentifier = $siteIdentifier + recoveryType = $recoveryType + desiredJournalHistory = $desiredJournalHistory + vms = New-Object System.Collections.Generic.List[psobject] + } + if ( -not [String]::IsNullOrEmpty($startDate) ) { + $body['startDate'] = $startDate + } + if ( -not [String]::IsNullOrEmpty($endDate) ) { + $body['endDate'] = $endDate + } + foreach ($vmId in $vmIdentifier) { + $body['vms'].Add(@{'identifier' = $vmId; 'desiredJournalHistory' = $desiredJournalHistory }) + } + $reportId = Invoke-ZARestRequest -uri $uri -method POST -body ($body | ConvertTo-Json) + $uri = '{0}?reportId={1}' -f $uri, $reportId.reportId + Invoke-ZARestRequest -uri $uri +} From ce5a64c6834f3bed0b2bdf1371ceb23b98bd88ef Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 8 Mar 2020 17:33:27 -0400 Subject: [PATCH 299/479] Create Get-ZAPlannerNetworkPerformanceReport.ps1 --- .../Get-ZAPlannerNetworkPerformanceReport.ps1 | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 ZertoApiWrapper/Public/Get-ZAPlannerNetworkPerformanceReport.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZAPlannerNetworkPerformanceReport.ps1 b/ZertoApiWrapper/Public/Get-ZAPlannerNetworkPerformanceReport.ps1 new file mode 100644 index 0000000..c0a6b12 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAPlannerNetworkPerformanceReport.ps1 @@ -0,0 +1,58 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAPlannerNetworkPerformanceReport { + [cmdletbinding()] + param( + [Parameter( + Mandatory, + HelpMessage = "The site identifier(s) for which to return detailed information." + )] + [ValidateNotNullOrEmpty()] + [string]$siteIdentifier, + [Parameter( + Mandatory, + HelpMessage = "Type of target recovery site." + )] + [ValidateSet('azure', 'vcenter', 'vcd', 'scvmm', 'aws')] + [string]$recoveryType, + [Parameter( + Mandatory, + HelpMessage = "Identifiers of the VMs you want to recover at the target recovery site." + )] + [ValidateNotNullOrEmpty()] + [string[]]$vmIdentifier, + [Parameter( + HelpMessage = "The desired sample interval in seconds. The default is 3600 seconds (1 Hour). Limited to a 60 second to 86,400 second (24 Hour) interval" + )] + [ValidateRange(60, 86400)] + [Int]$interval = 3600, + [Parameter( + HelpMessage = "The earliest timestamp of an event to return, in RFC 3339 standard. ('1970-01-01T00:00:00Z'). The default is one year ago." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The latest timestamp of an event to return, in RFC 3339 standard. ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + $uri = "planner/reports/network-performance" + $body = @{ + siteIdentifier = $siteIdentifier + recoveryType = $recoveryType + interval = $interval + vmIdentifiers = New-Object System.Collections.Generic.List[psobject] + } + if ( -not [String]::IsNullOrEmpty($startDate) ) { + $body['startDate'] = $startDate + } + if ( -not [String]::IsNullOrEmpty($endDate) ) { + $body['endDate'] = $endDate + } + foreach ($vmId in $vmIdentifier) { + $body['vmIdentifiers'].Add($vmId) + } + $reportId = Invoke-ZARestRequest -uri $uri -method POST -body ($body | ConvertTo-Json) + $uri = '{0}?reportId={1}' -f $uri, $reportId.reportId + Invoke-ZARestRequest -uri $uri +} From 7fc0a5f5793a8267e0979e403a19429fbe915a16 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 8 Mar 2020 17:33:31 -0400 Subject: [PATCH 300/479] Create Get-ZAPlannerWanReport.ps1 --- .../Public/Get-ZAPlannerWanReport.ps1 | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 ZertoApiWrapper/Public/Get-ZAPlannerWanReport.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZAPlannerWanReport.ps1 b/ZertoApiWrapper/Public/Get-ZAPlannerWanReport.ps1 new file mode 100644 index 0000000..f678504 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAPlannerWanReport.ps1 @@ -0,0 +1,52 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAPlannerWanReport { + [cmdletbinding()] + param( + [Parameter( + Mandatory, + HelpMessage = "The site identifier(s) for which to return detailed information." + )] + [ValidateNotNullOrEmpty()] + [string]$siteIdentifier, + [Parameter( + Mandatory, + HelpMessage = "Type of target recovery site." + )] + [ValidateSet('azure', 'vcenter', 'vcd', 'scvmm', 'aws')] + [string]$recoveryType, + [Parameter( + Mandatory, + HelpMessage = "Identifiers of the VMs you want to recover at the target recovery site." + )] + [ValidateNotNullOrEmpty()] + [string[]]$vmIdentifier, + [Parameter( + HelpMessage = "The earliest timestamp of an event to return, in RFC 3339 standard. ('1970-01-01T00:00:00Z'). The default is one year ago." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The latest timestamp of an event to return, in RFC 3339 standard. ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + $uri = "planner/reports/stats/wan" + $body = @{ + siteIdentifier = $siteIdentifier + recoveryType = $recoveryType + vmIdentifiers = New-Object System.Collections.Generic.List[psobject] + } + if ( -not [String]::IsNullOrEmpty($startDate) ) { + $body['startDate'] = $startDate + } + if ( -not [String]::IsNullOrEmpty($endDate) ) { + $body['endDate'] = $endDate + } + foreach ($vmId in $vmIdentifier) { + $body['vmIdentifiers'].Add($vmId) + } + $reportId = Invoke-ZARestRequest -uri $uri -method POST -body ($body | ConvertTo-Json) + $uri = '{0}?reportId={1}' -f $uri, $reportId.reportId + Invoke-ZARestRequest -uri $uri +} From 02e50d9cd63fa96166ba57411274159c84377a7c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 8 Mar 2020 17:33:36 -0400 Subject: [PATCH 301/479] Create Get-ZAPlannerZcasReport.ps1 --- .../Public/Get-ZAPlannerZcasReport.ps1 | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 ZertoApiWrapper/Public/Get-ZAPlannerZcasReport.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZAPlannerZcasReport.ps1 b/ZertoApiWrapper/Public/Get-ZAPlannerZcasReport.ps1 new file mode 100644 index 0000000..c278502 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAPlannerZcasReport.ps1 @@ -0,0 +1,54 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAPlannerZcasReport { + [cmdletbinding()] + param( + [Parameter( + Mandatory, + HelpMessage = "The site identifier(s) for which to return detailed information." + )] + [ValidateNotNullOrEmpty()] + [string]$siteIdentifier, + [Parameter( + Mandatory, + HelpMessage = "Type of target recovery site." + )] + [ValidateSet('azure', 'vcenter', 'vcd', 'scvmm', 'aws')] + [string]$recoveryType, + [Parameter( + Mandatory, + HelpMessage = "Identifiers of the VMs you want to recover at the target recovery site." + )] + [ValidateNotNullOrEmpty()] + [string[]]$vmIdentifier, + [Parameter( + HelpMessage = "The earliest timestamp of an event to return, in RFC 3339 standard. ('1970-01-01T00:00:00Z'). The default is one year ago." + )] + [ValidateNotNullOrEmpty()] + [string]$startDate, + [Parameter( + HelpMessage = "The latest timestamp of an event to return, in RFC 3339 standard. ('1970-01-01T00:00:00Z'). The default is the current time." + )] + [ValidateNotNullOrEmpty()] + [string]$endDate + ) + $uri = "planner/reports/stats/zcas" + $body = @{ + siteIdentifier = $siteIdentifier + recoveryType = $recoveryType + vmIdentifiers = New-Object System.Collections.Generic.List[psobject] + } + if ( -not [String]::IsNullOrEmpty($startDate) ) { + $body['startDate'] = $startDate + } + if ( -not [String]::IsNullOrEmpty($endDate) ) { + $body['endDate'] = $endDate + } + foreach ($vmId in $vmIdentifier) { + $body['vmIdentifiers'].Add($vmId) + } + #$body | ConvertTo-Json + $reportId = Invoke-ZARestRequest -uri $uri -method POST -body ($body | ConvertTo-Json) + #Start-Sleep 10 + $uri = '{0}?reportId={1}' -f $uri, $reportId.reportId + Invoke-ZARestRequest -uri $uri +} From 8bd865d83d9e59aa9a6117983406bd0d54f58bda Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 8 Mar 2020 22:45:51 -0400 Subject: [PATCH 302/479] Create Template Help Files --- docs/Get-ZAPlannerJournalSizeReport.md | 139 +++++++++++++++++ docs/Get-ZAPlannerNetworkPerformanceReport.md | 140 ++++++++++++++++++ docs/Get-ZAPlannerSite.md | 57 +++++++ docs/Get-ZAPlannerStatsReport.md | 139 +++++++++++++++++ docs/Get-ZAPlannerWanReport.md | 122 +++++++++++++++ docs/Get-ZAPlannerZcasReport.md | 122 +++++++++++++++ 6 files changed, 719 insertions(+) create mode 100644 docs/Get-ZAPlannerJournalSizeReport.md create mode 100644 docs/Get-ZAPlannerNetworkPerformanceReport.md create mode 100644 docs/Get-ZAPlannerSite.md create mode 100644 docs/Get-ZAPlannerStatsReport.md create mode 100644 docs/Get-ZAPlannerWanReport.md create mode 100644 docs/Get-ZAPlannerZcasReport.md diff --git a/docs/Get-ZAPlannerJournalSizeReport.md b/docs/Get-ZAPlannerJournalSizeReport.md new file mode 100644 index 0000000..3579885 --- /dev/null +++ b/docs/Get-ZAPlannerJournalSizeReport.md @@ -0,0 +1,139 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZAPlannerJournalSizeReport + +## SYNOPSIS + +## SYNTAX + +``` +Get-ZAPlannerJournalSizeReport [-siteIdentifier] [-recoveryType] [-vmIdentifier] + [[-desiredJournalHistory] ] [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION +{{Fill in the Description}} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -desiredJournalHistory +The desired journal history in hours. +The default is 24 hours. +Limited to a 1 hour up to 720 hours, or the equivalent of 30 days + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 24 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -endDate +The latest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 6 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoveryType +Type of target recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -siteIdentifier +The site identifier(s) for which to return detailed information. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The earliest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is one year ago. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vmIdentifier +Identifiers of the VMs you want to recover at the target recovery site. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/Get-ZAPlannerNetworkPerformanceReport.md b/docs/Get-ZAPlannerNetworkPerformanceReport.md new file mode 100644 index 0000000..5dd4498 --- /dev/null +++ b/docs/Get-ZAPlannerNetworkPerformanceReport.md @@ -0,0 +1,140 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZAPlannerNetworkPerformanceReport + +## SYNOPSIS + +## SYNTAX + +``` +Get-ZAPlannerNetworkPerformanceReport [-siteIdentifier] [-recoveryType] + [-vmIdentifier] [[-interval] ] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION +{{Fill in the Description}} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -endDate +The latest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 6 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The desired sample interval in seconds. +The default is 3600 seconds (1 Hour). +Limited to a 60 second to 86,400 second (24 Hour) interval + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 3600 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoveryType +Type of target recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -siteIdentifier +The site identifier(s) for which to return detailed information. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The earliest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is one year ago. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vmIdentifier +Identifiers of the VMs you want to recover at the target recovery site. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/Get-ZAPlannerSite.md b/docs/Get-ZAPlannerSite.md new file mode 100644 index 0000000..986ee4e --- /dev/null +++ b/docs/Get-ZAPlannerSite.md @@ -0,0 +1,57 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZAPlannerSite + +## SYNOPSIS + +## SYNTAX + +``` +Get-ZAPlannerSite [[-siteIdentifier] ] [] +``` + +## DESCRIPTION +{{Fill in the Description}} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -siteIdentifier +The site identifier(s) for which to return detailed information. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/Get-ZAPlannerStatsReport.md b/docs/Get-ZAPlannerStatsReport.md new file mode 100644 index 0000000..63195d2 --- /dev/null +++ b/docs/Get-ZAPlannerStatsReport.md @@ -0,0 +1,139 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZAPlannerStatsReport + +## SYNOPSIS + +## SYNTAX + +``` +Get-ZAPlannerStatsReport [-siteIdentifier] [-recoveryType] [-vmIdentifier] + [[-desiredJournalHistory] ] [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION +{{Fill in the Description}} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -desiredJournalHistory +The desired journal history in hours. +The default is 24 hours. +Limited to a 1 hour up to 720 hours, or the equivalent of 30 days + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 24 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -endDate +The latest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 6 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoveryType +Type of target recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -siteIdentifier +The site identifier(s) for which to return detailed information. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The earliest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is one year ago. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vmIdentifier +Identifiers of the VMs you want to recover at the target recovery site. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/Get-ZAPlannerWanReport.md b/docs/Get-ZAPlannerWanReport.md new file mode 100644 index 0000000..e4c48c0 --- /dev/null +++ b/docs/Get-ZAPlannerWanReport.md @@ -0,0 +1,122 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZAPlannerWanReport + +## SYNOPSIS + +## SYNTAX + +``` +Get-ZAPlannerWanReport [-siteIdentifier] [-recoveryType] [-vmIdentifier] + [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION +{{Fill in the Description}} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -endDate +The latest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoveryType +Type of target recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -siteIdentifier +The site identifier(s) for which to return detailed information. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The earliest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is one year ago. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vmIdentifier +Identifiers of the VMs you want to recover at the target recovery site. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/Get-ZAPlannerZcasReport.md b/docs/Get-ZAPlannerZcasReport.md new file mode 100644 index 0000000..9dd5bd5 --- /dev/null +++ b/docs/Get-ZAPlannerZcasReport.md @@ -0,0 +1,122 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZAPlannerZcasReport + +## SYNOPSIS + +## SYNTAX + +``` +Get-ZAPlannerZcasReport [-siteIdentifier] [-recoveryType] [-vmIdentifier] + [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION +{{Fill in the Description}} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -endDate +The latest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoveryType +Type of target recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -siteIdentifier +The site identifier(s) for which to return detailed information. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The earliest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is one year ago. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vmIdentifier +Identifiers of the VMs you want to recover at the target recovery site. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS From c2f554dca13940f051ff2a045c00a28f758d3282 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 18 Mar 2020 13:54:58 -0400 Subject: [PATCH 303/479] Update Get-ZAPlannerSite.md --- docs/Get-ZAPlannerSite.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/Get-ZAPlannerSite.md b/docs/Get-ZAPlannerSite.md index 986ee4e..c1e7554 100644 --- a/docs/Get-ZAPlannerSite.md +++ b/docs/Get-ZAPlannerSite.md @@ -1,13 +1,14 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerSite.md schema: 2.0.0 --- # Get-ZAPlannerSite ## SYNOPSIS +Retrieve all active Planner sites for a specific account – includes ID, Name and Type or retrieves datacenter, host, and VMs for a specific site. ## SYNTAX @@ -16,16 +17,23 @@ Get-ZAPlannerSite [[-siteIdentifier] ] [] ``` ## DESCRIPTION -{{Fill in the Description}} +Retrieve all active Planner sites for a specific account – includes ID, Name and Type or retrieves datacenter, host, and VMs for a specific site. ## EXAMPLES ### Example 1 ```powershell -PS C:\> {{ Add example code here }} +PS C:\> Get-ZAPlannerSite ``` -{{ Add example description here }} +Retrieve all active Planner sites for a specific account + +### Example 2 +```powershell +PS C:\> Get-ZAPlannerSite -siteIdentifier '0123-45676-09876' +``` + +Retrieves datacenter, host, and VMs for site with Identifier '0123-45676-09876'. ## PARAMETERS @@ -55,3 +63,5 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink ## NOTES ## RELATED LINKS +[Zerto Analytics Sites Planner Endpoint](https://docs.api.zerto.com/#/Planner/get_v2_planner_sites) +[Zerto Analytics Single Site Planner Endpoint](https://docs.api.zerto.com/#/Planner/get_v2_planner_sites) From 07f92583f80938e2426ba4b745232fa0c2132372 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 18 Mar 2020 13:57:12 -0400 Subject: [PATCH 304/479] Update Single Site URL --- docs/Get-ZAPlannerSite.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Get-ZAPlannerSite.md b/docs/Get-ZAPlannerSite.md index c1e7554..d2a0387 100644 --- a/docs/Get-ZAPlannerSite.md +++ b/docs/Get-ZAPlannerSite.md @@ -64,4 +64,4 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink ## RELATED LINKS [Zerto Analytics Sites Planner Endpoint](https://docs.api.zerto.com/#/Planner/get_v2_planner_sites) -[Zerto Analytics Single Site Planner Endpoint](https://docs.api.zerto.com/#/Planner/get_v2_planner_sites) +[Zerto Analytics Single Site Planner Endpoint](https://docs.api.zerto.com/#/Planner/get_v2_planner_sites__siteIdentifier_) From e516a24e38ebaebe1a9b8fb05a2aaccf499ea8cd Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 19 Mar 2020 09:19:48 -0400 Subject: [PATCH 305/479] Update Get-ZAPlannerJournalSizeReport.md --- docs/Get-ZAPlannerJournalSizeReport.md | 32 ++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/docs/Get-ZAPlannerJournalSizeReport.md b/docs/Get-ZAPlannerJournalSizeReport.md index 3579885..719cae7 100644 --- a/docs/Get-ZAPlannerJournalSizeReport.md +++ b/docs/Get-ZAPlannerJournalSizeReport.md @@ -1,13 +1,14 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerJournalSizeReport.md schema: 2.0.0 --- # Get-ZAPlannerJournalSizeReport ## SYNOPSIS +Create a report request to retrieve the Journal Size for a specific VMs list, and timeframe. ## SYNTAX @@ -17,16 +18,37 @@ Get-ZAPlannerJournalSizeReport [-siteIdentifier] [-recoveryType] {{ Add example code here }} +PS C:\> Get-ZAPlannerJournalSizeReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' ``` -{{ Add example description here }} +Gets a Journal report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. The report will cover a Journal History of 24 hours. This will use all data contained in Zerto Analytics to create the Journal report. + +### Example 2 +```powershell +PS C:\> Get-ZAPlannerJournalSizeReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -desiredJournalHistory 96 +``` + +Gets a Journal report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. The report will cover a Journal History of 96 hours (4 days). This will use all data contained in Zerto Analytics to create the Journal report. + +### Example 3 +```powershell +PS C:\> Get-ZAPlannerJournalSizeReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -desiredJournalHistory 96 -startDate '2020-01-01' +``` + +Gets a Journal report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. The report will cover a Journal History of 96 hours (4 days). This will use all data starting from Jan 1st to today contained in Zerto Analytics to create the Journal report. + +### Example 4 +```powershell +PS C:\> Get-ZAPlannerJournalSizeReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -desiredJournalHistory 96 -startDate '2020-01-01' -endDate '2020-01-30' +``` + +Gets a Journal report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. The report will cover a Journal History of 96 hours (4 days). This will use all data starting from Jan 1st to Jan 30th contained in Zerto Analytics to create the Journal report. ## PARAMETERS @@ -137,3 +159,5 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink ## NOTES ## RELATED LINKS +[Zerto Planner Journal Size Report - Post](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_stats_journal_size) +[Zerto Planner Journal Size Report - Get](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_stats_journal_size) From eccc5f27f335234a444ed8ca3bb8bf76f48744a9 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 19 Mar 2020 09:21:05 -0400 Subject: [PATCH 306/479] Update Get-ZAPlannerNetworkPerformanceReport.md --- docs/Get-ZAPlannerNetworkPerformanceReport.md | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/docs/Get-ZAPlannerNetworkPerformanceReport.md b/docs/Get-ZAPlannerNetworkPerformanceReport.md index 5dd4498..4f17ecc 100644 --- a/docs/Get-ZAPlannerNetworkPerformanceReport.md +++ b/docs/Get-ZAPlannerNetworkPerformanceReport.md @@ -1,13 +1,15 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerNetworkPerformanceReport.md schema: 2.0.0 --- # Get-ZAPlannerNetworkPerformanceReport ## SYNOPSIS +Create a report request to retrieve the Network Performance for a specific VMs list, and timeframe. + ## SYNTAX @@ -18,16 +20,30 @@ Get-ZAPlannerNetworkPerformanceReport [-siteIdentifier] [-recoveryType] ``` ## DESCRIPTION -{{Fill in the Description}} +Create a report request to retrieve the Network Performance for a specific VMs list, and timeframe. ## EXAMPLES ### Example 1 ```powershell -PS C:\> {{ Add example code here }} +PS C:\> Get-ZAPlannerNetworkPerformanceReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' ``` -{{ Add example description here }} +Gets a Network Performance report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. This will use all data contained in Zerto Analytics to create the Journal report. + +### Example 2 +```powershell +PS C:\> Get-ZAPlannerNetworkPerformanceReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -startDate '2020-01-01' -interval 86400 +``` + +Gets a Network Performance report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. This will use data contained in Zerto Analytics starting Jan 1st, 2020 ending on the day the report is run to create the Journal report. Sample reporting interval will be 86400 seconds (1 day). + +### Example 3 +```powershell +PS C:\> Get-ZAPlannerNetworkPerformanceReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -startDate '2020-01-01' -endDate '2020-01-30' -interval 86400 +``` + +Gets a Network Performance report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. This will use data contained in Zerto Analytics starting Jan 1st, 2020 ending on Jan 30th, 2020 to create the Journal report. Sample reporting interval will be 86400 seconds (1 day). ## PARAMETERS @@ -138,3 +154,6 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink ## NOTES ## RELATED LINKS +[Zerto Analytics Planner Network-Performance API Endpoint - POST](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_network_performance) +[Zerto Analytics Planner Network-Performance API Endpoint - GET](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_network_performance) + From 3e980dc195107f8dc5105b174f8d3e101ab09333 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 19 Mar 2020 16:25:28 -0400 Subject: [PATCH 307/479] Add Online Help URI --- docs/Get-ZAPlannerStatsReport.md | 2 +- docs/Get-ZAPlannerWanReport.md | 2 +- docs/Get-ZAPlannerZcasReport.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Get-ZAPlannerStatsReport.md b/docs/Get-ZAPlannerStatsReport.md index 63195d2..cd2e4b9 100644 --- a/docs/Get-ZAPlannerStatsReport.md +++ b/docs/Get-ZAPlannerStatsReport.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerStatsReport.md schema: 2.0.0 --- diff --git a/docs/Get-ZAPlannerWanReport.md b/docs/Get-ZAPlannerWanReport.md index e4c48c0..321021a 100644 --- a/docs/Get-ZAPlannerWanReport.md +++ b/docs/Get-ZAPlannerWanReport.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerWanReport.md schema: 2.0.0 --- diff --git a/docs/Get-ZAPlannerZcasReport.md b/docs/Get-ZAPlannerZcasReport.md index 9dd5bd5..911412f 100644 --- a/docs/Get-ZAPlannerZcasReport.md +++ b/docs/Get-ZAPlannerZcasReport.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerZcasReport.md schema: 2.0.0 --- From de08f0eece205cc2e0dd093817882aa0b760b30d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 19 Mar 2020 17:08:08 -0400 Subject: [PATCH 308/479] Ensure the right DSId is mapped to the target host. --- ZertoApiWrapper/Public/Install-ZertoVra.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ZertoApiWrapper/Public/Install-ZertoVra.ps1 b/ZertoApiWrapper/Public/Install-ZertoVra.ps1 index 2bca65f..1199117 100644 --- a/ZertoApiWrapper/Public/Install-ZertoVra.ps1 +++ b/ZertoApiWrapper/Public/Install-ZertoVra.ps1 @@ -40,6 +40,14 @@ function Install-ZertoVra { $hostIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -hosts | Where-Object {$_.VirtualizationHostName -eq $hostName} | Select-Object hostIdentifier -ExpandProperty hostIdentifier $networkIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -networks | Where-Object {$_.VirtualizationNetworkName -eq $networkName} | Select-Object NetworkIdentifier -ExpandProperty NetworkIdentifier $datastoreIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -datastores | Where-Object {$_.DatastoreName -eq $datastoreName} | Select-Object DatastoreIdentifier -ExpandProperty DatastoreIdentifier + if ($datastoreIdentifier.count -gt 1){ + $hostDevices = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -devices -hostIdentifier $hostIdentifier + $datastoreIdentifier = foreach ($identifier in $datastoreIdentifier) { + if ($identifier -in $hostDevices.DatastoreIdentifier){ + $identifier + } + } + } # Build the JSON object through an Ordered Hashtable. $vraBasic = [ordered]@{} From 2ea7092b910a469bfce1c2a8a9c994f6014b821d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 1 Apr 2020 17:14:21 -0400 Subject: [PATCH 309/479] Update logic to only allow install to attached devices --- Tests/Public/Install-ZertoVra.Tests.ps1 | 6 ++--- ZertoApiWrapper/Public/Install-ZertoVra.ps1 | 26 ++++++++++++--------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Tests/Public/Install-ZertoVra.Tests.ps1 b/Tests/Public/Install-ZertoVra.Tests.ps1 index 03cb03d..f4c529d 100644 --- a/Tests/Public/Install-ZertoVra.Tests.ps1 +++ b/Tests/Public/Install-ZertoVra.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 22 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 22 + It "$global:function should have exactly 22 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 22 } $ParameterTestCases = @( @@ -35,7 +35,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { 'IpAddr' { $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes $attrs.Where{ $_ -is [ValidateScript] }.Count | Should -Be 1 - $attrs.Where{ $_ -is [ValidateScript] }.ScriptBlock | Should -Match '^\$_ \-match \[IPAddress\]\$_' + $attrs.Where{ $_ -is [ValidateScript] }.ScriptBlock | Should -Match '\$_ \-match \[IPAddress\]\$_' } $null { diff --git a/ZertoApiWrapper/Public/Install-ZertoVra.ps1 b/ZertoApiWrapper/Public/Install-ZertoVra.ps1 index 1199117..0e4ec45 100644 --- a/ZertoApiWrapper/Public/Install-ZertoVra.ps1 +++ b/ZertoApiWrapper/Public/Install-ZertoVra.ps1 @@ -21,13 +21,13 @@ function Install-ZertoVra { [Parameter( ParameterSetName = "Dhcp", Mandatory = $true, HelpMessage = "Assign a DHCP address to the VRA." )] [switch]$Dhcp, [Parameter( ParameterSetName = "StaticIp", Mandatory = $true, HelpMessage = "Static IP address to assign to the VRA." )] - [ValidateScript( {$_ -match [IPAddress]$_ })] + [ValidateScript( { $_ -match [IPAddress]$_ })] [string]$vraIpAddress, [Parameter( ParameterSetName = "StaticIp", Mandatory = $true, HelpMessage = "Default gateway to assign to the VRA" )] - [ValidateScript( {$_ -match [IPAddress]$_ })] + [ValidateScript( { $_ -match [IPAddress]$_ })] [string]$defaultGateway, [Parameter( ParameterSetName = "StaticIp", Mandatory = $true, HelpMessage = "Subnetmask to be assigned to the VRA" )] - [ValidateScript( {$_ -match [IPAddress]$_ })] + [ValidateScript( { $_ -match [IPAddress]$_ })] [string]$subnetMask ) @@ -37,20 +37,24 @@ function Install-ZertoVra { if ( -not (Get-ZertoVra -vraName $vraName) ) { # Get identifiers for each item provided by name. $siteIdentifier = $script:zvmLocalInfo.SiteIdentifier - $hostIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -hosts | Where-Object {$_.VirtualizationHostName -eq $hostName} | Select-Object hostIdentifier -ExpandProperty hostIdentifier - $networkIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -networks | Where-Object {$_.VirtualizationNetworkName -eq $networkName} | Select-Object NetworkIdentifier -ExpandProperty NetworkIdentifier - $datastoreIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -datastores | Where-Object {$_.DatastoreName -eq $datastoreName} | Select-Object DatastoreIdentifier -ExpandProperty DatastoreIdentifier - if ($datastoreIdentifier.count -gt 1){ + $hostIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -hosts | Where-Object { $_.VirtualizationHostName -eq $hostName } | Select-Object hostIdentifier -ExpandProperty hostIdentifier + $networkIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -networks | Where-Object { $_.VirtualizationNetworkName -eq $networkName } | Select-Object NetworkIdentifier -ExpandProperty NetworkIdentifier + $datastoreIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -datastores | Where-Object { $_.DatastoreName -eq $datastoreName } | Select-Object DatastoreIdentifier -ExpandProperty DatastoreIdentifier + if ($datastoreIdentifier.count -gt 1) { $hostDevices = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -devices -hostIdentifier $hostIdentifier $datastoreIdentifier = foreach ($identifier in $datastoreIdentifier) { - if ($identifier -in $hostDevices.DatastoreIdentifier){ + if ($identifier -in $hostDevices.DatastoreIdentifier) { $identifier } } + if ($datastoreIdentifier.count -gt 1) { + Write-Error "Datastore $datastoreName has more than one identifier associated with it on the specified host. Please review and try again." + Break + } } # Build the JSON object through an Ordered Hashtable. - $vraBasic = [ordered]@{} + $vraBasic = [ordered]@{ } $vraBasic['DatastoreIdentifier'] = $datastoreIdentifier.toString() if ($PSBoundParameters.ContainsKey('groupName')) { $vraBasic['GroupName'] = $groupName @@ -59,7 +63,7 @@ function Install-ZertoVra { $vraBasic['MemoryInGB'] = $memoryInGB $vraBasic['NetworkIdentifier'] = $networkIdentifier.toString() $vraBasic['UsePublicKeyInsteadOfCredentials'] = $true - $vraBasicNetwork = [ordered]@{} + $vraBasicNetwork = [ordered]@{ } if ( $PSCmdlet.ParameterSetName -eq "StaticIp" ) { $vraBasicNetwork['DefaultGateway'] = $defaultGateway.toString() $vraBasicNetwork['SubnetMask'] = $subnetMask.toString() @@ -71,7 +75,7 @@ function Install-ZertoVra { $vraBasic['VraNetworkDataApi'] = $vraBasicNetwork # Leverage WhatIf functionality to see what might happen, if WhatIf is not specified, attempt to install. - if ($PSCmdlet.ShouldProcess("Preforming operation 'Install-Vra' on Host $hostName with the following data \n $($vraBasic | convertto-json)")) { + if ($PSCmdlet.ShouldProcess("Preforming operation 'Install-Vra' on Host $hostName with the following data \n $($vraBasic | ConvertTo-Json)")) { Invoke-ZertoRestRequest -uri "vras" -method POST -body $($vraBasic | ConvertTo-Json) } } else { From bae9eb9b99df1f7da306a0a206ed845c340a4529 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 10:27:20 -0400 Subject: [PATCH 310/479] Update function to enable password installation --- ZertoApiWrapper/Public/Install-ZertoVra.ps1 | 195 ++++++++++++++------ 1 file changed, 140 insertions(+), 55 deletions(-) diff --git a/ZertoApiWrapper/Public/Install-ZertoVra.ps1 b/ZertoApiWrapper/Public/Install-ZertoVra.ps1 index 0e4ec45..70f74a5 100644 --- a/ZertoApiWrapper/Public/Install-ZertoVra.ps1 +++ b/ZertoApiWrapper/Public/Install-ZertoVra.ps1 @@ -1,84 +1,169 @@ <# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> -#TODO - Add ability to installed with root password, Move to Begin, Process, End Format function Install-ZertoVra { - [cmdletbinding( SupportsShouldProcess = $true )] + [cmdletbinding( SupportsShouldProcess )] param( - [Parameter( Mandatory = $true, HelpMessage = "Host name where the VRA is to be installed." )] + [Parameter( + Mandatory, + HelpMessage = "Host name where the VRA is to be installed." + )] [ValidateNotNullOrEmpty()] [string]$hostName, - [Parameter( Mandatory = $true, HelpMessage = "Datastore name where the VRA is to be installed." )] + [Parameter( + Mandatory, + HelpMessage = "Datastore name where the VRA is to be installed." + )] [ValidateNotNullOrEmpty()] [string]$datastoreName, - [Parameter( Mandatory = $true, HelpMessage = "Network name the VRA is to be assigned." )] + [Parameter( + Mandatory, + HelpMessage = "Network name the VRA is to be assigned." + )] [ValidateNotNullOrEmpty()] [string]$networkName, - [Parameter( HelpMessage = "Initial amount of memory to assign to the VRA in GB. Default is 3, Minimum is 1, Maximum is 16" )] + [Parameter( + HelpMessage = "Initial amount of memory to assign to the VRA in GB. Default is 3, Minimum is 1, Maximum is 16" + )] [ValidateRange(1, 16)] [int]$memoryInGB = 3, - [Parameter( HelpMessage = "Bandwidth group to assign to the VRA. If unspecified will assign to the 'default_group'" )] + [Parameter( + HelpMessage = "Bandwidth group to assign to the VRA. If unspecified will assign to the 'default_group'" + )] [ValidateNotNullOrEmpty()] [string]$groupName, - [Parameter( ParameterSetName = "Dhcp", Mandatory = $true, HelpMessage = "Assign a DHCP address to the VRA." )] + [Parameter( + ParameterSetName = "Dhcp", + Mandatory, + HelpMessage = "Assign a DHCP address to the VRA." + )] + [Parameter( + ParameterSetName = "DhcpWithRoot", + Mandatory, + HelpMessage = "Assign a DHCP address to the VRA." + )] [switch]$Dhcp, - [Parameter( ParameterSetName = "StaticIp", Mandatory = $true, HelpMessage = "Static IP address to assign to the VRA." )] + [Parameter( + ParameterSetName = "StaticIp", + Mandatory, + HelpMessage = "Static IP address to assign to the VRA." + )] + [Parameter( + ParameterSetName = "StaticIpWithRoot", + Mandatory, + HelpMessage = "Static IP address to assign to the VRA." + )] [ValidateScript( { $_ -match [IPAddress]$_ })] [string]$vraIpAddress, - [Parameter( ParameterSetName = "StaticIp", Mandatory = $true, HelpMessage = "Default gateway to assign to the VRA" )] + [Parameter( + ParameterSetName = "StaticIp", + Mandatory, + HelpMessage = "Default gateway to assign to the VRA" + )] + [Parameter( + ParameterSetName = "StaticIpWithRoot", + Mandatory, + HelpMessage = "Default gateway to assign to the VRA" + )] [ValidateScript( { $_ -match [IPAddress]$_ })] [string]$defaultGateway, - [Parameter( ParameterSetName = "StaticIp", Mandatory = $true, HelpMessage = "Subnetmask to be assigned to the VRA" )] + [Parameter( + ParameterSetName = "StaticIp", + Mandatory, + HelpMessage = "Subnetmask to be assigned to the VRA" + )] + [Parameter( + ParameterSetName = "StaticIpWithRoot", + Mandatory, + HelpMessage = "Subnetmask to be assigned to the VRA" + )] [ValidateScript( { $_ -match [IPAddress]$_ })] - [string]$subnetMask - + [string]$subnetMask, + [Parameter( + ParameterSetName = "StaticIpWithRoot", + Mandatory, + HelpMessage = "Use this switch to install the VRA using the root password install method." + )] + [Parameter( + ParameterSetName = "DhcpWithRoot", + Mandatory, + HelpMessage = "Use this switch to install the VRA using the root password install method." + )] + [switch]$UseRootCredential, + [Parameter( + ParameterSetName = "StaticIpWithRoot", + Mandatory, + HelpMessage = "The password for the root user of the ESXi host where the VRA is to be installed." + )] + [Parameter( + ParameterSetName = "DhcpWithRoot", + Mandatory, + HelpMessage = "The password for the root user of the ESXi host where the VRA is to be installed." + )] + [ValidateNotNullOrEmpty()] + [securestring]$HostRootPassword ) - # Build the VRA Name. - $vraName = "Z-VRA-{0}" -f $hostName - # If the VRA does not exist, proceed with the installation. If it does exist, bypass and - if ( -not (Get-ZertoVra -vraName $vraName) ) { - # Get identifiers for each item provided by name. - $siteIdentifier = $script:zvmLocalInfo.SiteIdentifier - $hostIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -hosts | Where-Object { $_.VirtualizationHostName -eq $hostName } | Select-Object hostIdentifier -ExpandProperty hostIdentifier - $networkIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -networks | Where-Object { $_.VirtualizationNetworkName -eq $networkName } | Select-Object NetworkIdentifier -ExpandProperty NetworkIdentifier - $datastoreIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -datastores | Where-Object { $_.DatastoreName -eq $datastoreName } | Select-Object DatastoreIdentifier -ExpandProperty DatastoreIdentifier - if ($datastoreIdentifier.count -gt 1) { - $hostDevices = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -devices -hostIdentifier $hostIdentifier - $datastoreIdentifier = foreach ($identifier in $datastoreIdentifier) { - if ($identifier -in $hostDevices.DatastoreIdentifier) { - $identifier + + begin { + + } + Process { + # Build the VRA Name. + $vraName = "Z-VRA-{0}" -f $hostName + # If the VRA does not exist, proceed with the installation. If it does exist, bypass and + if ( -not (Get-ZertoVra -vraName $vraName) ) { + # Get identifiers for each item provided by name. + $siteIdentifier = $script:zvmLocalInfo.SiteIdentifier + $hostIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -hosts | Where-Object { $_.VirtualizationHostName -eq $hostName } | Select-Object hostIdentifier -ExpandProperty hostIdentifier + $networkIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -networks | Where-Object { $_.VirtualizationNetworkName -eq $networkName } | Select-Object NetworkIdentifier -ExpandProperty NetworkIdentifier + $datastoreIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -datastores | Where-Object { $_.DatastoreName -eq $datastoreName } | Select-Object DatastoreIdentifier -ExpandProperty DatastoreIdentifier + if ($datastoreIdentifier.count -gt 1) { + $hostDevices = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -devices -hostIdentifier $hostIdentifier + $datastoreIdentifier = foreach ($identifier in $datastoreIdentifier) { + if ($identifier -in $hostDevices.DatastoreIdentifier) { + $identifier + } + } + if ($datastoreIdentifier.count -gt 1) { + Write-Error "Datastore $datastoreName has more than one identifier associated with it on the specified host. Please review and try again." + Break } } - if ($datastoreIdentifier.count -gt 1) { - Write-Error "Datastore $datastoreName has more than one identifier associated with it on the specified host. Please review and try again." - Break + + # Build the JSON object through an Ordered Hashtable. + $vraBasic = [ordered]@{ } + $vraBasic['DatastoreIdentifier'] = $datastoreIdentifier.toString() + if ($PSBoundParameters.ContainsKey('groupName')) { + $vraBasic['GroupName'] = $groupName + } + $vraBasic['HostIdentifier'] = $hostIdentifier.toString() + $vraBasic['MemoryInGB'] = $memoryInGB + $vraBasic['NetworkIdentifier'] = $networkIdentifier.toString() + $vraBasic['UsePublicKeyInsteadOfCredentials'] = $true + $vraBasicNetwork = [ordered]@{ } + if ( $PSCmdlet.ParameterSetName -eq "StaticIp" -or $PSCmdlet.ParameterSetName -eq "StaticIpWithRoot") { + $vraBasicNetwork['DefaultGateway'] = $defaultGateway.toString() + $vraBasicNetwork['SubnetMask'] = $subnetMask.toString() + $vraBasicNetwork['VraIPAddress'] = $vraIpAddress.toString() + $vraBasicNetwork['VraIPConfigurationTypeApi'] = "Static" + } else { + $vraBasicNetwork['VraIPConfigurationTypeApi'] = "Dhcp" + } + $vraBasic['VraNetworkDataApi'] = $vraBasicNetwork + if ($PSCmdlet.ParameterSetName -eq "StaticIpWithRoot" -or $PSCmdlet.ParameterSetName -eq "DhcpWithRoot") { + $HostRootCredential = [pscredential]::new('root', $HostRootPassword) + $vraBasic['UsePublicKeyInsteadOfCredentials'] = $false + $vraBasic['HostRootPassword'] = $HostRootCredential.GetNetworkCredential().Password } - } - # Build the JSON object through an Ordered Hashtable. - $vraBasic = [ordered]@{ } - $vraBasic['DatastoreIdentifier'] = $datastoreIdentifier.toString() - if ($PSBoundParameters.ContainsKey('groupName')) { - $vraBasic['GroupName'] = $groupName - } - $vraBasic['HostIdentifier'] = $hostIdentifier.toString() - $vraBasic['MemoryInGB'] = $memoryInGB - $vraBasic['NetworkIdentifier'] = $networkIdentifier.toString() - $vraBasic['UsePublicKeyInsteadOfCredentials'] = $true - $vraBasicNetwork = [ordered]@{ } - if ( $PSCmdlet.ParameterSetName -eq "StaticIp" ) { - $vraBasicNetwork['DefaultGateway'] = $defaultGateway.toString() - $vraBasicNetwork['SubnetMask'] = $subnetMask.toString() - $vraBasicNetwork['VraIPAddress'] = $vraIpAddress.toString() - $vraBasicNetwork['VraIPConfigurationTypeApi'] = "Static" + # Leverage WhatIf functionality to see what might happen, if WhatIf is not specified, attempt to install. + if ($PSCmdlet.ShouldProcess($hostName)) { + Invoke-ZertoRestRequest -uri "vras" -method POST -body $($vraBasic | ConvertTo-Json) + } } else { - $vraBasicNetwork['VraIPConfigurationTypeApi'] = "Dhcp" + Write-Error "Host $hostName already has a VRA installed. Aborting Install Call" } - $vraBasic['VraNetworkDataApi'] = $vraBasicNetwork + } + + End { - # Leverage WhatIf functionality to see what might happen, if WhatIf is not specified, attempt to install. - if ($PSCmdlet.ShouldProcess("Preforming operation 'Install-Vra' on Host $hostName with the following data \n $($vraBasic | ConvertTo-Json)")) { - Invoke-ZertoRestRequest -uri "vras" -method POST -body $($vraBasic | ConvertTo-Json) - } - } else { - Write-Error "Host $hostName already has a VRA installed. Aborting Install Call" } } From 82458712f03eb992f68a9b7766f0d2fd33280961 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 10:46:40 -0400 Subject: [PATCH 311/479] Update tests for new functionality --- Tests/Public/Install-ZertoVra.Tests.ps1 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Tests/Public/Install-ZertoVra.Tests.ps1 b/Tests/Public/Install-ZertoVra.Tests.ps1 index f4c529d..7105db6 100644 --- a/Tests/Public/Install-ZertoVra.Tests.ps1 +++ b/Tests/Public/Install-ZertoVra.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - It "$global:function should have exactly 22 parameters defined" { - (Get-Command $global:function).Parameters.Count | Should -Be 22 + It "$global:function should have exactly 24 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 24 } $ParameterTestCases = @( @@ -17,6 +17,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { @{ParameterName = 'vraIpAddress'; Type = 'String'; Mandatory = $true; Validation = 'IpAddr' } @{ParameterName = 'subnetMask'; Type = 'String'; Mandatory = $true; Validation = 'IpAddr' } @{ParameterName = 'defaultGateway'; Type = 'String'; Mandatory = $true; Validation = 'IpAddr' } + @{ParameterName = 'UseRootCredential'; Type = 'Switch'; Mandatory = $true; Validation = $null } + @{ParameterName = 'HostRootPassword'; Type = 'SecureString'; Mandatory = $true; Validation = 'NotNullOrEmpty' } ) It " parameter is of type" -TestCases $ParameterTestCases { @@ -40,7 +42,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $null { $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes - $attrs.TypeId.Count | Should -Be 2 + $attrs.TypeId.Count | Should -Be 3 } } } From a660aa29b3ed11197532c633d6659f973437f3f3 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 10:48:02 -0400 Subject: [PATCH 312/479] Update Common Parameters formatting --- docs/Add-ZertoPeerSite.md | 2 +- docs/Checkpoint-ZertoVpg.md | 2 +- docs/Connect-ZertoAnalytics.md | 2 +- docs/Connect-ZertoServer.md | 2 +- docs/Disconnect-ZertoServer.md | 2 +- docs/Edit-ZertoVra.md | 2 +- docs/Export-ZertoVmNicSetting.md | 2 +- docs/Export-ZertoVpg.md | 2 +- docs/Get-ZAAlert.md | 2 +- docs/Get-ZADatastore.md | 2 +- docs/Get-ZAEvent.md | 2 +- docs/Get-ZAJournalAverageHistory.md | 2 +- docs/Get-ZAJournalAverageSize.md | 2 +- docs/Get-ZAJournalBreach.md | 2 +- docs/Get-ZAJournalHistoryStat.md | 2 +- docs/Get-ZAJournalSiteAverageHistory.md | 2 +- docs/Get-ZAJournalSiteAverageSize.md | 2 +- docs/Get-ZAJournalSiteHistoryStat.md | 2 +- docs/Get-ZAJournalSiteHistorySummary.md | 2 +- docs/Get-ZAJournalSiteSizeStat.md | 2 +- docs/Get-ZAJournalStatusProportion.md | 2 +- docs/Get-ZAJournalStorageStat.md | 2 +- docs/Get-ZAJournalSummary.md | 2 +- docs/Get-ZALicense.md | 2 +- docs/Get-ZAMonitoring.md | 2 +- docs/Get-ZANetworkSiteAverageIOPS.md | 2 +- docs/Get-ZANetworkSiteAveragePerformance.md | 2 +- docs/Get-ZANetworkSiteStat.md | 2 +- docs/Get-ZANetworkSiteSummary.md | 2 +- docs/Get-ZANetworkVpgAverageIOPS.md | 2 +- docs/Get-ZANetworkVpgAveragePerformance.md | 2 +- docs/Get-ZANetworkVpgStat.md | 2 +- docs/Get-ZANetworkVpgSummary.md | 2 +- docs/Get-ZARPOAccountAverage.md | 2 +- docs/Get-ZARPOAverage.md | 2 +- docs/Get-ZARPOBreach.md | 2 +- docs/Get-ZARPOStat.md | 2 +- docs/Get-ZARPOStatusProportion.md | 2 +- docs/Get-ZARPOSummary.md | 2 +- docs/Get-ZASite.md | 2 +- docs/Get-ZASitePair.md | 2 +- docs/Get-ZASiteTopology.md | 2 +- docs/Get-ZATask.md | 2 +- docs/Get-ZAVolume.md | 2 +- docs/Get-ZAVpg.md | 2 +- docs/Get-ZAzOrg.md | 2 +- docs/Get-ZertoAlert.md | 2 +- docs/Get-ZertoDatastore.md | 2 +- docs/Get-ZertoEvent.md | 2 +- docs/Get-ZertoLicense.md | 2 +- docs/Get-ZertoLocalSite.md | 2 +- docs/Get-ZertoPeerSite.md | 2 +- docs/Get-ZertoProtectedVm.md | 2 +- docs/Get-ZertoRecoveryReport.md | 2 +- docs/Get-ZertoResourcesReport.md | 2 +- docs/Get-ZertoServiceProfile.md | 2 +- docs/Get-ZertoTask.md | 2 +- docs/Get-ZertoUnprotectedVm.md | 2 +- docs/Get-ZertoVirtualizationSite.md | 2 +- docs/Get-ZertoVolume.md | 2 +- docs/Get-ZertoVpg.md | 2 +- docs/Get-ZertoVpgSetting.md | 2 +- docs/Get-ZertoVra.md | 2 +- docs/Get-ZertoZorg.md | 2 +- docs/Get-ZertoZsspSession.md | 2 +- docs/Import-ZertoVmNicSetting.md | 2 +- docs/Import-ZertoVpg.md | 2 +- docs/Invoke-ZARestRequest.md | 2 +- docs/Invoke-ZertoEvacuateVra.md | 2 +- docs/Invoke-ZertoFailover.md | 2 +- docs/Invoke-ZertoFailoverCommit.md | 2 +- docs/Invoke-ZertoFailoverRollback.md | 2 +- docs/Invoke-ZertoForceSync.md | 2 +- docs/Invoke-ZertoMove.md | 2 +- docs/Invoke-ZertoMoveCommit.md | 2 +- docs/Invoke-ZertoMoveRollback.md | 2 +- docs/Invoke-ZertoRestRequest.md | 2 +- docs/New-ZertoPairingToken.md | 2 +- docs/New-ZertoVpg.md | 2 +- docs/New-ZertoVpgSettingsIdentifier.md | 2 +- docs/Remove-ZertoPeerSite.md | 2 +- docs/Remove-ZertoVpg.md | 2 +- docs/Remove-ZertoVpgSettingsIdentifier.md | 2 +- docs/Resume-ZertoVpg.md | 2 +- docs/Save-ZertoVpgSetting.md | 2 +- docs/Set-ZertoAlert.md | 2 +- docs/Set-ZertoLicense.md | 2 +- docs/Start-ZertoCloneVpg.md | 2 +- docs/Start-ZertoFailoverTest.md | 2 +- docs/Stop-ZertoCloneVpg.md | 2 +- docs/Stop-ZertoFailoverTest.md | 2 +- docs/Suspend-ZertoVpg.md | 2 +- docs/Uninstall-ZertoVra.md | 2 +- 93 files changed, 93 insertions(+), 93 deletions(-) diff --git a/docs/Add-ZertoPeerSite.md b/docs/Add-ZertoPeerSite.md index 7fafff4..aac7bb1 100644 --- a/docs/Add-ZertoPeerSite.md +++ b/docs/Add-ZertoPeerSite.md @@ -116,7 +116,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Checkpoint-ZertoVpg.md b/docs/Checkpoint-ZertoVpg.md index 7951d3c..5e76d6a 100644 --- a/docs/Checkpoint-ZertoVpg.md +++ b/docs/Checkpoint-ZertoVpg.md @@ -61,7 +61,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Connect-ZertoAnalytics.md b/docs/Connect-ZertoAnalytics.md index 4b789bf..c6d4104 100644 --- a/docs/Connect-ZertoAnalytics.md +++ b/docs/Connect-ZertoAnalytics.md @@ -48,7 +48,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Connect-ZertoServer.md b/docs/Connect-ZertoServer.md index 160ac31..e6080be 100644 --- a/docs/Connect-ZertoServer.md +++ b/docs/Connect-ZertoServer.md @@ -93,7 +93,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Disconnect-ZertoServer.md b/docs/Disconnect-ZertoServer.md index 9cb7188..cb95619 100644 --- a/docs/Disconnect-ZertoServer.md +++ b/docs/Disconnect-ZertoServer.md @@ -31,7 +31,7 @@ Disconnects from the Zerto Server ## PARAMETERS ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Edit-ZertoVra.md b/docs/Edit-ZertoVra.md index 428e5b5..677879e 100644 --- a/docs/Edit-ZertoVra.md +++ b/docs/Edit-ZertoVra.md @@ -166,7 +166,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Export-ZertoVmNicSetting.md b/docs/Export-ZertoVmNicSetting.md index 7e8ce10..8119b8b 100644 --- a/docs/Export-ZertoVmNicSetting.md +++ b/docs/Export-ZertoVmNicSetting.md @@ -68,7 +68,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Export-ZertoVpg.md b/docs/Export-ZertoVpg.md index 8a1ee4c..1f9f60f 100644 --- a/docs/Export-ZertoVpg.md +++ b/docs/Export-ZertoVpg.md @@ -89,7 +89,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAAlert.md b/docs/Get-ZAAlert.md index 3ef258f..34a4e53 100644 --- a/docs/Get-ZAAlert.md +++ b/docs/Get-ZAAlert.md @@ -111,7 +111,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZADatastore.md b/docs/Get-ZADatastore.md index b44e4f4..73483fa 100644 --- a/docs/Get-ZADatastore.md +++ b/docs/Get-ZADatastore.md @@ -107,7 +107,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAEvent.md b/docs/Get-ZAEvent.md index dbfa390..986c30c 100644 --- a/docs/Get-ZAEvent.md +++ b/docs/Get-ZAEvent.md @@ -127,7 +127,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAJournalAverageHistory.md b/docs/Get-ZAJournalAverageHistory.md index de1aafe..42ee2f3 100644 --- a/docs/Get-ZAJournalAverageHistory.md +++ b/docs/Get-ZAJournalAverageHistory.md @@ -110,7 +110,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAJournalAverageSize.md b/docs/Get-ZAJournalAverageSize.md index 8517622..15db2a0 100644 --- a/docs/Get-ZAJournalAverageSize.md +++ b/docs/Get-ZAJournalAverageSize.md @@ -110,7 +110,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAJournalBreach.md b/docs/Get-ZAJournalBreach.md index 03e25ba..12d008d 100644 --- a/docs/Get-ZAJournalBreach.md +++ b/docs/Get-ZAJournalBreach.md @@ -88,7 +88,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAJournalHistoryStat.md b/docs/Get-ZAJournalHistoryStat.md index 957ffc4..e79255a 100644 --- a/docs/Get-ZAJournalHistoryStat.md +++ b/docs/Get-ZAJournalHistoryStat.md @@ -88,7 +88,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAJournalSiteAverageHistory.md b/docs/Get-ZAJournalSiteAverageHistory.md index e514e06..75bf268 100644 --- a/docs/Get-ZAJournalSiteAverageHistory.md +++ b/docs/Get-ZAJournalSiteAverageHistory.md @@ -110,7 +110,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAJournalSiteAverageSize.md b/docs/Get-ZAJournalSiteAverageSize.md index 7699b8c..128bcbd 100644 --- a/docs/Get-ZAJournalSiteAverageSize.md +++ b/docs/Get-ZAJournalSiteAverageSize.md @@ -110,7 +110,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAJournalSiteHistoryStat.md b/docs/Get-ZAJournalSiteHistoryStat.md index d88a655..3d3ba58 100644 --- a/docs/Get-ZAJournalSiteHistoryStat.md +++ b/docs/Get-ZAJournalSiteHistoryStat.md @@ -110,7 +110,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAJournalSiteHistorySummary.md b/docs/Get-ZAJournalSiteHistorySummary.md index e5e6d36..c9d4fb4 100644 --- a/docs/Get-ZAJournalSiteHistorySummary.md +++ b/docs/Get-ZAJournalSiteHistorySummary.md @@ -110,7 +110,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAJournalSiteSizeStat.md b/docs/Get-ZAJournalSiteSizeStat.md index 16bb3a0..eefff97 100644 --- a/docs/Get-ZAJournalSiteSizeStat.md +++ b/docs/Get-ZAJournalSiteSizeStat.md @@ -110,7 +110,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAJournalStatusProportion.md b/docs/Get-ZAJournalStatusProportion.md index 0e6ae7d..3db7a5d 100644 --- a/docs/Get-ZAJournalStatusProportion.md +++ b/docs/Get-ZAJournalStatusProportion.md @@ -88,7 +88,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAJournalStorageStat.md b/docs/Get-ZAJournalStorageStat.md index 625f650..5022411 100644 --- a/docs/Get-ZAJournalStorageStat.md +++ b/docs/Get-ZAJournalStorageStat.md @@ -88,7 +88,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAJournalSummary.md b/docs/Get-ZAJournalSummary.md index e8cad08..aadfbad 100644 --- a/docs/Get-ZAJournalSummary.md +++ b/docs/Get-ZAJournalSummary.md @@ -88,7 +88,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZALicense.md b/docs/Get-ZALicense.md index cc9b992..a95d1f9 100644 --- a/docs/Get-ZALicense.md +++ b/docs/Get-ZALicense.md @@ -32,7 +32,7 @@ Returns all licenses and associated information ## PARAMETERS ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAMonitoring.md b/docs/Get-ZAMonitoring.md index da04a32..a4ee8e8 100644 --- a/docs/Get-ZAMonitoring.md +++ b/docs/Get-ZAMonitoring.md @@ -56,7 +56,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZANetworkSiteAverageIOPS.md b/docs/Get-ZANetworkSiteAverageIOPS.md index 5cbe8e5..947c371 100644 --- a/docs/Get-ZANetworkSiteAverageIOPS.md +++ b/docs/Get-ZANetworkSiteAverageIOPS.md @@ -170,7 +170,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZANetworkSiteAveragePerformance.md b/docs/Get-ZANetworkSiteAveragePerformance.md index ff5da43..7c03484 100644 --- a/docs/Get-ZANetworkSiteAveragePerformance.md +++ b/docs/Get-ZANetworkSiteAveragePerformance.md @@ -170,7 +170,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZANetworkSiteStat.md b/docs/Get-ZANetworkSiteStat.md index 8bb0167..c07a784 100644 --- a/docs/Get-ZANetworkSiteStat.md +++ b/docs/Get-ZANetworkSiteStat.md @@ -154,7 +154,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZANetworkSiteSummary.md b/docs/Get-ZANetworkSiteSummary.md index a3050e9..935e7e0 100644 --- a/docs/Get-ZANetworkSiteSummary.md +++ b/docs/Get-ZANetworkSiteSummary.md @@ -154,7 +154,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZANetworkVpgAverageIOPS.md b/docs/Get-ZANetworkVpgAverageIOPS.md index 72dc7c5..8bd5a09 100644 --- a/docs/Get-ZANetworkVpgAverageIOPS.md +++ b/docs/Get-ZANetworkVpgAverageIOPS.md @@ -96,7 +96,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZANetworkVpgAveragePerformance.md b/docs/Get-ZANetworkVpgAveragePerformance.md index b781da5..83e07e9 100644 --- a/docs/Get-ZANetworkVpgAveragePerformance.md +++ b/docs/Get-ZANetworkVpgAveragePerformance.md @@ -96,7 +96,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZANetworkVpgStat.md b/docs/Get-ZANetworkVpgStat.md index 4a66c98..40a50c2 100644 --- a/docs/Get-ZANetworkVpgStat.md +++ b/docs/Get-ZANetworkVpgStat.md @@ -81,7 +81,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZANetworkVpgSummary.md b/docs/Get-ZANetworkVpgSummary.md index 429c5d5..10ac2a4 100644 --- a/docs/Get-ZANetworkVpgSummary.md +++ b/docs/Get-ZANetworkVpgSummary.md @@ -81,7 +81,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZARPOAccountAverage.md b/docs/Get-ZARPOAccountAverage.md index 8461d13..9eed4cb 100644 --- a/docs/Get-ZARPOAccountAverage.md +++ b/docs/Get-ZARPOAccountAverage.md @@ -96,7 +96,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZARPOAverage.md b/docs/Get-ZARPOAverage.md index cb16613..77c3462 100644 --- a/docs/Get-ZARPOAverage.md +++ b/docs/Get-ZARPOAverage.md @@ -105,7 +105,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZARPOBreach.md b/docs/Get-ZARPOBreach.md index 5e4ceb7..5dc64f6 100644 --- a/docs/Get-ZARPOBreach.md +++ b/docs/Get-ZARPOBreach.md @@ -94,7 +94,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZARPOStat.md b/docs/Get-ZARPOStat.md index 414c814..c9f7ee9 100644 --- a/docs/Get-ZARPOStat.md +++ b/docs/Get-ZARPOStat.md @@ -94,7 +94,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZARPOStatusProportion.md b/docs/Get-ZARPOStatusProportion.md index 3ad8d16..cb008f1 100644 --- a/docs/Get-ZARPOStatusProportion.md +++ b/docs/Get-ZARPOStatusProportion.md @@ -95,7 +95,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZARPOSummary.md b/docs/Get-ZARPOSummary.md index bfeeb10..f6600cf 100644 --- a/docs/Get-ZARPOSummary.md +++ b/docs/Get-ZARPOSummary.md @@ -94,7 +94,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZASite.md b/docs/Get-ZASite.md index 4af04a2..1b82595 100644 --- a/docs/Get-ZASite.md +++ b/docs/Get-ZASite.md @@ -56,7 +56,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZASitePair.md b/docs/Get-ZASitePair.md index f616f8b..081cf63 100644 --- a/docs/Get-ZASitePair.md +++ b/docs/Get-ZASitePair.md @@ -91,7 +91,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZASiteTopology.md b/docs/Get-ZASiteTopology.md index cd75b6d..ba3bf39 100644 --- a/docs/Get-ZASiteTopology.md +++ b/docs/Get-ZASiteTopology.md @@ -57,7 +57,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZATask.md b/docs/Get-ZATask.md index bb5f3bf..d103415 100644 --- a/docs/Get-ZATask.md +++ b/docs/Get-ZATask.md @@ -99,7 +99,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAVolume.md b/docs/Get-ZAVolume.md index 0b56f41..2eb0b78 100644 --- a/docs/Get-ZAVolume.md +++ b/docs/Get-ZAVolume.md @@ -121,7 +121,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAVpg.md b/docs/Get-ZAVpg.md index 07ff413..39d11e8 100644 --- a/docs/Get-ZAVpg.md +++ b/docs/Get-ZAVpg.md @@ -84,7 +84,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAzOrg.md b/docs/Get-ZAzOrg.md index 4fe4457..b9f3c29 100644 --- a/docs/Get-ZAzOrg.md +++ b/docs/Get-ZAzOrg.md @@ -33,7 +33,7 @@ Retrieve a list of all ZORGs. ## PARAMETERS ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoAlert.md b/docs/Get-ZertoAlert.md index 8df174b..bd9c944 100644 --- a/docs/Get-ZertoAlert.md +++ b/docs/Get-ZertoAlert.md @@ -295,7 +295,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoDatastore.md b/docs/Get-ZertoDatastore.md index d3bc777..fca78f7 100644 --- a/docs/Get-ZertoDatastore.md +++ b/docs/Get-ZertoDatastore.md @@ -59,7 +59,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoEvent.md b/docs/Get-ZertoEvent.md index 79b37d7..390fa2e 100644 --- a/docs/Get-ZertoEvent.md +++ b/docs/Get-ZertoEvent.md @@ -338,7 +338,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoLicense.md b/docs/Get-ZertoLicense.md index 74ca60b..8bcae17 100644 --- a/docs/Get-ZertoLicense.md +++ b/docs/Get-ZertoLicense.md @@ -31,7 +31,7 @@ Retrieve information about a Zerto Virtual Replication license. ## PARAMETERS ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoLocalSite.md b/docs/Get-ZertoLocalSite.md index b094547..a8ecfe3 100644 --- a/docs/Get-ZertoLocalSite.md +++ b/docs/Get-ZertoLocalSite.md @@ -46,7 +46,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoPeerSite.md b/docs/Get-ZertoPeerSite.md index 828031b..aa86c0c 100644 --- a/docs/Get-ZertoPeerSite.md +++ b/docs/Get-ZertoPeerSite.md @@ -162,7 +162,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoProtectedVm.md b/docs/Get-ZertoProtectedVm.md index ec1172a..abf2699 100644 --- a/docs/Get-ZertoProtectedVm.md +++ b/docs/Get-ZertoProtectedVm.md @@ -237,7 +237,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoRecoveryReport.md b/docs/Get-ZertoRecoveryReport.md index d316621..9948bf3 100644 --- a/docs/Get-ZertoRecoveryReport.md +++ b/docs/Get-ZertoRecoveryReport.md @@ -159,7 +159,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoResourcesReport.md b/docs/Get-ZertoResourcesReport.md index ab0476f..5cfdf74 100644 --- a/docs/Get-ZertoResourcesReport.md +++ b/docs/Get-ZertoResourcesReport.md @@ -304,7 +304,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoServiceProfile.md b/docs/Get-ZertoServiceProfile.md index 174ae17..b697bc4 100644 --- a/docs/Get-ZertoServiceProfile.md +++ b/docs/Get-ZertoServiceProfile.md @@ -72,7 +72,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoTask.md b/docs/Get-ZertoTask.md index e8e1410..910a8eb 100644 --- a/docs/Get-ZertoTask.md +++ b/docs/Get-ZertoTask.md @@ -185,7 +185,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoUnprotectedVm.md b/docs/Get-ZertoUnprotectedVm.md index 5da328b..3e35e12 100644 --- a/docs/Get-ZertoUnprotectedVm.md +++ b/docs/Get-ZertoUnprotectedVm.md @@ -31,7 +31,7 @@ Returns all virtual machines at the site not currently protected in a virtual pr ## PARAMETERS ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoVirtualizationSite.md b/docs/Get-ZertoVirtualizationSite.md index 815019c..68ec140 100644 --- a/docs/Get-ZertoVirtualizationSite.md +++ b/docs/Get-ZertoVirtualizationSite.md @@ -271,7 +271,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoVolume.md b/docs/Get-ZertoVolume.md index 57c5d8e..3725af4 100644 --- a/docs/Get-ZertoVolume.md +++ b/docs/Get-ZertoVolume.md @@ -128,7 +128,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoVpg.md b/docs/Get-ZertoVpg.md index f453476..4010c9b 100644 --- a/docs/Get-ZertoVpg.md +++ b/docs/Get-ZertoVpg.md @@ -496,7 +496,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoVpgSetting.md b/docs/Get-ZertoVpgSetting.md index 8b671cc..fd06803 100644 --- a/docs/Get-ZertoVpgSetting.md +++ b/docs/Get-ZertoVpgSetting.md @@ -424,7 +424,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoVra.md b/docs/Get-ZertoVra.md index c2c8325..d46d9e1 100644 --- a/docs/Get-ZertoVra.md +++ b/docs/Get-ZertoVra.md @@ -241,7 +241,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoZorg.md b/docs/Get-ZertoZorg.md index ebd30f9..e7170c0 100644 --- a/docs/Get-ZertoZorg.md +++ b/docs/Get-ZertoZorg.md @@ -59,7 +59,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoZsspSession.md b/docs/Get-ZertoZsspSession.md index 487e2eb..0171f34 100644 --- a/docs/Get-ZertoZsspSession.md +++ b/docs/Get-ZertoZsspSession.md @@ -52,7 +52,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Import-ZertoVmNicSetting.md b/docs/Import-ZertoVmNicSetting.md index 1c9a226..5cbf276 100644 --- a/docs/Import-ZertoVmNicSetting.md +++ b/docs/Import-ZertoVmNicSetting.md @@ -83,7 +83,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Import-ZertoVpg.md b/docs/Import-ZertoVpg.md index 979a347..dcb275b 100644 --- a/docs/Import-ZertoVpg.md +++ b/docs/Import-ZertoVpg.md @@ -46,7 +46,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZARestRequest.md b/docs/Invoke-ZARestRequest.md index 187e60d..692a799 100644 --- a/docs/Invoke-ZARestRequest.md +++ b/docs/Invoke-ZARestRequest.md @@ -87,7 +87,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoEvacuateVra.md b/docs/Invoke-ZertoEvacuateVra.md index aa0b2e9..1e01d75 100644 --- a/docs/Invoke-ZertoEvacuateVra.md +++ b/docs/Invoke-ZertoEvacuateVra.md @@ -134,7 +134,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoFailover.md b/docs/Invoke-ZertoFailover.md index ac68d01..974948b 100644 --- a/docs/Invoke-ZertoFailover.md +++ b/docs/Invoke-ZertoFailover.md @@ -194,7 +194,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoFailoverCommit.md b/docs/Invoke-ZertoFailoverCommit.md index f7876b3..b9d302f 100644 --- a/docs/Invoke-ZertoFailoverCommit.md +++ b/docs/Invoke-ZertoFailoverCommit.md @@ -98,7 +98,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoFailoverRollback.md b/docs/Invoke-ZertoFailoverRollback.md index 8757c40..2abb482 100644 --- a/docs/Invoke-ZertoFailoverRollback.md +++ b/docs/Invoke-ZertoFailoverRollback.md @@ -50,7 +50,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoForceSync.md b/docs/Invoke-ZertoForceSync.md index a124bb3..75826b4 100644 --- a/docs/Invoke-ZertoForceSync.md +++ b/docs/Invoke-ZertoForceSync.md @@ -46,7 +46,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoMove.md b/docs/Invoke-ZertoMove.md index 420088e..88065f0 100644 --- a/docs/Invoke-ZertoMove.md +++ b/docs/Invoke-ZertoMove.md @@ -188,7 +188,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoMoveCommit.md b/docs/Invoke-ZertoMoveCommit.md index 08c6e92..72c687e 100644 --- a/docs/Invoke-ZertoMoveCommit.md +++ b/docs/Invoke-ZertoMoveCommit.md @@ -108,7 +108,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoMoveRollback.md b/docs/Invoke-ZertoMoveRollback.md index 2229cc1..34f3fa2 100644 --- a/docs/Invoke-ZertoMoveRollback.md +++ b/docs/Invoke-ZertoMoveRollback.md @@ -76,7 +76,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoRestRequest.md b/docs/Invoke-ZertoRestRequest.md index b2ad214..bc14634 100644 --- a/docs/Invoke-ZertoRestRequest.md +++ b/docs/Invoke-ZertoRestRequest.md @@ -141,7 +141,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/New-ZertoPairingToken.md b/docs/New-ZertoPairingToken.md index 09987b9..7da1436 100644 --- a/docs/New-ZertoPairingToken.md +++ b/docs/New-ZertoPairingToken.md @@ -62,7 +62,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/New-ZertoVpg.md b/docs/New-ZertoVpg.md index c288dbd..29b6a7c 100644 --- a/docs/New-ZertoVpg.md +++ b/docs/New-ZertoVpg.md @@ -523,7 +523,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/New-ZertoVpgSettingsIdentifier.md b/docs/New-ZertoVpgSettingsIdentifier.md index 8128a62..3e33a82 100644 --- a/docs/New-ZertoVpgSettingsIdentifier.md +++ b/docs/New-ZertoVpgSettingsIdentifier.md @@ -106,7 +106,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Remove-ZertoPeerSite.md b/docs/Remove-ZertoPeerSite.md index a42c84b..bfedef0 100644 --- a/docs/Remove-ZertoPeerSite.md +++ b/docs/Remove-ZertoPeerSite.md @@ -150,7 +150,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Remove-ZertoVpg.md b/docs/Remove-ZertoVpg.md index c365cd7..f83b9a8 100644 --- a/docs/Remove-ZertoVpg.md +++ b/docs/Remove-ZertoVpg.md @@ -162,7 +162,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Remove-ZertoVpgSettingsIdentifier.md b/docs/Remove-ZertoVpgSettingsIdentifier.md index 0a8faf6..afaf640 100644 --- a/docs/Remove-ZertoVpgSettingsIdentifier.md +++ b/docs/Remove-ZertoVpgSettingsIdentifier.md @@ -77,7 +77,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Resume-ZertoVpg.md b/docs/Resume-ZertoVpg.md index 6e52056..414a2c2 100644 --- a/docs/Resume-ZertoVpg.md +++ b/docs/Resume-ZertoVpg.md @@ -46,7 +46,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Save-ZertoVpgSetting.md b/docs/Save-ZertoVpgSetting.md index cd2cc59..141f0d0 100644 --- a/docs/Save-ZertoVpgSetting.md +++ b/docs/Save-ZertoVpgSetting.md @@ -77,7 +77,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Set-ZertoAlert.md b/docs/Set-ZertoAlert.md index 5ceb8ba..15f47a9 100644 --- a/docs/Set-ZertoAlert.md +++ b/docs/Set-ZertoAlert.md @@ -120,7 +120,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Set-ZertoLicense.md b/docs/Set-ZertoLicense.md index a353532..a915c7f 100644 --- a/docs/Set-ZertoLicense.md +++ b/docs/Set-ZertoLicense.md @@ -77,7 +77,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Start-ZertoCloneVpg.md b/docs/Start-ZertoCloneVpg.md index 9ab204d..c05d64b 100644 --- a/docs/Start-ZertoCloneVpg.md +++ b/docs/Start-ZertoCloneVpg.md @@ -125,7 +125,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Start-ZertoFailoverTest.md b/docs/Start-ZertoFailoverTest.md index 1299291..8218e02 100644 --- a/docs/Start-ZertoFailoverTest.md +++ b/docs/Start-ZertoFailoverTest.md @@ -109,7 +109,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Stop-ZertoCloneVpg.md b/docs/Stop-ZertoCloneVpg.md index 2c28b8d..822bc34 100644 --- a/docs/Stop-ZertoCloneVpg.md +++ b/docs/Stop-ZertoCloneVpg.md @@ -76,7 +76,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Stop-ZertoFailoverTest.md b/docs/Stop-ZertoFailoverTest.md index 5a52590..4cbdf16 100644 --- a/docs/Stop-ZertoFailoverTest.md +++ b/docs/Stop-ZertoFailoverTest.md @@ -109,7 +109,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Suspend-ZertoVpg.md b/docs/Suspend-ZertoVpg.md index 466b6d7..0719793 100644 --- a/docs/Suspend-ZertoVpg.md +++ b/docs/Suspend-ZertoVpg.md @@ -46,7 +46,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Uninstall-ZertoVra.md b/docs/Uninstall-ZertoVra.md index cae5377..890496a 100644 --- a/docs/Uninstall-ZertoVra.md +++ b/docs/Uninstall-ZertoVra.md @@ -46,7 +46,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS From e774cd861d7172e8bb4b2f5d4623814cee415f9e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 10:48:19 -0400 Subject: [PATCH 313/479] Update Copy-ZertoVpg.md --- docs/Copy-ZertoVpg.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/Copy-ZertoVpg.md b/docs/Copy-ZertoVpg.md index 6e5436b..ff6e946 100644 --- a/docs/Copy-ZertoVpg.md +++ b/docs/Copy-ZertoVpg.md @@ -13,7 +13,7 @@ Copy an existing VPG settings object to create a new VPG with the same settings. ## SYNTAX ``` -Copy-ZertoVpg -SourceVpgName -NewVpgName [-VMs] [-WhatIf] [-Confirm] +Copy-ZertoVpg [-SourceVpgName] [-NewVpgName] [-VMs] [-WhatIf] [-Confirm] [] ``` @@ -47,7 +47,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: Named +Position: 2 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -62,7 +62,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: Named +Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -77,7 +77,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 2 +Position: 3 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -114,7 +114,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS From 2d1fb8e4db676c4addac5f3d80ab8b6f13782db6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 10:51:05 -0400 Subject: [PATCH 314/479] Update Install-ZertoVra.md --- docs/Install-ZertoVra.md | 68 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 5 deletions(-) diff --git a/docs/Install-ZertoVra.md b/docs/Install-ZertoVra.md index ddd4a18..9ff8e52 100644 --- a/docs/Install-ZertoVra.md +++ b/docs/Install-ZertoVra.md @@ -12,12 +12,26 @@ Install Zerto VRA to a single host in the site with either a Static IP address, ## SYNTAX +### DhcpWithRoot +``` +Install-ZertoVra -hostName -datastoreName -networkName [-memoryInGB ] + [-groupName ] [-Dhcp] [-UseRootCredential] -HostRootPassword [-WhatIf] [-Confirm] + [] +``` + ### Dhcp ``` Install-ZertoVra -hostName -datastoreName -networkName [-memoryInGB ] [-groupName ] [-Dhcp] [-WhatIf] [-Confirm] [] ``` +### StaticIpWithRoot +``` +Install-ZertoVra -hostName -datastoreName -networkName [-memoryInGB ] + [-groupName ] -vraIpAddress -defaultGateway -subnetMask + [-UseRootCredential] -HostRootPassword [-WhatIf] [-Confirm] [] +``` + ### StaticIp ``` Install-ZertoVra -hostName -datastoreName -networkName [-memoryInGB ] @@ -44,6 +58,20 @@ PS C:\> Install-ZertoVra -hostName "Host01" -datastoreName "Datastore01" -networ Installs a VRA on the Host "Host01" using datastore "Datastore01" on network "VM Network" assigning a DHCP address. +### Example 3 +```powershell +PS C:\> Install-ZertoVra -hostName "Host01" -datastoreName "Datastore01" -networkName "VM Network" -vraIpAddress "192.168.1.50" -defaultGateway "192.168.1.254" -subnetMask "255.255.255.0" -UseRootCredential -HostRootPassword $RootPasswordAsSecureString +``` + +Installs a VRA on the Host "Host01" using datastore "Datastore01" on network "VM Network" assigning an IP address if "192.168.1.50", subnetmask of "255.255.255.0" and default gateway of "192.168.1.254" using the Root Credential install method. + +### Example 4 +```powershell +PS C:\> Install-ZertoVra -hostName "Host01" -datastoreName "Datastore01" -networkName "VM Network" -dhcp -UseRootCredential -HostRootPassword $RootPasswordAsSecureString +``` + +Installs a VRA on the Host "Host01" using datastore "Datastore01" on network "VM Network" assigning a DHCP address using the Root Credential install method. + ## PARAMETERS ### -datastoreName @@ -66,7 +94,7 @@ Default gateway to assign to the VRA ```yaml Type: String -Parameter Sets: StaticIp +Parameter Sets: StaticIpWithRoot, StaticIp Aliases: Required: True @@ -81,7 +109,7 @@ Assign a DHCP address to the VRA. ```yaml Type: SwitchParameter -Parameter Sets: Dhcp +Parameter Sets: DhcpWithRoot, Dhcp Aliases: Required: True @@ -122,6 +150,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -HostRootPassword +The password for the root user of the ESXi host where the VRA is to be installed. + +```yaml +Type: SecureString +Parameter Sets: DhcpWithRoot, StaticIpWithRoot +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -memoryInGB Initial amount of memory to assign to the VRA in GB. Default is 3, Minimum is 1, Maximum is 16 @@ -158,7 +201,22 @@ Subnetmask to be assigned to the VRA ```yaml Type: String -Parameter Sets: StaticIp +Parameter Sets: StaticIpWithRoot, StaticIp +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -UseRootCredential +Use this switch to install the VRA using the root password install method. + +```yaml +Type: SwitchParameter +Parameter Sets: DhcpWithRoot, StaticIpWithRoot Aliases: Required: True @@ -173,7 +231,7 @@ Static IP address to assign to the VRA. ```yaml Type: String -Parameter Sets: StaticIp +Parameter Sets: StaticIpWithRoot, StaticIp Aliases: Required: True @@ -215,7 +273,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS From 83879a51e7f99f0f6aea2bdbe7309672505b9758 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 11:54:48 -0400 Subject: [PATCH 315/479] Update RELEASENOTES.md --- RELEASENOTES.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 891d95c..b37c6ad 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -9,3 +9,5 @@ * Corrected a parameter typo in the `Get-ZertoVpgSetting` function. The misspelt parameter was added as an alias to ensure any existing scripts using the parameter continue to function. * Refactored the `Get-ZertoVpg` command to remove repetitive commands and variables that are no longer required. * Moved `Invoke-ZertoRestRequest` and `Invoke-ZARestRequest` to be public functions. As there become more and more scenarios where there are not prebuilt functions to accomplish complex specialized tasks, it became apparent that these functions could be leveraged to make the experience and workflow easier. +* Updated the `Install-ZertoVra` logic to ensure that the target datastore is available on the target host. There isn't currently any method to validate the target network, but if that becomes available in a later version of the API, the function will be updated. +* Updated the `Install-ZertoVra` function to allow for installation of the VRA using the host password method. Please review the [Install-ZertoVra](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Install-ZertoVra.md) documentation for syntax and examples. From 8b43856558337e564eb24adfedac233c0c0ca2ab Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 12:17:55 -0400 Subject: [PATCH 316/479] Update build agents. --- azure-pipelines.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9a6cd9e..e5c7180 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,11 +18,11 @@ pr: jobs: # Windows PowerShell 5.1 Build Job - - job: Build_PS_Win2016 + - job: Build_PS_Windows timeoutInMinutes: 10 cancelTimeoutInMinutes: 2 pool: - vmImage: vs2017-win2016 + vmImage: windows-latest steps: # Run build.ps1 script in PowerShell Core - powershell: | @@ -46,11 +46,11 @@ jobs: # Windows PowerShell Core Build Job - - job: Build_PSCore_Win2016 + - job: Build_PSCore_Windows timeoutInMinutes: 10 cancelTimeoutInMinutes: 2 pool: - vmImage: vs2017-win2016 + vmImage: windows-latest steps: # Run build.ps1 script in PowerShell Core - pwsh: | @@ -73,11 +73,11 @@ jobs: condition: always() # Linux Build Job - - job: Build_PSCore_Ubuntu1604 + - job: Build_PSCore_Ubuntu timeoutInMinutes: 10 cancelTimeoutInMinutes: 2 pool: - vmImage: ubuntu-16.04 + vmImage: ubuntu-latest steps: # Run build.ps1 script in PowerShell Core - pwsh: | @@ -112,11 +112,11 @@ jobs: condition: always() # MacOS Build Job - - job: Build_PSCore_MacOS1013 + - job: Build_PSCore_MacOS timeoutInMinutes: 10 cancelTimeoutInMinutes: 2 pool: - vmImage: xcode9-macos10.13 + vmImage: macOS-latest steps: # Run build.ps1 script in PowerShell Core - pwsh: | From a8b9ec3a009774c6c05cd71ee42121822eda58be Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 15:12:04 -0400 Subject: [PATCH 317/479] Update Help File Formatting --- docs/Get-ZAPlannerJournalSizeReport.md | 4 ++-- docs/Get-ZAPlannerNetworkPerformanceReport.md | 5 ++--- docs/Get-ZAPlannerSite.md | 8 ++++---- docs/Get-ZAPlannerStatsReport.md | 3 +-- docs/Get-ZAPlannerWanReport.md | 3 +-- docs/Get-ZAPlannerZcasReport.md | 3 +-- 6 files changed, 11 insertions(+), 15 deletions(-) diff --git a/docs/Get-ZAPlannerJournalSizeReport.md b/docs/Get-ZAPlannerJournalSizeReport.md index 719cae7..9796b5f 100644 --- a/docs/Get-ZAPlannerJournalSizeReport.md +++ b/docs/Get-ZAPlannerJournalSizeReport.md @@ -149,8 +149,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -159,5 +158,6 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink ## NOTES ## RELATED LINKS + [Zerto Planner Journal Size Report - Post](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_stats_journal_size) [Zerto Planner Journal Size Report - Get](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_stats_journal_size) diff --git a/docs/Get-ZAPlannerNetworkPerformanceReport.md b/docs/Get-ZAPlannerNetworkPerformanceReport.md index 4f17ecc..2b8c1eb 100644 --- a/docs/Get-ZAPlannerNetworkPerformanceReport.md +++ b/docs/Get-ZAPlannerNetworkPerformanceReport.md @@ -10,7 +10,6 @@ schema: 2.0.0 ## SYNOPSIS Create a report request to retrieve the Network Performance for a specific VMs list, and timeframe. - ## SYNTAX ``` @@ -144,8 +143,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -154,6 +152,7 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink ## NOTES ## RELATED LINKS + [Zerto Analytics Planner Network-Performance API Endpoint - POST](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_network_performance) [Zerto Analytics Planner Network-Performance API Endpoint - GET](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_network_performance) diff --git a/docs/Get-ZAPlannerSite.md b/docs/Get-ZAPlannerSite.md index d2a0387..5003758 100644 --- a/docs/Get-ZAPlannerSite.md +++ b/docs/Get-ZAPlannerSite.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Get-ZAPlannerSite ## SYNOPSIS -Retrieve all active Planner sites for a specific account – includes ID, Name and Type or retrieves datacenter, host, and VMs for a specific site. +Retrieve all active Planner sites for a specific account - includes ID, Name and Type or retrieves datacenter, host, and VMs for a specific site. ## SYNTAX @@ -17,7 +17,7 @@ Get-ZAPlannerSite [[-siteIdentifier] ] [] ``` ## DESCRIPTION -Retrieve all active Planner sites for a specific account – includes ID, Name and Type or retrieves datacenter, host, and VMs for a specific site. +Retrieve all active Planner sites for a specific account - includes ID, Name and Type or retrieves datacenter, host, and VMs for a specific site. ## EXAMPLES @@ -53,8 +53,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS @@ -63,5 +62,6 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink ## NOTES ## RELATED LINKS + [Zerto Analytics Sites Planner Endpoint](https://docs.api.zerto.com/#/Planner/get_v2_planner_sites) [Zerto Analytics Single Site Planner Endpoint](https://docs.api.zerto.com/#/Planner/get_v2_planner_sites__siteIdentifier_) diff --git a/docs/Get-ZAPlannerStatsReport.md b/docs/Get-ZAPlannerStatsReport.md index cd2e4b9..dd57171 100644 --- a/docs/Get-ZAPlannerStatsReport.md +++ b/docs/Get-ZAPlannerStatsReport.md @@ -127,8 +127,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAPlannerWanReport.md b/docs/Get-ZAPlannerWanReport.md index 321021a..bb88176 100644 --- a/docs/Get-ZAPlannerWanReport.md +++ b/docs/Get-ZAPlannerWanReport.md @@ -110,8 +110,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAPlannerZcasReport.md b/docs/Get-ZAPlannerZcasReport.md index 911412f..0904caa 100644 --- a/docs/Get-ZAPlannerZcasReport.md +++ b/docs/Get-ZAPlannerZcasReport.md @@ -110,8 +110,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS From 69fb384c89577aaff09003e25c65cfb9fac3bd95 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 15:12:43 -0400 Subject: [PATCH 318/479] Create Get-ZAProtectedVm.ps1 --- ZertoApiWrapper/Public/Get-ZAProtectedVm.ps1 | 50 ++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 ZertoApiWrapper/Public/Get-ZAProtectedVm.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZAProtectedVm.ps1 b/ZertoApiWrapper/Public/Get-ZAProtectedVm.ps1 new file mode 100644 index 0000000..8340275 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAProtectedVm.ps1 @@ -0,0 +1,50 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAProtectedVm { + [cmdletbinding(DefaultParameterSetName = "AllVMs")] + param( + [Parameter( + ParameterSetName = "AllVMs", + HelpMessage = "Use this switch when you want a list of all protected VMs. Please be warned this list can be quite large." + )] + [switch]$AllVms, + [Parameter( + ParameterSetName = "IndividualVMs", + Mandatory, + HelpMessage = "A list of VM identifiers to query" + )] + [string[]]$VMIdentifier, + [Parameter( + ParameterSetName = "IndividualVMs", + HelpMessage = "Specify this switch when you would like protected vms' volume information returned" + )] + [switch]$Volumes + ) + + Begin { + + } + + Process { + $BaseUri = "monitoring/protected-vms" + switch ($PSCmdlet.ParameterSetName) { + "AllVMs" { + Invoke-ZARestRequest -uri $BaseUri + } + + "IndividualVMs" { + foreach ($identifier in $VMIdentifier) { + if ($Volumes.IsPresent) { + $Uri = "{0}/{1}/volumes" -f $BaseUri, $identifier + } else { + $uri = $Uri = "{0}/{1}" -f $BaseUri, $identifier + } + Invoke-ZARestRequest -uri $Uri + } + } + } + } + + End { + + } +} From 8e5ced9b871ab968438e096f454f1f94320e5f8c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 15:12:52 -0400 Subject: [PATCH 319/479] Create Get-ZAProtectedVmReport.ps1 --- .../Public/Get-ZAProtectedVmReport.ps1 | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 ZertoApiWrapper/Public/Get-ZAProtectedVmReport.ps1 diff --git a/ZertoApiWrapper/Public/Get-ZAProtectedVmReport.ps1 b/ZertoApiWrapper/Public/Get-ZAProtectedVmReport.ps1 new file mode 100644 index 0000000..b79fa34 --- /dev/null +++ b/ZertoApiWrapper/Public/Get-ZAProtectedVmReport.ps1 @@ -0,0 +1,31 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Get-ZAProtectedVmReport { + [cmdletbinding()] + param( + [Parameter( + ParameterSetName = "GenerateReport", + Mandatory, + HelpMessage = "A list of VM identifiers to include in the report." + )] + [string[]]$VMIdentifier + ) + + Begin { + + } + + Process { + $BaseUri = "monitoring/protected-vms" + $Body = @{ + vmsIdentifiers = $VMIdentifier + } + $reportId = Invoke-ZARestRequest -uri $BaseUri -method POST -body ($Body | ConvertTo-Json) + Start-Sleep 1 + $Uri = "{0}?reportId={1}" -f $BaseUri, $reportId.reportId + Invoke-ZARestRequest -uri $Uri + } + + End { + + } +} From b00ededc7fcf538845f874774af9a1b7fda4943f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 16:44:08 -0400 Subject: [PATCH 320/479] Create Get-ZAProtectedVm.md --- docs/Get-ZAProtectedVm.md | 120 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 docs/Get-ZAProtectedVm.md diff --git a/docs/Get-ZAProtectedVm.md b/docs/Get-ZAProtectedVm.md new file mode 100644 index 0000000..3f4d353 --- /dev/null +++ b/docs/Get-ZAProtectedVm.md @@ -0,0 +1,120 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZAProtectedVm + +## SYNOPSIS +Gets information about currently protected Virtual Machines in all sites. If desired a subset of VMs can be returned by providing VM Identifiers for each virtual machine. + +## SYNTAX + +### AllVMs (Default) +``` +Get-ZAProtectedVm [-AllVms] [] +``` + +### IndividualVMs +``` +Get-ZAProtectedVm -VMIdentifier [-Volumes] [] +``` + +## DESCRIPTION +Gets information about currently protected Virtual Machines in all sites. If desired a subset of VMs can be returned by providing VM Identifiers for each virtual machine. Finally, when gathering information for individual virtual machines, the `-Volumes` parameter can be specified to return volume information for the protected VM. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAProtectedVm +``` + +Returns all protected virtual machines across all sites. + +### Example 2 +```powershell +PS C:\> Get-ZAProtectedVm -AllVMs +``` + +Returns all protected virtual machines across all sites. + +### Example 3 +```powershell +PS C:\> Get-ZAProtectedVm -VMIdentifier '09914-12345-12341235', '81238-12532-12355332' +``` + +Returns information for only the two specified virtual machines + +### Example 4 +```powershell +PS C:\> Get-ZAProtectedVm -VMIdentifier '09914-12345-12341235', '81238-12532-12355332' -Volumes +``` + +Returns volume information for the two specified virtual machines + +## PARAMETERS + +### -AllVms +Use this switch when you want a list of all protected VMs. +Please be warned this list can be quite large. + +```yaml +Type: SwitchParameter +Parameter Sets: AllVMs +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VMIdentifier +A list of VM identifiers to query + +```yaml +Type: String[] +Parameter Sets: IndividualVMs +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Volumes +Specify this switch when you would like protected vms' volume information returned + +```yaml +Type: SwitchParameter +Parameter Sets: IndividualVMs +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS +[Zerto Analytics Protected VMs API Endpoint - AllVMs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_protected_vms) +[Zerto Analytics Protected VMs API Endpoint - List of VMs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_protected_vms__vmIdentifier_) +[Zerto Analytics Protected VMs API Endpoint - Volumes of VMs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_protected_vms__vmIdentifier__volumes) + From 2fef1dbc428faf20441f43d674a48d0b79511dd7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 16:46:59 -0400 Subject: [PATCH 321/479] Create Get-ZAProtectedVmReport.md --- docs/Get-ZAProtectedVmReport.md | 60 +++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 docs/Get-ZAProtectedVmReport.md diff --git a/docs/Get-ZAProtectedVmReport.md b/docs/Get-ZAProtectedVmReport.md new file mode 100644 index 0000000..777fcea --- /dev/null +++ b/docs/Get-ZAProtectedVmReport.md @@ -0,0 +1,60 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Get-ZAProtectedVmReport + +## SYNOPSIS +Creates a report of the requested protected virtual machines' volumes. + +## SYNTAX + +``` +Get-ZAProtectedVmReport -VMIdentifier [] +``` + +## DESCRIPTION +Creates a report of the requested protected virtual machines' volumes. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAProtectedVmReport -VMIdentifier '09914-12345-12341235', '81238-12532-12355332' +``` + +Generates a protected vm report for the virtual machines with the specified VMIdentifiers. + +## PARAMETERS + +### -VMIdentifier +A list of VM identifiers to include in the report. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS +[Zerto Analytics Protected VMs Report API Endpoint - POST](https://docs.api.zerto.com/#/Monitoring/post_v2_monitoring_protected_vms) +[Zerto Analytics Protected VMs Report API Endpoint - GET](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_protected_vms_reportId__reportId_) From 1a66d4e64bc08b4c8874d18f958717ea6efffad7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 17:09:25 -0400 Subject: [PATCH 322/479] Update Get-ZAPlannerStatsReport.md --- docs/Get-ZAPlannerStatsReport.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/Get-ZAPlannerStatsReport.md b/docs/Get-ZAPlannerStatsReport.md index dd57171..c052737 100644 --- a/docs/Get-ZAPlannerStatsReport.md +++ b/docs/Get-ZAPlannerStatsReport.md @@ -8,6 +8,7 @@ schema: 2.0.0 # Get-ZAPlannerStatsReport ## SYNOPSIS +Create a report request for the selected VMs for a specific timeframe, retrieving all stats data for ZCAs, WAN, Journal size and array of VMs avg IOPs, avg throughput and journal size. ## SYNTAX @@ -17,16 +18,23 @@ Get-ZAPlannerStatsReport [-siteIdentifier] [-recoveryType] [-v ``` ## DESCRIPTION -{{Fill in the Description}} +Create a report request for the selected VMs for a specific timeframe, retrieving all stats data for ZCAs, WAN, Journal size and array of VMs avg IOPs, avg throughput and journal size. ## EXAMPLES ### Example 1 ```powershell -PS C:\> {{ Add example code here }} +PS C:\> Get-ZAPlannerStatsReport -siteIdentifier '0123-45676-09876' -recoveryType vcenter -vmIdentifier 'vmIdentifier01', 'vmIdentifier02' ``` -{{ Add example description here }} +Will get a stats report for the two VMs listed recovering to a vCenter site with a 24 hour journal + +### Example 2 +```powershell +PS C:\> Get-ZAPlannerStatsReport -siteIdentifier '0123-45676-09876' -recoveryType Azure -vmIdentifier 'vmIdentifier01', 'vmIdentifier02' -desiredJournalHistory 72 +``` + +Will get a stats report for the two VMs listed recovering to an Azure site with a 72 hour journal ## PARAMETERS @@ -136,3 +144,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES ## RELATED LINKS +[Zerto Analytics Planner Stats API Endpoint - POST](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_stats) +[Zerto Analytics Planner Stats API Endpoint - GET](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_stats) From 78e1cdb9810a7a12d2188b29904c984a948cd742 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 17:16:11 -0400 Subject: [PATCH 323/479] Update Get-ZAPlannerWanReport.md --- docs/Get-ZAPlannerWanReport.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/Get-ZAPlannerWanReport.md b/docs/Get-ZAPlannerWanReport.md index bb88176..a9ddb45 100644 --- a/docs/Get-ZAPlannerWanReport.md +++ b/docs/Get-ZAPlannerWanReport.md @@ -8,6 +8,7 @@ schema: 2.0.0 # Get-ZAPlannerWanReport ## SYNOPSIS +Create a report request to retrieve WAN for a specific VMs list, and timeframe. ## SYNTAX @@ -17,16 +18,16 @@ Get-ZAPlannerWanReport [-siteIdentifier] [-recoveryType] [-vmI ``` ## DESCRIPTION -{{Fill in the Description}} +Create a report request to retrieve WAN for a specific VMs list, and timeframe. ## EXAMPLES ### Example 1 ```powershell -PS C:\> {{ Add example code here }} +PS C:\> Get-ZAPlannerWanReport -siteIdentifier '12345-0987654-254364' -recoveryType vcenter -vmIdentifier '1234-98789-0987', '1234-98789-1252' ``` -{{ Add example description here }} +Get a WAN requirements report for VMs at the protected site. ## PARAMETERS @@ -119,3 +120,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES ## RELATED LINKS +[Zerto Analytics Planner Wan Stats API Endpoint - POST](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_stats_wan) +[Zerto Analytics Planner Wan Stats API Endpoint - GET](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_stats_wan) From 0ef71c25bbecae300e1d8dcddcc23cfba83bb0ba Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 17:16:14 -0400 Subject: [PATCH 324/479] Update Get-ZAPlannerZcasReport.md --- docs/Get-ZAPlannerZcasReport.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/Get-ZAPlannerZcasReport.md b/docs/Get-ZAPlannerZcasReport.md index 0904caa..bee5805 100644 --- a/docs/Get-ZAPlannerZcasReport.md +++ b/docs/Get-ZAPlannerZcasReport.md @@ -8,6 +8,7 @@ schema: 2.0.0 # Get-ZAPlannerZcasReport ## SYNOPSIS +Create a report request to retrieve ZCAs for a specific VMs list, and timeframe. ## SYNTAX @@ -17,16 +18,16 @@ Get-ZAPlannerZcasReport [-siteIdentifier] [-recoveryType] [-vm ``` ## DESCRIPTION -{{Fill in the Description}} +Create a report request to retrieve ZCAs for a specific VMs list, and timeframe. ## EXAMPLES ### Example 1 ```powershell -PS C:\> {{ Add example code here }} +PS C:\> Get-ZAPlannerZcasReport -siteIdentifier '12345-0987654-254364' -recoveryType azure -vmIdentifier '1234-98789-0987', '1234-98789-1252' ``` -{{ Add example description here }} +Get a report for the number of required ZCA's in Azure to protect the supplied VMs. ## PARAMETERS @@ -119,3 +120,5 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## NOTES ## RELATED LINKS +[Zerto Analytics Planner ZCA Stats API Endpoint - POST](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_stats_zcas) +[Zerto Analytics Planner ZCA Stats API Endpoint - GET](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_stats_zcas) From 1af70b8c80710ae83fa2edbf92e17d343bf1edf6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 17:38:35 -0400 Subject: [PATCH 325/479] Create Tests --- .../Get-ZAPlannerJournalSizeReport.Tests.ps1 | 57 +++++++++++++++++++ ...APlannerNetworkPerformanceReport.Tests.ps1 | 57 +++++++++++++++++++ Tests/Public/Get-ZAPlannerSite.Tests.ps1 | 42 ++++++++++++++ .../Public/Get-ZAPlannerStatsReport.Tests.ps1 | 57 +++++++++++++++++++ Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 | 56 ++++++++++++++++++ .../Public/Get-ZAPlannerZcasReport.Tests.ps1 | 57 +++++++++++++++++++ Tests/Public/Get-ZAProtectedVm.Tests.ps1 | 41 +++++++++++++ .../Public/Get-ZAProtectedVmReport.Tests.ps1 | 39 +++++++++++++ 8 files changed, 406 insertions(+) create mode 100644 Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 create mode 100644 Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 create mode 100644 Tests/Public/Get-ZAPlannerSite.Tests.ps1 create mode 100644 Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 create mode 100644 Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 create mode 100644 Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 create mode 100644 Tests/Public/Get-ZAProtectedVm.Tests.ps1 create mode 100644 Tests/Public/Get-ZAProtectedVmReport.Tests.ps1 diff --git a/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 new file mode 100644 index 0000000..e9301e0 --- /dev/null +++ b/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 @@ -0,0 +1,57 @@ +#Requires -Modules Pester +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] + +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 17 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 17 + } + + $ParameterTestCases = @( + @{ParameterName = 'siteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'vmIdentifier'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'recoveryType'; Type = 'String'; Mandatory = $true; Validation = 'Set' } + @{ParameterName = 'desiredJournalHistory'; Type = 'String'; Mandatory = $true; Validation = 'Range' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + 'Set' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateSet] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } + } + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 new file mode 100644 index 0000000..5e2b7f6 --- /dev/null +++ b/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 @@ -0,0 +1,57 @@ +#Requires -Modules Pester +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] + +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 17 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 17 + } + + $ParameterTestCases = @( + @{ParameterName = 'siteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'vmIdentifier'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'recoveryType'; Type = 'String'; Mandatory = $true; Validation = 'Set' } + @{ParameterName = 'interval'; Type = 'Int'; Mandatory = $false; Validation = 'Range' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + 'Set' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateSet] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } + } + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAPlannerSite.Tests.ps1 b/Tests/Public/Get-ZAPlannerSite.Tests.ps1 new file mode 100644 index 0000000..c12a46f --- /dev/null +++ b/Tests/Public/Get-ZAPlannerSite.Tests.ps1 @@ -0,0 +1,42 @@ +#Requires -Modules Pester +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] + +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 12 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 12 + } + + $ParameterTestCases = @( + @{ParameterName = 'siteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } + } + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 new file mode 100644 index 0000000..bed9818 --- /dev/null +++ b/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 @@ -0,0 +1,57 @@ +#Requires -Modules Pester +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] + +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 17 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 17 + } + + $ParameterTestCases = @( + @{ParameterName = 'siteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'vmIdentifier'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'recoveryType'; Type = 'String'; Mandatory = $true; Validation = 'Set' } + @{ParameterName = 'desiredJournalHistory'; Type = 'Int'; Mandatory = $false; Validation = 'Range' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + 'Set' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateSet] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } + } + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 new file mode 100644 index 0000000..238ba22 --- /dev/null +++ b/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 @@ -0,0 +1,56 @@ +#Requires -Modules Pester +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] + +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 16 + } + + $ParameterTestCases = @( + @{ParameterName = 'siteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'vmIdentifier'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'recoveryType'; Type = 'String'; Mandatory = $true; Validation = 'Set' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + 'Set' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateSet] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } + } + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 new file mode 100644 index 0000000..bed9818 --- /dev/null +++ b/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 @@ -0,0 +1,57 @@ +#Requires -Modules Pester +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] + +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 17 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 17 + } + + $ParameterTestCases = @( + @{ParameterName = 'siteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'vmIdentifier'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'recoveryType'; Type = 'String'; Mandatory = $true; Validation = 'Set' } + @{ParameterName = 'desiredJournalHistory'; Type = 'Int'; Mandatory = $false; Validation = 'Range' } + @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + 'Range' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 + } + + 'Set' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateSet] }.Count | Should -Be 1 + } + + default { + $true | Should be $false -Because "No Validation Selected. Review test cases" + } + } + } + } + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAProtectedVm.Tests.ps1 b/Tests/Public/Get-ZAProtectedVm.Tests.ps1 new file mode 100644 index 0000000..89e1e5d --- /dev/null +++ b/Tests/Public/Get-ZAProtectedVm.Tests.ps1 @@ -0,0 +1,41 @@ +#Requires -Modules Pester +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] + +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 + } + + $ParameterTestCases = @( + @{ParameterName = 'AllVms'; Type = 'Switch'; Mandatory = $false; Validation = $Null } + @{ParameterName = 'vmIdentifier'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'Volumes'; Type = 'Switch'; Mandatory = $false; Validation = $Null } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + } + } + } + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Get-ZAProtectedVmReport.Tests.ps1 b/Tests/Public/Get-ZAProtectedVmReport.Tests.ps1 new file mode 100644 index 0000000..95ad321 --- /dev/null +++ b/Tests/Public/Get-ZAProtectedVmReport.Tests.ps1 @@ -0,0 +1,39 @@ +#Requires -Modules Pester +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] + +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + + Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 12 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 12 + } + + $ParameterTestCases = @( + @{ParameterName = 'vmIdentifier'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + } + } + } + + Context "$global:function::Parameter Functional Tests" { + + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global From fbe9fb2af8ba246008cfcfe5a487b691d6e6ad4d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 17:43:28 -0400 Subject: [PATCH 326/479] Fix Parameter Test --- Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 index e9301e0..bed9818 100644 --- a/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 @@ -13,7 +13,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { @{ParameterName = 'siteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } @{ParameterName = 'vmIdentifier'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } @{ParameterName = 'recoveryType'; Type = 'String'; Mandatory = $true; Validation = 'Set' } - @{ParameterName = 'desiredJournalHistory'; Type = 'String'; Mandatory = $true; Validation = 'Range' } + @{ParameterName = 'desiredJournalHistory'; Type = 'Int'; Mandatory = $false; Validation = 'Range' } @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } ) From 285a82f2805f21bbabd88f8c6abc48b7ffb46b8f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 17:43:39 -0400 Subject: [PATCH 327/479] Fix Parameter Test --- Tests/Public/Get-ZAPlannerSite.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Public/Get-ZAPlannerSite.Tests.ps1 b/Tests/Public/Get-ZAPlannerSite.Tests.ps1 index c12a46f..ef63e5c 100644 --- a/Tests/Public/Get-ZAPlannerSite.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerSite.Tests.ps1 @@ -10,7 +10,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } $ParameterTestCases = @( - @{ParameterName = 'siteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'siteIdentifier'; Type = 'String[]'; Mandatory = $false; Validation = 'NotNullOrEmpty' } ) It " parameter is of type" -TestCases $ParameterTestCases { From 646476e74ecb8d9debb052c38029ea2d03a9b75f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 17:43:50 -0400 Subject: [PATCH 328/479] Remove unused parameter --- Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 index bed9818..0412e64 100644 --- a/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 @@ -5,15 +5,14 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - It "$global:function should have exactly 17 parameters defined" { - (Get-Command $global:function).Parameters.Count | Should -Be 17 + It "$global:function should have exactly 16 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 16 } $ParameterTestCases = @( @{ParameterName = 'siteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } @{ParameterName = 'vmIdentifier'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } @{ParameterName = 'recoveryType'; Type = 'String'; Mandatory = $true; Validation = 'Set' } - @{ParameterName = 'desiredJournalHistory'; Type = 'Int'; Mandatory = $false; Validation = 'Range' } @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } ) From f299aecb9b6e548944be74a639d822c5d54e276f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 17:44:00 -0400 Subject: [PATCH 329/479] Add parameter validation --- ZertoApiWrapper/Public/Get-ZAProtectedVm.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/ZertoApiWrapper/Public/Get-ZAProtectedVm.ps1 b/ZertoApiWrapper/Public/Get-ZAProtectedVm.ps1 index 8340275..86299ba 100644 --- a/ZertoApiWrapper/Public/Get-ZAProtectedVm.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAProtectedVm.ps1 @@ -12,6 +12,7 @@ function Get-ZAProtectedVm { Mandatory, HelpMessage = "A list of VM identifiers to query" )] + [ValidateNotNullOrEmpty()] [string[]]$VMIdentifier, [Parameter( ParameterSetName = "IndividualVMs", From 0a84246d8ebf421e7e0287f0906e83f7697b321e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 17:44:16 -0400 Subject: [PATCH 330/479] Add parameter validation --- ZertoApiWrapper/Public/Get-ZAProtectedVmReport.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/ZertoApiWrapper/Public/Get-ZAProtectedVmReport.ps1 b/ZertoApiWrapper/Public/Get-ZAProtectedVmReport.ps1 index b79fa34..c02b0cd 100644 --- a/ZertoApiWrapper/Public/Get-ZAProtectedVmReport.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAProtectedVmReport.ps1 @@ -7,6 +7,7 @@ function Get-ZAProtectedVmReport { Mandatory, HelpMessage = "A list of VM identifiers to include in the report." )] + [ValidateNotNullOrEmpty()] [string[]]$VMIdentifier ) From bc46a512cdac91c8957cbfe2f6c20c5d598073d7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 17:55:04 -0400 Subject: [PATCH 331/479] Update RELEASENOTES.md --- RELEASENOTES.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index b37c6ad..094cf75 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -11,3 +11,14 @@ * Moved `Invoke-ZertoRestRequest` and `Invoke-ZARestRequest` to be public functions. As there become more and more scenarios where there are not prebuilt functions to accomplish complex specialized tasks, it became apparent that these functions could be leveraged to make the experience and workflow easier. * Updated the `Install-ZertoVra` logic to ensure that the target datastore is available on the target host. There isn't currently any method to validate the target network, but if that becomes available in a later version of the API, the function will be updated. * Updated the `Install-ZertoVra` function to allow for installation of the VRA using the host password method. Please review the [Install-ZertoVra](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Install-ZertoVra.md) documentation for syntax and examples. + +### Zerto Analytics + +* Added several functions for the newly added [Zerto Analytics](https://analytics.zerto.com) Planner. + * `Get-ZAPlannerSite` Help can be found here: [Get-ZAPlannerSite](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerSite.md) + * `Get-ZAPlannerStatsReport` Help can be found here: [Get-ZAPlannerStatsReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerStatsReport.md) + * `Get-ZAPlannerJournalSizeReport` Help can be found here: [Get-ZAPlannerJournalSizeReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerJournalSizeReport.md) + * `Get-ZAPlannerNetworkPerformanceReport` Help can be found here: [Get-ZAPlannerNetworkPerformanceReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerNetworkPerformanceReport.md) + * `Get-ZAPlannerWanReport` Help can be found here: [Get-ZAPlannerWanReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerWanReport.md) + * `Get-ZAPlannerZcasReport` Help can be found here: [Get-ZAPlannerZcasReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerZcasReport.md) +* Created `Get-ZAProtectedVm` and `Get-ZAProtectedVmReport` functions to leverage the newly released Zerto Analytics APIs for this data. Help files can be found here: [Get-ZAProtectedVm](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVm.md) and [Get-ZAProtectedVmReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVmReport.md) From 86854442ef188829775f0443323407ea8785f1bf Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 2 Apr 2020 17:56:57 -0400 Subject: [PATCH 332/479] Update Online Link to Help --- docs/Get-ZAProtectedVm.md | 2 +- docs/Get-ZAProtectedVmReport.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Get-ZAProtectedVm.md b/docs/Get-ZAProtectedVm.md index 3f4d353..61a97cd 100644 --- a/docs/Get-ZAProtectedVm.md +++ b/docs/Get-ZAProtectedVm.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVm.md schema: 2.0.0 --- diff --git a/docs/Get-ZAProtectedVmReport.md b/docs/Get-ZAProtectedVmReport.md index 777fcea..c39f2b1 100644 --- a/docs/Get-ZAProtectedVmReport.md +++ b/docs/Get-ZAProtectedVmReport.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVmReport.md schema: 2.0.0 --- From 61219405639eb66d916c45634ca7c5199ee04160 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 3 Apr 2020 10:35:44 -0400 Subject: [PATCH 333/479] Added ability to updated Host Password --- ZertoApiWrapper/Public/Edit-ZertoVra.ps1 | 26 +++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/ZertoApiWrapper/Public/Edit-ZertoVra.ps1 b/ZertoApiWrapper/Public/Edit-ZertoVra.ps1 index 1a0e40b..0b1b9fc 100644 --- a/ZertoApiWrapper/Public/Edit-ZertoVra.ps1 +++ b/ZertoApiWrapper/Public/Edit-ZertoVra.ps1 @@ -18,20 +18,26 @@ function Edit-ZertoVra { ParameterSetName = "StaticIp", HelpMessage = "Static IP address to assign to the VRA." )] - [ValidateScript( {$_ -match [IPAddress]$_ })] + [ValidateScript( { $_ -match [IPAddress]$_ })] [string]$vraIpAddress, [Parameter( ParameterSetName = "StaticIp", HelpMessage = "Default gateway to assign to the VRA" )] - [ValidateScript( {$_ -match [IPAddress]$_ })] + [ValidateScript( { $_ -match [IPAddress]$_ })] [string]$defaultGateway, [Parameter( ParameterSetName = "StaticIp", HelpMessage = "Subnetmask to be assigned to the VRA" )] - [ValidateScript( {$_ -match [IPAddress]$_ })] - [string]$subnetMask + [ValidateScript( { $_ -match [IPAddress]$_ })] + [string]$subnetMask, + [Parameter( + HelpMessage = "Updated ESXi host root password." + )] + [ValidateNotNullOrEmpty()] + [securestring]$HostRootPassword + ) begin { @@ -45,8 +51,8 @@ function Edit-ZertoVra { process { # Create ordered hashtables to be converted later to JSON. - $vraUpdate = [ordered]@{} - $vraNetwork = [ordered]@{} + $vraUpdate = [ordered]@{ } + $vraNetwork = [ordered]@{ } # If a new group name is specified, update. if ( $PSBoundParameters.ContainsKey('GroupName')) { $vraUpdate['GroupName'] = $groupName @@ -77,8 +83,14 @@ function Edit-ZertoVra { $vraNetwork['VraIPConfigurationTypeApi'] = "Dhcp" $vraUpdate['VraNetworkDataApi'] = $vraNetwork } + if ($PSBoundParameters.ContainsKey('HostRootPassword')) { + $HostRootCredential = [pscredential]::New('root', $HostRootPassword) + $vraUpdate['UsePublicKeyInsteadOfCredentials'] = $false + $vraUpdate['HostRootPassword'] = $HostRootCredential.GetNetworkCredential().Password + } + # -WhatIf processing and submit! - if ($PSCmdlet.ShouldProcess( "Updating " + $vra.vraName + " with these settings: $($vraUpdate | convertTo-Json)")) { + if ($PSCmdlet.ShouldProcess( $vra.vraName )) { Invoke-ZertoRestRequest -uri $baseUri -body $($vraUpdate | ConvertTo-Json) -method "PUT" } } From fb722661a79f1b59514e43c08d229ad12a12e246 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 3 Apr 2020 16:51:09 -0400 Subject: [PATCH 334/479] Update Edit-ZertoVra.Tests.ps1 --- Tests/Public/Edit-ZertoVra.Tests.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/Public/Edit-ZertoVra.Tests.ps1 b/Tests/Public/Edit-ZertoVra.Tests.ps1 index ec609fd..9c872fc 100644 --- a/Tests/Public/Edit-ZertoVra.Tests.ps1 +++ b/Tests/Public/Edit-ZertoVra.Tests.ps1 @@ -28,6 +28,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { @{ParameterName = 'vraIpAddress'; Type = 'String'; Mandatory = $false } @{ParameterName = 'defaultGateway'; Type = 'String'; Mandatory = $false } @{ParameterName = 'subnetMask'; Type = 'String'; Mandatory = $false } + @{ParameterName = 'HostRootPassword'; Type = 'securestring'; Mandatory = $false} ) It " parameter is of type" -TestCases $ParameterTestCases { @@ -56,7 +57,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { param($ParameterName) $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes $attrs.Where{ $_ -is [ValidateScript] }.Count | Should -Be 1 - $attrs.Where{ $_ -is [ValidateScript] }.ScriptBlock | Should -Match '^\$_ \-match \[IPAddress\]\$_' + $attrs.Where{ $_ -is [ValidateScript] }.ScriptBlock | Should -Match '\$_ \-match \[IPAddress\]\$_' } } From bd94bfe5db183265366b4a9f6211f4773fe39f94 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 4 Apr 2020 10:26:56 -0400 Subject: [PATCH 335/479] Update Help Files --- docs/Add-ZertoPeerSite.md | 2 +- docs/Checkpoint-ZertoVpg.md | 2 +- docs/Connect-ZertoAnalytics.md | 122 +++--- docs/Connect-ZertoServer.md | 2 +- docs/Copy-ZertoVpg.md | 254 ++++++------ docs/Disconnect-ZertoServer.md | 2 +- docs/Edit-ZertoVra.md | 19 +- docs/Export-ZertoVmNicSetting.md | 158 ++++---- docs/Export-ZertoVpg.md | 2 +- docs/Get-ZAAlert.md | 250 ++++++------ docs/Get-ZADatastore.md | 246 ++++++------ docs/Get-ZAEvent.md | 280 +++++++------- docs/Get-ZAJournalAverageHistory.md | 246 ++++++------ docs/Get-ZAJournalAverageSize.md | 246 ++++++------ docs/Get-ZAJournalBreach.md | 202 +++++----- docs/Get-ZAJournalHistoryStat.md | 202 +++++----- docs/Get-ZAJournalSiteAverageHistory.md | 246 ++++++------ docs/Get-ZAJournalSiteAverageSize.md | 246 ++++++------ docs/Get-ZAJournalSiteHistoryStat.md | 246 ++++++------ docs/Get-ZAJournalSiteHistorySummary.md | 246 ++++++------ docs/Get-ZAJournalSiteSizeStat.md | 246 ++++++------ docs/Get-ZAJournalStatusProportion.md | 202 +++++----- docs/Get-ZAJournalStorageStat.md | 202 +++++----- docs/Get-ZAJournalSummary.md | 202 +++++----- docs/Get-ZALicense.md | 90 ++--- docs/Get-ZAMonitoring.md | 138 +++---- docs/Get-ZANetworkSiteAverageIOPS.md | 366 +++++++++--------- docs/Get-ZANetworkSiteAveragePerformance.md | 366 +++++++++--------- docs/Get-ZANetworkSiteStat.md | 334 ++++++++-------- docs/Get-ZANetworkSiteSummary.md | 334 ++++++++-------- docs/Get-ZANetworkVpgAverageIOPS.md | 218 +++++------ docs/Get-ZANetworkVpgAveragePerformance.md | 218 +++++------ docs/Get-ZANetworkVpgStat.md | 188 ++++----- docs/Get-ZANetworkVpgSummary.md | 188 ++++----- docs/Get-ZAPlannerJournalSizeReport.md | 326 ++++++++-------- docs/Get-ZAPlannerNetworkPerformanceReport.md | 316 +++++++-------- docs/Get-ZAPlannerSite.md | 134 +++---- docs/Get-ZAPlannerStatsReport.md | 297 +++++++------- docs/Get-ZAPlannerWanReport.md | 249 ++++++------ docs/Get-ZAPlannerZcasReport.md | 249 ++++++------ docs/Get-ZAProtectedVm.md | 240 ++++++------ docs/Get-ZAProtectedVmReport.md | 120 +++--- docs/Get-ZARPOAccountAverage.md | 218 +++++------ docs/Get-ZARPOAverage.md | 236 +++++------ docs/Get-ZARPOBreach.md | 214 +++++----- docs/Get-ZARPOStat.md | 214 +++++----- docs/Get-ZARPOStatusProportion.md | 216 +++++------ docs/Get-ZARPOSummary.md | 214 +++++----- docs/Get-ZASite.md | 138 +++---- docs/Get-ZASitePair.md | 208 +++++----- docs/Get-ZASiteTopology.md | 140 +++---- docs/Get-ZATask.md | 224 +++++------ docs/Get-ZAVolume.md | 274 ++++++------- docs/Get-ZAVpg.md | 196 +++++----- docs/Get-ZAzOrg.md | 92 ++--- docs/Get-ZertoAlert.md | 2 +- docs/Get-ZertoDatastore.md | 2 +- docs/Get-ZertoEvent.md | 2 +- docs/Get-ZertoLicense.md | 2 +- docs/Get-ZertoLocalSite.md | 2 +- docs/Get-ZertoPeerSite.md | 2 +- docs/Get-ZertoProtectedVm.md | 2 +- docs/Get-ZertoRecoveryReport.md | 2 +- docs/Get-ZertoResourcesReport.md | 2 +- docs/Get-ZertoServiceProfile.md | 2 +- docs/Get-ZertoTask.md | 2 +- docs/Get-ZertoUnprotectedVm.md | 2 +- docs/Get-ZertoVirtualizationSite.md | 2 +- docs/Get-ZertoVolume.md | 2 +- docs/Get-ZertoVpg.md | 2 +- docs/Get-ZertoVpgSetting.md | 2 +- docs/Get-ZertoVra.md | 2 +- docs/Get-ZertoZorg.md | 2 +- docs/Get-ZertoZsspSession.md | 2 +- docs/Import-ZertoVmNicSetting.md | 192 ++++----- docs/Import-ZertoVpg.md | 2 +- docs/Install-ZertoVra.md | 2 +- docs/Invoke-ZARestRequest.md | 200 +++++----- docs/Invoke-ZertoEvacuateVra.md | 2 +- docs/Invoke-ZertoFailover.md | 2 +- docs/Invoke-ZertoFailoverCommit.md | 2 +- docs/Invoke-ZertoFailoverRollback.md | 2 +- docs/Invoke-ZertoForceSync.md | 2 +- docs/Invoke-ZertoMove.md | 2 +- docs/Invoke-ZertoMoveCommit.md | 2 +- docs/Invoke-ZertoMoveRollback.md | 2 +- docs/Invoke-ZertoRestRequest.md | 308 +++++++-------- docs/New-ZertoPairingToken.md | 156 ++++---- docs/New-ZertoVpg.md | 2 +- docs/New-ZertoVpgSettingsIdentifier.md | 2 +- docs/Remove-ZertoPeerSite.md | 2 +- docs/Remove-ZertoVpg.md | 2 +- docs/Remove-ZertoVpgSettingsIdentifier.md | 180 ++++----- docs/Resume-ZertoVpg.md | 2 +- docs/Save-ZertoVpgSetting.md | 2 +- docs/Set-ZertoAlert.md | 2 +- docs/Set-ZertoLicense.md | 2 +- docs/Start-ZertoCloneVpg.md | 2 +- docs/Start-ZertoFailoverTest.md | 2 +- docs/Stop-ZertoCloneVpg.md | 2 +- docs/Stop-ZertoFailoverTest.md | 2 +- docs/Suspend-ZertoVpg.md | 2 +- docs/Uninstall-ZertoVra.md | 2 +- 103 files changed, 6083 insertions(+), 6065 deletions(-) diff --git a/docs/Add-ZertoPeerSite.md b/docs/Add-ZertoPeerSite.md index aac7bb1..7fafff4 100644 --- a/docs/Add-ZertoPeerSite.md +++ b/docs/Add-ZertoPeerSite.md @@ -116,7 +116,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Checkpoint-ZertoVpg.md b/docs/Checkpoint-ZertoVpg.md index 5e76d6a..7951d3c 100644 --- a/docs/Checkpoint-ZertoVpg.md +++ b/docs/Checkpoint-ZertoVpg.md @@ -61,7 +61,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Connect-ZertoAnalytics.md b/docs/Connect-ZertoAnalytics.md index c6d4104..0c30a0d 100644 --- a/docs/Connect-ZertoAnalytics.md +++ b/docs/Connect-ZertoAnalytics.md @@ -1,61 +1,61 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Connect-ZertoAnalytics.md -schema: 2.0.0 ---- - -# Connect-ZertoAnalytics - -## SYNOPSIS -All requests to the server, apart from the request to authenticate, must contain a security token which is provided on successful authentication. -In order to authenticate, the user sends myZerto credentials (user/password). - -## SYNTAX - -``` -Connect-ZertoAnalytics [-credential] [] -``` - -## DESCRIPTION -All requests to the server, apart from the request to authenticate, must contain a security token which is provided on successful authentication. -In order to authenticate, the user sends myZerto credentials (user/password). Once this call has been completed successfully, the header authentication token will be stored as a variable and automatically passed during future calls to the Zerto Analytics platform. This token will automatically expire after 60 minutes of inactivity and need to be reauthorized by calling this function again. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Connect-ZertoAnalytics -credential $myCredential -``` - -Connects to the Zerto Analytics site and gets a Bearer Authorization token that is automatically stored as a variable for future calls to the Zerto Analytics REST API. This token will automatically expire after 60 minutes of inactivity and need to be reauthorized by calling this function again. - -## PARAMETERS - -### -credential -PSCredential Object containing username and password authorized for the Zerto Analytics site - -```yaml -Type: PSCredential -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Authentication](https://docs.api.zerto.com/#/Authentication/post_v2_auth_token) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Connect-ZertoAnalytics.md +schema: 2.0.0 +--- + +# Connect-ZertoAnalytics + +## SYNOPSIS +All requests to the server, apart from the request to authenticate, must contain a security token which is provided on successful authentication. +In order to authenticate, the user sends myZerto credentials (user/password). + +## SYNTAX + +``` +Connect-ZertoAnalytics [-credential] [] +``` + +## DESCRIPTION +All requests to the server, apart from the request to authenticate, must contain a security token which is provided on successful authentication. +In order to authenticate, the user sends myZerto credentials (user/password). Once this call has been completed successfully, the header authentication token will be stored as a variable and automatically passed during future calls to the Zerto Analytics platform. This token will automatically expire after 60 minutes of inactivity and need to be reauthorized by calling this function again. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Connect-ZertoAnalytics -credential $myCredential +``` + +Connects to the Zerto Analytics site and gets a Bearer Authorization token that is automatically stored as a variable for future calls to the Zerto Analytics REST API. This token will automatically expire after 60 minutes of inactivity and need to be reauthorized by calling this function again. + +## PARAMETERS + +### -credential +PSCredential Object containing username and password authorized for the Zerto Analytics site + +```yaml +Type: PSCredential +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Authentication](https://docs.api.zerto.com/#/Authentication/post_v2_auth_token) diff --git a/docs/Connect-ZertoServer.md b/docs/Connect-ZertoServer.md index e6080be..160ac31 100644 --- a/docs/Connect-ZertoServer.md +++ b/docs/Connect-ZertoServer.md @@ -93,7 +93,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Copy-ZertoVpg.md b/docs/Copy-ZertoVpg.md index ff6e946..9981fcf 100644 --- a/docs/Copy-ZertoVpg.md +++ b/docs/Copy-ZertoVpg.md @@ -1,127 +1,127 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Copy-ZertoVpg.md -schema: 2.0.0 ---- - -# Copy-ZertoVpg - -## SYNOPSIS -Copy an existing VPG settings object to create a new VPG with the same settings. New VMs must be added to the copied VPG. - -## SYNTAX - -``` -Copy-ZertoVpg [-SourceVpgName] [-NewVpgName] [-VMs] [-WhatIf] [-Confirm] - [] -``` - -## DESCRIPTION -Copy an existing VPG settings object to create a new VPG with the same settings. New VMs must be added to the copied VPG. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Copy-ZertoVpg -SourceVpgName 'MyVpg' -NewVpgName 'MyNewVpg' -VMs 'VmToAdd01' -``` - -Copies the settings of 'MyVpg' into a new VPG 'MyNewVpg' adding one VM, 'VmToAdd01' - -### Example 2 -```powershell -PS C:\> Copy-ZertoVpg -SourceVpgName 'MyVpg' -NewVpgName 'MyNewVpg' -VMs 'VmToAdd01', 'VmToAdd02' -``` - -Copies the settings of 'MyVpg' into a new VPG 'MyNewVpg' adding two VMs, 'VmToAdd01' and 'VmToAdd02' - -## PARAMETERS - -### -NewVpgName -Name to assign the newly created VPG - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SourceVpgName -Name of the VPG to clone - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -VMs -Name of VMs to add to the VPG - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Clone VPG API Endpoint Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.119.html%23) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Copy-ZertoVpg.md +schema: 2.0.0 +--- + +# Copy-ZertoVpg + +## SYNOPSIS +Copy an existing VPG settings object to create a new VPG with the same settings. New VMs must be added to the copied VPG. + +## SYNTAX + +``` +Copy-ZertoVpg [-SourceVpgName] [-NewVpgName] [-VMs] [-WhatIf] [-Confirm] + [] +``` + +## DESCRIPTION +Copy an existing VPG settings object to create a new VPG with the same settings. New VMs must be added to the copied VPG. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Copy-ZertoVpg -SourceVpgName 'MyVpg' -NewVpgName 'MyNewVpg' -VMs 'VmToAdd01' +``` + +Copies the settings of 'MyVpg' into a new VPG 'MyNewVpg' adding one VM, 'VmToAdd01' + +### Example 2 +```powershell +PS C:\> Copy-ZertoVpg -SourceVpgName 'MyVpg' -NewVpgName 'MyNewVpg' -VMs 'VmToAdd01', 'VmToAdd02' +``` + +Copies the settings of 'MyVpg' into a new VPG 'MyNewVpg' adding two VMs, 'VmToAdd01' and 'VmToAdd02' + +## PARAMETERS + +### -NewVpgName +Name to assign the newly created VPG + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceVpgName +Name of the VPG to clone + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VMs +Name of VMs to add to the VPG + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Clone VPG API Endpoint Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.119.html%23) diff --git a/docs/Disconnect-ZertoServer.md b/docs/Disconnect-ZertoServer.md index cb95619..9cb7188 100644 --- a/docs/Disconnect-ZertoServer.md +++ b/docs/Disconnect-ZertoServer.md @@ -31,7 +31,7 @@ Disconnects from the Zerto Server ## PARAMETERS ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Edit-ZertoVra.md b/docs/Edit-ZertoVra.md index 677879e..4bba6fa 100644 --- a/docs/Edit-ZertoVra.md +++ b/docs/Edit-ZertoVra.md @@ -14,7 +14,7 @@ Updates a VRA with updated settings ``` Edit-ZertoVra -vraIdentifier [-groupName ] [-vraIpAddress ] [-defaultGateway ] - [-subnetMask ] [-WhatIf] [-Confirm] [] + [-subnetMask ] [-HostRootPassword ] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -89,6 +89,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -HostRootPassword +Updated ESXi host root password. + +```yaml +Type: SecureString +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -subnetMask Subnetmask to be assigned to the VRA @@ -166,7 +181,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Export-ZertoVmNicSetting.md b/docs/Export-ZertoVmNicSetting.md index 8119b8b..fe9268b 100644 --- a/docs/Export-ZertoVmNicSetting.md +++ b/docs/Export-ZertoVmNicSetting.md @@ -1,79 +1,79 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Export-ZertoVmNicSettings.md -schema: 2.0.0 ---- - -# Export-ZertoVmNicSetting - -## SYNOPSIS -Queries VPGs and associated Virtual Machines to export all protected virtual machine NIC settings to a Comma Separated Value (CSV) file. - -## SYNTAX - -``` -Export-ZertoVmNicSetting [[-VpgName] ] [-OutputFile] [] -``` - -## DESCRIPTION -Queries VPGs and associated Virtual Machines to export all protected virtual machine NIC settings to a Comma Separated Value (CSV) file. This file can be used with the Import-ZertoVmNicSetting function to bulk update. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Export-ZertoVmNicSetting -OutputFile "C:\ZertoInfo\VMNicSettings.csv" -``` - -Exports VM Nic Settings for ALL Virtual Protection Groups to a file located at "C:\ZertoInfo\VMNicSettings.csv" - -### Example 2 -```powershell -PS C:\> Export-ZertoVmNicSetting -OutputFile "C:\ZertoInfo\VMNicSettings.csv" -VpgName "Exchange", "Support Forum" -``` - -Exports VM Nic Settings for Exchange and Support Forum Virtual Protection Groups to a file located at "C:\ZertoInfo\VMNicSettings.csv" - -## PARAMETERS - -### -OutputFile -Output file information - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -VpgName -Vpg(s) to export. If no VPG was named, all data will be exported. - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Export-ZertoVmNicSettings.md +schema: 2.0.0 +--- + +# Export-ZertoVmNicSetting + +## SYNOPSIS +Queries VPGs and associated Virtual Machines to export all protected virtual machine NIC settings to a Comma Separated Value (CSV) file. + +## SYNTAX + +``` +Export-ZertoVmNicSetting [[-VpgName] ] [-OutputFile] [] +``` + +## DESCRIPTION +Queries VPGs and associated Virtual Machines to export all protected virtual machine NIC settings to a Comma Separated Value (CSV) file. This file can be used with the Import-ZertoVmNicSetting function to bulk update. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Export-ZertoVmNicSetting -OutputFile "C:\ZertoInfo\VMNicSettings.csv" +``` + +Exports VM Nic Settings for ALL Virtual Protection Groups to a file located at "C:\ZertoInfo\VMNicSettings.csv" + +### Example 2 +```powershell +PS C:\> Export-ZertoVmNicSetting -OutputFile "C:\ZertoInfo\VMNicSettings.csv" -VpgName "Exchange", "Support Forum" +``` + +Exports VM Nic Settings for Exchange and Support Forum Virtual Protection Groups to a file located at "C:\ZertoInfo\VMNicSettings.csv" + +## PARAMETERS + +### -OutputFile +Output file information + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VpgName +Vpg(s) to export. If no VPG was named, all data will be exported. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/docs/Export-ZertoVpg.md b/docs/Export-ZertoVpg.md index 1f9f60f..8a1ee4c 100644 --- a/docs/Export-ZertoVpg.md +++ b/docs/Export-ZertoVpg.md @@ -89,7 +89,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZAAlert.md b/docs/Get-ZAAlert.md index 34a4e53..ae37647 100644 --- a/docs/Get-ZAAlert.md +++ b/docs/Get-ZAAlert.md @@ -1,125 +1,125 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAAlert.md -schema: 2.0.0 ---- - -# Get-ZAAlert - -## SYNOPSIS -Retrieve information about all existing alerts. - -## SYNTAX - -### zOrg (Default) -``` -Get-ZAAlert [-zOrgIdentifier ] [-limitTo ] [] -``` - -### alertId -``` -Get-ZAAlert -alertIdentifier [] -``` - -## DESCRIPTION -Retrieve information about all existing alerts. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAAlert -``` - -Returns all alerts. - -### Example 2 -```powershell -PS C:\> Get-ZAAlert -limitTo 10 -``` - -Returns 10 alerts. - -### Example 3 -```powershell -PS C:\> Get-ZAAlert -zOrgIdentifier "1234-5678-9012" -``` - -Returns all alerts for the zOrg with Identifier "1234-5678-9012". - -### Example 4 -```powershell -PS C:\> Get-ZAAlert -zOrgIdentifier "1234-5678-9012" -limitTo 10 -``` - -Returns 10 alerts for the zOrg with Identifier "1234-5678-9012". - -### Example 3 -```powershell -PS C:\> Get-ZAAlert -alertId "1234-5678-9012" -``` - -Returns one alert with identifier "1234-5678-9012". - -## PARAMETERS - -### -alertIdentifier -The VPG Idnetifier - -```yaml -Type: String -Parameter Sets: alertId -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -limitTo -The maximum number of alerts to return. - -```yaml -Type: Int32 -Parameter Sets: zOrg -Aliases: - -Required: False -Position: Named -Default value: 0 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -zOrgIdentifier -The ZORG identifier by which to filter the alert list. -If the ZORG identifier is omitted, a list of all the alerts is retrieved. - -```yaml -Type: String -Parameter Sets: zOrg -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Alerts](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_alerts) -[Zerto Analytics REST API Endpoint for Alerts by Identifier](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_alerts__alertIdentifier_) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAAlert.md +schema: 2.0.0 +--- + +# Get-ZAAlert + +## SYNOPSIS +Retrieve information about all existing alerts. + +## SYNTAX + +### zOrg (Default) +``` +Get-ZAAlert [-zOrgIdentifier ] [-limitTo ] [] +``` + +### alertId +``` +Get-ZAAlert -alertIdentifier [] +``` + +## DESCRIPTION +Retrieve information about all existing alerts. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAAlert +``` + +Returns all alerts. + +### Example 2 +```powershell +PS C:\> Get-ZAAlert -limitTo 10 +``` + +Returns 10 alerts. + +### Example 3 +```powershell +PS C:\> Get-ZAAlert -zOrgIdentifier "1234-5678-9012" +``` + +Returns all alerts for the zOrg with Identifier "1234-5678-9012". + +### Example 4 +```powershell +PS C:\> Get-ZAAlert -zOrgIdentifier "1234-5678-9012" -limitTo 10 +``` + +Returns 10 alerts for the zOrg with Identifier "1234-5678-9012". + +### Example 3 +```powershell +PS C:\> Get-ZAAlert -alertId "1234-5678-9012" +``` + +Returns one alert with identifier "1234-5678-9012". + +## PARAMETERS + +### -alertIdentifier +The VPG Idnetifier + +```yaml +Type: String +Parameter Sets: alertId +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -limitTo +The maximum number of alerts to return. + +```yaml +Type: Int32 +Parameter Sets: zOrg +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the alert list. +If the ZORG identifier is omitted, a list of all the alerts is retrieved. + +```yaml +Type: String +Parameter Sets: zOrg +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Alerts](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_alerts) +[Zerto Analytics REST API Endpoint for Alerts by Identifier](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_alerts__alertIdentifier_) diff --git a/docs/Get-ZADatastore.md b/docs/Get-ZADatastore.md index 73483fa..eb9f7f2 100644 --- a/docs/Get-ZADatastore.md +++ b/docs/Get-ZADatastore.md @@ -1,123 +1,123 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZATask.md -schema: 2.0.0 ---- - -# Get-ZADatastore - -## SYNOPSIS - -Get a list of datastore/s, filtered by site. Enter a site identifier only to get the list of all datastores. Enter a site identifier and cluster identifier to get a list of datastores in the cluster. Enter a site identifier and datastore identifier to get specific datastore info. - -## SYNTAX - -### AllInfo (Default) -``` -Get-ZADatastore -siteIdentifier [] -``` - -### datastore -``` -Get-ZADatastore -siteIdentifier -datastoreIdentifier [] -``` - -### cluster -``` -Get-ZADatastore -siteIdentifier -clusterIdentifier [] -``` - -## DESCRIPTION - -Get a list of datastore/s, filtered by site. Enter a site identifier only to get the list of all datastores. Enter a site identifier and cluster identifier to get a list of datastores in the cluster. Enter a site identifier and datastore identifier to get specific datastore info. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZADatastore -siteIdentifier "7890-1234-5678" -``` - -Returns all datastore clusters and datastores associated with site identifier "7890-1234-5678" - -### Example 2 -```powershell -PS C:\> Get-ZADatastore -siteIdentifier "7890-1234-5678" -clusterIdentifier "3456-7890-1234" -``` - -Returns datastore cluster information with identifier "3456-7890-1234" associated with site identifier "7890-1234-5678" - -### Example 3 -```powershell -PS C:\> Get-ZADatastore -siteIdentifier "7890-1234-5678" -datastoreIdentifier "5678-9012-3456" -``` - -Returns all datastore information with identifier "5678-9012-3456" associated with site identifier "7890-1234-5678" - -## PARAMETERS - -### -clusterIdentifier -The datastore cluster identifier. -Gets a list of datastores in the cluster. - -```yaml -Type: String -Parameter Sets: cluster -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -datastoreIdentifier -The datastore identifer. -Gets the datastore info. - -```yaml -Type: String -Parameter Sets: datastore -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -siteIdentifier -The site identifier. -The site identifier is mandatory. -Omit the datastore and datastore cluster identifiers to view site level storage information. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### None - -## OUTPUTS - -### System.Object -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Datastores](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_datastores) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZATask.md +schema: 2.0.0 +--- + +# Get-ZADatastore + +## SYNOPSIS + +Get a list of datastore/s, filtered by site. Enter a site identifier only to get the list of all datastores. Enter a site identifier and cluster identifier to get a list of datastores in the cluster. Enter a site identifier and datastore identifier to get specific datastore info. + +## SYNTAX + +### AllInfo (Default) +``` +Get-ZADatastore -siteIdentifier [] +``` + +### datastore +``` +Get-ZADatastore -siteIdentifier -datastoreIdentifier [] +``` + +### cluster +``` +Get-ZADatastore -siteIdentifier -clusterIdentifier [] +``` + +## DESCRIPTION + +Get a list of datastore/s, filtered by site. Enter a site identifier only to get the list of all datastores. Enter a site identifier and cluster identifier to get a list of datastores in the cluster. Enter a site identifier and datastore identifier to get specific datastore info. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZADatastore -siteIdentifier "7890-1234-5678" +``` + +Returns all datastore clusters and datastores associated with site identifier "7890-1234-5678" + +### Example 2 +```powershell +PS C:\> Get-ZADatastore -siteIdentifier "7890-1234-5678" -clusterIdentifier "3456-7890-1234" +``` + +Returns datastore cluster information with identifier "3456-7890-1234" associated with site identifier "7890-1234-5678" + +### Example 3 +```powershell +PS C:\> Get-ZADatastore -siteIdentifier "7890-1234-5678" -datastoreIdentifier "5678-9012-3456" +``` + +Returns all datastore information with identifier "5678-9012-3456" associated with site identifier "7890-1234-5678" + +## PARAMETERS + +### -clusterIdentifier +The datastore cluster identifier. +Gets a list of datastores in the cluster. + +```yaml +Type: String +Parameter Sets: cluster +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -datastoreIdentifier +The datastore identifer. +Gets the datastore info. + +```yaml +Type: String +Parameter Sets: datastore +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -siteIdentifier +The site identifier. +The site identifier is mandatory. +Omit the datastore and datastore cluster identifiers to view site level storage information. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Datastores](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_datastores) diff --git a/docs/Get-ZAEvent.md b/docs/Get-ZAEvent.md index 986c30c..eb6844a 100644 --- a/docs/Get-ZAEvent.md +++ b/docs/Get-ZAEvent.md @@ -1,140 +1,140 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAEvent.md -schema: 2.0.0 ---- - -# Get-ZAEvent - -## SYNOPSIS - -Retrieve details of all existing events. - -## SYNTAX - -``` -Get-ZAEvent [[-zOrgIdentifier] ] [[-category] ] [[-limitTo] ] [[-startDate] ] - [[-endDate] ] [] -``` - -## DESCRIPTION - -Retrieve details of all existing events. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAEvent -``` - -Retrieve details of all existing events. - -### Example 2 -```powershell -PS C:\> Get-ZAEvent -zOrgIdentifier "1234-5678-9012" -``` - -Retrieve details of all existing events for zOrg with Identifier "1234-5678-9012" - -### Example 3 -```powershell -PS C:\> Get-ZAEvent -category events -startDate "2019-03-01" -endDate "2019-04-01" -limitTo 400 -``` - -Retrieve details of all events between March 1st and April 1st and limit results to 400. - -## PARAMETERS - -### -category -The event category (events/alertsHistory). -Default displays the list of all. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -endDate -The latest timestamp of an event to return, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -Default is the present time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 5 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -limitTo -The maximum number of events to return. - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: 0 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The earliest timestamp of an event to return, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -Default is one year ago. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -zOrgIdentifier -The ZORG identifier by which to filter the user's events. -If the ZORG identifier is omitted, events is retrieved. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Events](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_events) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAEvent.md +schema: 2.0.0 +--- + +# Get-ZAEvent + +## SYNOPSIS + +Retrieve details of all existing events. + +## SYNTAX + +``` +Get-ZAEvent [[-zOrgIdentifier] ] [[-category] ] [[-limitTo] ] [[-startDate] ] + [[-endDate] ] [] +``` + +## DESCRIPTION + +Retrieve details of all existing events. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAEvent +``` + +Retrieve details of all existing events. + +### Example 2 +```powershell +PS C:\> Get-ZAEvent -zOrgIdentifier "1234-5678-9012" +``` + +Retrieve details of all existing events for zOrg with Identifier "1234-5678-9012" + +### Example 3 +```powershell +PS C:\> Get-ZAEvent -category events -startDate "2019-03-01" -endDate "2019-04-01" -limitTo 400 +``` + +Retrieve details of all events between March 1st and April 1st and limit results to 400. + +## PARAMETERS + +### -category +The event category (events/alertsHistory). +Default displays the list of all. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -endDate +The latest timestamp of an event to return, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +Default is the present time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -limitTo +The maximum number of events to return. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The earliest timestamp of an event to return, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +Default is one year ago. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the user's events. +If the ZORG identifier is omitted, events is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Events](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_events) diff --git a/docs/Get-ZAJournalAverageHistory.md b/docs/Get-ZAJournalAverageHistory.md index 42ee2f3..ee375b9 100644 --- a/docs/Get-ZAJournalAverageHistory.md +++ b/docs/Get-ZAJournalAverageHistory.md @@ -1,123 +1,123 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalAverageHistory.md -schema: 2.0.0 ---- - -# Get-ZAJournalAverageHistory - -## SYNOPSIS - -Retrieves the list of historical average journal history values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. - -## SYNTAX - -``` -Get-ZAJournalAverageHistory [-vpgIdentifier] [[-startDate] ] [[-endDate] ] - [[-interval] ] [] -``` - -## DESCRIPTION - -Retrieves the list of historical average journal history values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAJournalAverageHistory -vpgIdentifier "9876-5432-1098" -``` - -Returns Journal Average History information for VPG with identifier "9876-5432-1098" - -### Example 2 -```powershell -PS C:\> Get-ZAJournalAverageHistory -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -``` - -Returns Journal Average History for VPG with identifier "9876-5432-1098" between the dates specified. - -### Example 3 -```powershell -PS C:\> Get-ZAJournalAverageHistory -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 -``` - -Returns Journal Average History for VPG with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -interval -The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: 0 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The identifier of the VPG. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Journal Average History](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_history_average) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalAverageHistory.md +schema: 2.0.0 +--- + +# Get-ZAJournalAverageHistory + +## SYNOPSIS + +Retrieves the list of historical average journal history values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## SYNTAX + +``` +Get-ZAJournalAverageHistory [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Retrieves the list of historical average journal history values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalAverageHistory -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal Average History information for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalAverageHistory -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Average History for VPG with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalAverageHistory -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Average History for VPG with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Average History](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_history_average) diff --git a/docs/Get-ZAJournalAverageSize.md b/docs/Get-ZAJournalAverageSize.md index 15db2a0..d7d4287 100644 --- a/docs/Get-ZAJournalAverageSize.md +++ b/docs/Get-ZAJournalAverageSize.md @@ -1,123 +1,123 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalAverageSize.md -schema: 2.0.0 ---- - -# Get-ZAJournalAverageSize - -## SYNOPSIS - -Retrieves the list of historical average journal storage values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the journal storage samples interval. - -## SYNTAX - -``` -Get-ZAJournalAverageSize [-vpgIdentifier] [[-startDate] ] [[-endDate] ] - [[-interval] ] [] -``` - -## DESCRIPTION - -Retrieves the list of historical average journal storage values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the journal storage samples interval. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAJournalAverageSize -vpgIdentifier "9876-5432-1098" -``` - -Returns Journal Average Size information for VPG with identifier "9876-5432-1098" - -### Example 2 -```powershell -PS C:\> Get-ZAJournalAverageSize -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -``` - -Returns Journal Average Size for VPG with identifier "9876-5432-1098" between the dates specified. - -### Example 3 -```powershell -PS C:\> Get-ZAJournalAverageSize -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 -``` - -Returns Journal Average Size for VPG with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -interval -The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: 0 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The identifier of the VPG. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Journal Average Size](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_size_average) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalAverageSize.md +schema: 2.0.0 +--- + +# Get-ZAJournalAverageSize + +## SYNOPSIS + +Retrieves the list of historical average journal storage values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the journal storage samples interval. + +## SYNTAX + +``` +Get-ZAJournalAverageSize [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Retrieves the list of historical average journal storage values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the journal storage samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalAverageSize -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal Average Size information for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalAverageSize -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Average Size for VPG with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalAverageSize -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Average Size for VPG with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Average Size](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_size_average) diff --git a/docs/Get-ZAJournalBreach.md b/docs/Get-ZAJournalBreach.md index 12d008d..fb8c6ed 100644 --- a/docs/Get-ZAJournalBreach.md +++ b/docs/Get-ZAJournalBreach.md @@ -1,101 +1,101 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalBreach.md -schema: 2.0.0 ---- - -# Get-ZAJournalBreach - -## SYNOPSIS - -Retrieves the journal history breaches over the selected timeframe. - -## SYNTAX - -``` -Get-ZAJournalBreach [-vpgIdentifier] [[-startDate] ] [[-endDate] ] - [] -``` - -## DESCRIPTION - -Retrieves the journal history breaches over the selected timeframe. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAJournalBreach -vpgIdentifier "9876-5432-1098" -``` - -Returns Journal Breach information for VPG with identifier "9876-5432-1098" - -### Example 2 -```powershell -PS C:\> Get-ZAJournalBreach -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -``` - -Returns Journal Breach information for VPG with identifier "9876-5432-1098" between the dates specified. - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The identifier of the VPG. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Journal Breach](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_breach) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalBreach.md +schema: 2.0.0 +--- + +# Get-ZAJournalBreach + +## SYNOPSIS + +Retrieves the journal history breaches over the selected timeframe. + +## SYNTAX + +``` +Get-ZAJournalBreach [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves the journal history breaches over the selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalBreach -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal Breach information for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalBreach -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Breach information for VPG with identifier "9876-5432-1098" between the dates specified. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Breach](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_breach) diff --git a/docs/Get-ZAJournalHistoryStat.md b/docs/Get-ZAJournalHistoryStat.md index e79255a..679acaf 100644 --- a/docs/Get-ZAJournalHistoryStat.md +++ b/docs/Get-ZAJournalHistoryStat.md @@ -1,101 +1,101 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalHistoryStat.md -schema: 2.0.0 ---- - -# Get-ZAJournalHistoryStat - -## SYNOPSIS - -Retrieves Journal history min, max and avg Statistics over the selected timeframe. - -## SYNTAX - -``` -Get-ZAJournalHistoryStat [-vpgIdentifier] [[-startDate] ] [[-endDate] ] - [] -``` - -## DESCRIPTION - -Retrieves Journal history min, max and avg Statistics over the selected timeframe. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAJournalHistoryStat -vpgIdentifier "9876-5432-1098" -``` - -Returns Journal History Stats for VPG with identifier "9876-5432-1098" - -### Example 2 -```powershell -PS C:\> Get-ZAJournalHistoryStat -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -``` - -Returns Journal History Stats for VPG with identifier "9876-5432-1098" between the dates specified. - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The identifier of the VPG. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Journal History Stats](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_stats_journal_history) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalHistoryStat.md +schema: 2.0.0 +--- + +# Get-ZAJournalHistoryStat + +## SYNOPSIS + +Retrieves Journal history min, max and avg Statistics over the selected timeframe. + +## SYNTAX + +``` +Get-ZAJournalHistoryStat [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves Journal history min, max and avg Statistics over the selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalHistoryStat -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal History Stats for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalHistoryStat -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal History Stats for VPG with identifier "9876-5432-1098" between the dates specified. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal History Stats](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_stats_journal_history) diff --git a/docs/Get-ZAJournalSiteAverageHistory.md b/docs/Get-ZAJournalSiteAverageHistory.md index 75bf268..38fc79f 100644 --- a/docs/Get-ZAJournalSiteAverageHistory.md +++ b/docs/Get-ZAJournalSiteAverageHistory.md @@ -1,123 +1,123 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteAverageHistory.md -schema: 2.0.0 ---- - -# Get-ZAJournalSiteAverageHistory - -## SYNOPSIS - -Get list of samples of average Journal History values for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the Journal History samples interval. - -## SYNTAX - -``` -Get-ZAJournalSiteAverageHistory [-recoverySiteIdentifier] [[-startDate] ] - [[-endDate] ] [[-interval] ] [] -``` - -## DESCRIPTION - -Get list of samples of average Journal History values for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the Journal History samples interval. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAJournalSiteAverageHistory -recoverySiteIdentifier "9876-5432-1098" -``` - -Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" - -### Example 2 -```powershell -PS C:\> Get-ZAJournalSiteAverageHistory -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -``` - -Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified. - -### Example 3 -```powershell -PS C:\> Get-ZAJournalSiteAverageHistory -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 -``` - -Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -interval -The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: 0 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -recoverySiteIdentifier -The identifier of the recovery site. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Journal Average Site History](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_history_average) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteAverageHistory.md +schema: 2.0.0 +--- + +# Get-ZAJournalSiteAverageHistory + +## SYNOPSIS + +Get list of samples of average Journal History values for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the Journal History samples interval. + +## SYNTAX + +``` +Get-ZAJournalSiteAverageHistory [-recoverySiteIdentifier] [[-startDate] ] + [[-endDate] ] [[-interval] ] [] +``` + +## DESCRIPTION + +Get list of samples of average Journal History values for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the Journal History samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalSiteAverageHistory -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalSiteAverageHistory -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalSiteAverageHistory -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +The identifier of the recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Average Site History](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_history_average) diff --git a/docs/Get-ZAJournalSiteAverageSize.md b/docs/Get-ZAJournalSiteAverageSize.md index 128bcbd..65b78a6 100644 --- a/docs/Get-ZAJournalSiteAverageSize.md +++ b/docs/Get-ZAJournalSiteAverageSize.md @@ -1,123 +1,123 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteAverageSize.md -schema: 2.0.0 ---- - -# Get-ZAJournalSiteAverageSize - -## SYNOPSIS - -Get list of samples of total Journal Size of all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the Journal Size samples interval. - -## SYNTAX - -``` -Get-ZAJournalSiteAverageSize [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] - [[-interval] ] [] -``` - -## DESCRIPTION - -Get list of samples of total Journal Size of all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the Journal Size samples interval. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAJournalSiteAverageSize -recoverySiteIdentifier "9876-5432-1098" -``` - -Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" - -### Example 2 -```powershell -PS C:\> Get-ZAJournalSiteAverageSize -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -``` - -Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" between the dates specified. - -### Example 3 -```powershell -PS C:\> Get-ZAJournalSiteAverageSize -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 -``` - -Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -interval -The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: 0 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -recoverySiteIdentifier -The identifier of the recovery Site. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Journal Average Site Size](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_size_average) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteAverageSize.md +schema: 2.0.0 +--- + +# Get-ZAJournalSiteAverageSize + +## SYNOPSIS + +Get list of samples of total Journal Size of all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the Journal Size samples interval. + +## SYNTAX + +``` +Get-ZAJournalSiteAverageSize [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get list of samples of total Journal Size of all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the Journal Size samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalSiteAverageSize -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalSiteAverageSize -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalSiteAverageSize -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Average Size information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +The identifier of the recovery Site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Average Site Size](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_size_average) diff --git a/docs/Get-ZAJournalSiteHistoryStat.md b/docs/Get-ZAJournalSiteHistoryStat.md index 3d3ba58..b2573fe 100644 --- a/docs/Get-ZAJournalSiteHistoryStat.md +++ b/docs/Get-ZAJournalSiteHistoryStat.md @@ -1,123 +1,123 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteHistoryStat.md -schema: 2.0.0 ---- - -# Get-ZAJournalSiteHistoryStat - -## SYNOPSIS - -Get Max, Avg. and Min Journal History statistics for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. - -## SYNTAX - -``` -Get-ZAJournalSiteHistoryStat [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] - [[-interval] ] [] -``` - -## DESCRIPTION - -Get Max, Avg. and Min Journal History statistics for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAJournalSiteHistoryStat -recoverySiteIdentifier "9876-5432-1098" -``` - -Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" - -### Example 2 -```powershell -PS C:\> Get-ZAJournalSiteHistoryStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -``` - -Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified. - -### Example 3 -```powershell -PS C:\> Get-ZAJournalSiteHistoryStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 -``` - -Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -interval -The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: 0 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -recoverySiteIdentifier -The identifier of the recovery site. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Journal Site History Stats](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_history_stats) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteHistoryStat.md +schema: 2.0.0 +--- + +# Get-ZAJournalSiteHistoryStat + +## SYNOPSIS + +Get Max, Avg. and Min Journal History statistics for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## SYNTAX + +``` +Get-ZAJournalSiteHistoryStat [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get Max, Avg. and Min Journal History statistics for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalSiteHistoryStat -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalSiteHistoryStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalSiteHistoryStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Average History information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +The identifier of the recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Site History Stats](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_history_stats) diff --git a/docs/Get-ZAJournalSiteHistorySummary.md b/docs/Get-ZAJournalSiteHistorySummary.md index c9d4fb4..9f275d5 100644 --- a/docs/Get-ZAJournalSiteHistorySummary.md +++ b/docs/Get-ZAJournalSiteHistorySummary.md @@ -1,123 +1,123 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteHistorySummary.md -schema: 2.0.0 ---- - -# Get-ZAJournalSiteHistorySummary - -## SYNOPSIS - -Get a Journal History executive summary for all VPGs replicating to a specified recovery site. - -## SYNTAX - -``` -Get-ZAJournalSiteHistorySummary [-recoverySiteIdentifier] [[-startDate] ] - [[-endDate] ] [[-interval] ] [] -``` - -## DESCRIPTION - -Get a Journal History executive summary for all VPGs replicating to a specified recovery site. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAJournalSiteHistorySummary -recoverySiteIdentifier "9876-5432-1098" -``` - -Returns Journal History Executive Summary information for the recovery site with identifier "9876-5432-1098" - -### Example 2 -```powershell -PS C:\> Get-ZAJournalSiteHistorySummary -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -``` - -Returns Journal History Executive Summary information for the recovery site with identifier "9876-5432-1098" between the dates specified. - -### Example 3 -```powershell -PS C:\> Get-ZAJournalSiteHistorySummary -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 -``` - -Returns Journal History Executive Summary information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -interval -The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: 0 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -recoverySiteIdentifier -The identifier of the recovery site. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Journal Site History Summary](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_history_summary) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteHistorySummary.md +schema: 2.0.0 +--- + +# Get-ZAJournalSiteHistorySummary + +## SYNOPSIS + +Get a Journal History executive summary for all VPGs replicating to a specified recovery site. + +## SYNTAX + +``` +Get-ZAJournalSiteHistorySummary [-recoverySiteIdentifier] [[-startDate] ] + [[-endDate] ] [[-interval] ] [] +``` + +## DESCRIPTION + +Get a Journal History executive summary for all VPGs replicating to a specified recovery site. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalSiteHistorySummary -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns Journal History Executive Summary information for the recovery site with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalSiteHistorySummary -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal History Executive Summary information for the recovery site with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalSiteHistorySummary -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal History Executive Summary information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +The identifier of the recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Site History Summary](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_history_summary) diff --git a/docs/Get-ZAJournalSiteSizeStat.md b/docs/Get-ZAJournalSiteSizeStat.md index eefff97..4f3244c 100644 --- a/docs/Get-ZAJournalSiteSizeStat.md +++ b/docs/Get-ZAJournalSiteSizeStat.md @@ -1,123 +1,123 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteSizeStat.md -schema: 2.0.0 ---- - -# Get-ZAJournalSiteSizeStat - -## SYNOPSIS - -Get Max, Avg. and Min of total Journal Size statistics for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. - -## SYNTAX - -``` -Get-ZAJournalSiteSizeStat [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] - [[-interval] ] [] -``` - -## DESCRIPTION - -Get Max, Avg. and Min of total Journal Size statistics for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAJournalSiteSizeStat -recoverySiteIdentifier "9876-5432-1098" -``` - -Returns Journal Size Statistics information for the recovery site with identifier "9876-5432-1098" - -### Example 2 -```powershell -PS C:\> Get-ZAJournalSiteSizeStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -``` - -Returns Journal Size Statistics information for the recovery site with identifier "9876-5432-1098" between the dates specified. - -### Example 3 -```powershell -PS C:\> Get-ZAJournalSiteSizeStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 -``` - -Returns Journal Size Statistics information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -interval -The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: 0 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -recoverySiteIdentifier -The identifier of the recovery site. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Journal Site size Stats](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_size_stats) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSiteSizeStat.md +schema: 2.0.0 +--- + +# Get-ZAJournalSiteSizeStat + +## SYNOPSIS + +Get Max, Avg. and Min of total Journal Size statistics for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## SYNTAX + +``` +Get-ZAJournalSiteSizeStat [-recoverySiteIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get Max, Avg. and Min of total Journal Size statistics for all VPGs replicating to a specified recovery site, filtered by start date, end date, and optional interval. The interval defines the journal history samples interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalSiteSizeStat -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns Journal Size Statistics information for the recovery site with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalSiteSizeStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Size Statistics information for the recovery site with identifier "9876-5432-1098" between the dates specified. + +### Example 3 +```powershell +PS C:\> Get-ZAJournalSiteSizeStat -recoverySiteIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -interval 7200 +``` + +Returns Journal Size Statistics information for the recovery site with identifier "9876-5432-1098" between the dates specified with a 2 hour interval. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +The identifier of the recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Site size Stats](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_site_journal_size_stats) diff --git a/docs/Get-ZAJournalStatusProportion.md b/docs/Get-ZAJournalStatusProportion.md index 3db7a5d..479cf9a 100644 --- a/docs/Get-ZAJournalStatusProportion.md +++ b/docs/Get-ZAJournalStatusProportion.md @@ -1,101 +1,101 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalStatusProportion.md -schema: 2.0.0 ---- - -# Get-ZAJournalStatusProportion - -## SYNOPSIS - -Retrieves journal history SLA status distribution over selected timeframe. - -## SYNTAX - -``` -Get-ZAJournalStatusProportion [-vpgIdentifier] [[-startDate] ] [[-endDate] ] - [] -``` - -## DESCRIPTION - -Retrieves journal history SLA status distribution over selected timeframe. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAJournalStatusProportion -vpgIdentifier "9876-5432-1098" -``` - -Returns Journal history SLA status distribution for VPG with identifier "9876-5432-1098" - -### Example 2 -```powershell -PS C:\> Get-ZAJournalStatusProportion -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -``` - -Returns Journalhistory SLA status distribution for VPG with identifier "9876-5432-1098" between the dates specified. - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The identifier of the VPG. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Journal Statuses Proportions](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_statuses_proportions) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalStatusProportion.md +schema: 2.0.0 +--- + +# Get-ZAJournalStatusProportion + +## SYNOPSIS + +Retrieves journal history SLA status distribution over selected timeframe. + +## SYNTAX + +``` +Get-ZAJournalStatusProportion [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves journal history SLA status distribution over selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalStatusProportion -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal history SLA status distribution for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalStatusProportion -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journalhistory SLA status distribution for VPG with identifier "9876-5432-1098" between the dates specified. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Statuses Proportions](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_statuses_proportions) diff --git a/docs/Get-ZAJournalStorageStat.md b/docs/Get-ZAJournalStorageStat.md index 5022411..5467598 100644 --- a/docs/Get-ZAJournalStorageStat.md +++ b/docs/Get-ZAJournalStorageStat.md @@ -1,101 +1,101 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalStorageStat.md -schema: 2.0.0 ---- - -# Get-ZAJournalStorageStat - -## SYNOPSIS - -Retrieves Journal Storage minimum, maximum and average. Statistics over the selected timeframe. - -## SYNTAX - -``` -Get-ZAJournalStorageStat [-vpgIdentifier] [[-startDate] ] [[-endDate] ] - [] -``` - -## DESCRIPTION - -Retrieves Journal Storage minimum, maximum and average. Statistics over the selected timeframe. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAJournalStorageStat -vpgIdentifier "9876-5432-1098" -``` - -Returns Journal Storage Stats for VPG with identifier "9876-5432-1098" - -### Example 2 -```powershell -PS C:\> Get-ZAJournalStorageStat -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -``` - -Returns Journal Storage Stats for VPG with identifier "9876-5432-1098" between the dates specified. - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The identifier of the VPG. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Journal Storage Stats](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_stats_journal_storage) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalStorageStat.md +schema: 2.0.0 +--- + +# Get-ZAJournalStorageStat + +## SYNOPSIS + +Retrieves Journal Storage minimum, maximum and average. Statistics over the selected timeframe. + +## SYNTAX + +``` +Get-ZAJournalStorageStat [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves Journal Storage minimum, maximum and average. Statistics over the selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalStorageStat -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal Storage Stats for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalStorageStat -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Storage Stats for VPG with identifier "9876-5432-1098" between the dates specified. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Storage Stats](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_stats_journal_storage) diff --git a/docs/Get-ZAJournalSummary.md b/docs/Get-ZAJournalSummary.md index aadfbad..0a7df27 100644 --- a/docs/Get-ZAJournalSummary.md +++ b/docs/Get-ZAJournalSummary.md @@ -1,101 +1,101 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSummary.md -schema: 2.0.0 ---- - -# Get-ZAJournalSummary - -## SYNOPSIS - -Retrieves journal historical statistics for a given VPG. - -## SYNTAX - -``` -Get-ZAJournalSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] - [] -``` - -## DESCRIPTION - -Retrieves journal historical statistics for a given VPG. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAJournalSummary -vpgIdentifier "9876-5432-1098" -``` - -Returns Journal Summary information for VPG with identifier "9876-5432-1098" - -### Example 2 -```powershell -PS C:\> Get-ZAJournalSummary -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" -``` - -Returns Journal Summary information for VPG with identifier "9876-5432-1098" between the dates specified. - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The identifier of the VPG. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Journal Summary](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_summary) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAJournalSummary.md +schema: 2.0.0 +--- + +# Get-ZAJournalSummary + +## SYNOPSIS + +Retrieves journal historical statistics for a given VPG. + +## SYNTAX + +``` +Get-ZAJournalSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves journal historical statistics for a given VPG. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAJournalSummary -vpgIdentifier "9876-5432-1098" +``` + +Returns Journal Summary information for VPG with identifier "9876-5432-1098" + +### Example 2 +```powershell +PS C:\> Get-ZAJournalSummary -vpgIdentifier "9876-5432-1098" -startDate "2019-06-01" -endDate "2019-06-08" +``` + +Returns Journal Summary information for VPG with identifier "9876-5432-1098" between the dates specified. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Journal Summary](https://docs.api.zerto.com/#/Journal_Reports/get_v2_reports_journal_summary) diff --git a/docs/Get-ZALicense.md b/docs/Get-ZALicense.md index a95d1f9..5e8c16b 100644 --- a/docs/Get-ZALicense.md +++ b/docs/Get-ZALicense.md @@ -1,45 +1,45 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZALicense.md -schema: 2.0.0 ---- - -# Get-ZALicense - -## SYNOPSIS - -Retrieve a list of all licenses. - -## SYNTAX - -``` -Get-ZALicense [] -``` - -## DESCRIPTION -Retrieve a list of all licenses. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZALicense -``` - -Returns all licenses and associated information - -## PARAMETERS - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API License End Point Documentation](https://docs.api.zerto.com/#/Licenses/get_v2_licenses) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZALicense.md +schema: 2.0.0 +--- + +# Get-ZALicense + +## SYNOPSIS + +Retrieve a list of all licenses. + +## SYNTAX + +``` +Get-ZALicense [] +``` + +## DESCRIPTION +Retrieve a list of all licenses. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZALicense +``` + +Returns all licenses and associated information + +## PARAMETERS + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API License End Point Documentation](https://docs.api.zerto.com/#/Licenses/get_v2_licenses) diff --git a/docs/Get-ZAMonitoring.md b/docs/Get-ZAMonitoring.md index a4ee8e8..8e7b71c 100644 --- a/docs/Get-ZAMonitoring.md +++ b/docs/Get-ZAMonitoring.md @@ -1,69 +1,69 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAMonitoring.md -schema: 2.0.0 ---- - -# Get-ZAMonitoring - -## SYNOPSIS - -Retrieve statistics related to all the user's sites - belonging to a single account. - -## SYNTAX - -``` -Get-ZAMonitoring [[-zOrgIdentifier] ] [] -``` - -## DESCRIPTION - -Retrieve statistics related to all the user's sites - belonging to a single account. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAMonitoring -``` - -Retrieve statistics related to all the user's sites - belonging to a single account. - -### Example 1 -```powershell -PS C:\> Get-ZAMonitoring -zOrgIdentifier "1234-5678-9012" -``` - -Retrieve statistics related to the zOrgIdentifier provided - -## PARAMETERS - -### -zOrgIdentifier -The ZORG identifier by which to filter the user's statistics for a single account. -If the ZORG identifier is omitted, statistics related to all sites, for a single account, is retrieved. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Monitoring](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAMonitoring.md +schema: 2.0.0 +--- + +# Get-ZAMonitoring + +## SYNOPSIS + +Retrieve statistics related to all the user's sites - belonging to a single account. + +## SYNTAX + +``` +Get-ZAMonitoring [[-zOrgIdentifier] ] [] +``` + +## DESCRIPTION + +Retrieve statistics related to all the user's sites - belonging to a single account. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAMonitoring +``` + +Retrieve statistics related to all the user's sites - belonging to a single account. + +### Example 1 +```powershell +PS C:\> Get-ZAMonitoring -zOrgIdentifier "1234-5678-9012" +``` + +Retrieve statistics related to the zOrgIdentifier provided + +## PARAMETERS + +### -zOrgIdentifier +The ZORG identifier by which to filter the user's statistics for a single account. +If the ZORG identifier is omitted, statistics related to all sites, for a single account, is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Monitoring](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_) diff --git a/docs/Get-ZANetworkSiteAverageIOPS.md b/docs/Get-ZANetworkSiteAverageIOPS.md index 947c371..c341554 100644 --- a/docs/Get-ZANetworkSiteAverageIOPS.md +++ b/docs/Get-ZANetworkSiteAverageIOPS.md @@ -1,183 +1,183 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkSiteAverageIOPS.md -schema: 2.0.0 ---- - -# Get-ZANetworkSiteAverageIOPS - -## SYNOPSIS - -Get average and maximum IOPS performance for sites, filtered by start date and end date, and optional intervals. - -## SYNTAX - -### ProtectedSite (Default) -``` -Get-ZANetworkSiteAverageIOPS -protectedSiteIdentifier [-recoverySiteIdentifier ] - [-startDate ] [-endDate ] [-zOrgIdentifier ] [-interval ] [] -``` - -### RecoverySite -``` -Get-ZANetworkSiteAverageIOPS [-protectedSiteIdentifier ] -recoverySiteIdentifier - [-startDate ] [-endDate ] [-zOrgIdentifier ] [-interval ] [] -``` - -## DESCRIPTION - -Get average and maximum IOPS performance for sites, filtered by start date and end date, and optional intervals. -The following options are available: - -* To view average and maximum IOPS performance of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. -* To view average and maximum IOPS performance between two sites, specify both the protected site identifier and the recovery site identifier. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZANetworkSiteAverageIOPS -protectedSiteIdentifier "7890-1234-5678" -``` - -Returns outgoing networks IOPS average from site with identifier "7890-1234-5678" - -### Example 2 -```powershell -PS C:\> Get-ZANetworkSiteAverageIOPS -protectedSiteIdentifier "7890-1234-5678" -recoverySiteIdentifier "9876-5432-1098" -``` - -Returns network IOPS average between sites with identifiers "7890-1234-5678" and "9876-5432-1098" - -## PARAMETERS - -### -endDate -End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the end date is omitted, the default end date is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -interval -The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: 0 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -protectedSiteIdentifier -Protected site identifier. -A site identification is required for at least one of the sites. - -```yaml -Type: String -Parameter Sets: ProtectedSite -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -```yaml -Type: String -Parameter Sets: RecoverySite -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -recoverySiteIdentifier -Recovery site identifier. -If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites. - -```yaml -Type: String -Parameter Sets: ProtectedSite -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -```yaml -Type: String -Parameter Sets: RecoverySite -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the start date is omitted, the default start date is 7 days before the end date. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -zOrgIdentifier -The ZORG identifier by which to filter the executive summary. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Network Site Average IOPS](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_network_iops_average) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkSiteAverageIOPS.md +schema: 2.0.0 +--- + +# Get-ZANetworkSiteAverageIOPS + +## SYNOPSIS + +Get average and maximum IOPS performance for sites, filtered by start date and end date, and optional intervals. + +## SYNTAX + +### ProtectedSite (Default) +``` +Get-ZANetworkSiteAverageIOPS -protectedSiteIdentifier [-recoverySiteIdentifier ] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [-interval ] [] +``` + +### RecoverySite +``` +Get-ZANetworkSiteAverageIOPS [-protectedSiteIdentifier ] -recoverySiteIdentifier + [-startDate ] [-endDate ] [-zOrgIdentifier ] [-interval ] [] +``` + +## DESCRIPTION + +Get average and maximum IOPS performance for sites, filtered by start date and end date, and optional intervals. +The following options are available: + +* To view average and maximum IOPS performance of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. +* To view average and maximum IOPS performance between two sites, specify both the protected site identifier and the recovery site identifier. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkSiteAverageIOPS -protectedSiteIdentifier "7890-1234-5678" +``` + +Returns outgoing networks IOPS average from site with identifier "7890-1234-5678" + +### Example 2 +```powershell +PS C:\> Get-ZANetworkSiteAverageIOPS -protectedSiteIdentifier "7890-1234-5678" -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns network IOPS average between sites with identifiers "7890-1234-5678" and "9876-5432-1098" + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -protectedSiteIdentifier +Protected site identifier. +A site identification is required for at least one of the sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +Recovery site identifier. +If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the executive summary. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network Site Average IOPS](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_network_iops_average) diff --git a/docs/Get-ZANetworkSiteAveragePerformance.md b/docs/Get-ZANetworkSiteAveragePerformance.md index 7c03484..effcce6 100644 --- a/docs/Get-ZANetworkSiteAveragePerformance.md +++ b/docs/Get-ZANetworkSiteAveragePerformance.md @@ -1,183 +1,183 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkSiteAveragePerformance.md -schema: 2.0.0 ---- - -# Get-ZANetworkSiteAveragePerformance - -## SYNOPSIS - -Get list of samples of average and maximum network performance metrics (throughput and WAN traffic) for sites, filtered by start date and end date, and optional intervals. - -## SYNTAX - -### ProtectedSite (Default) -``` -Get-ZANetworkSiteAveragePerformance -protectedSiteIdentifier [-recoverySiteIdentifier ] - [-startDate ] [-endDate ] [-zOrgIdentifier ] [-interval ] [] -``` - -### RecoverySite -``` -Get-ZANetworkSiteAveragePerformance [-protectedSiteIdentifier ] -recoverySiteIdentifier - [-startDate ] [-endDate ] [-zOrgIdentifier ] [-interval ] [] -``` - -## DESCRIPTION - -Get list of samples of average and maximum network performance metrics (throughput and WAN traffic) for sites, filtered by start date and end date, and optional intervals. -The following options are available: - -* To view average and maximum network performance of throughput vs. WAN traffic of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. -* To view average and maximum network performance of throughput and WAN traffic between two sites, specify both the protected site identifier and the recovery site identifier. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZANetworkSiteAveragePerformance -protectedSiteIdentifier "7890-1234-5678" -``` - -Returns outgoing networks performance average from site with identifier "7890-1234-5678" - -### Example 2 -```powershell -PS C:\> Get-ZANetworkSiteAveragePerformance -protectedSiteIdentifier "7890-1234-5678" -recoverySiteIdentifier "9876-5432-1098" -``` - -Returns network performance average between sites with identifiers "7890-1234-5678" and "9876-5432-1098" - -## PARAMETERS - -### -endDate -End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the end date is omitted, the default end date is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -interval -The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: 0 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -protectedSiteIdentifier -Protected site identifier. -A site identification is required for at least one of the sites. - -```yaml -Type: String -Parameter Sets: ProtectedSite -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -```yaml -Type: String -Parameter Sets: RecoverySite -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -recoverySiteIdentifier -Recovery site identifier. -If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites. - -```yaml -Type: String -Parameter Sets: ProtectedSite -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -```yaml -Type: String -Parameter Sets: RecoverySite -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the start date is omitted, the default start date is 7 days before the end date. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -zOrgIdentifier -The ZORG identifier by which to filter the executive summary. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Network Site Average Performance](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_network_performance_average) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkSiteAveragePerformance.md +schema: 2.0.0 +--- + +# Get-ZANetworkSiteAveragePerformance + +## SYNOPSIS + +Get list of samples of average and maximum network performance metrics (throughput and WAN traffic) for sites, filtered by start date and end date, and optional intervals. + +## SYNTAX + +### ProtectedSite (Default) +``` +Get-ZANetworkSiteAveragePerformance -protectedSiteIdentifier [-recoverySiteIdentifier ] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [-interval ] [] +``` + +### RecoverySite +``` +Get-ZANetworkSiteAveragePerformance [-protectedSiteIdentifier ] -recoverySiteIdentifier + [-startDate ] [-endDate ] [-zOrgIdentifier ] [-interval ] [] +``` + +## DESCRIPTION + +Get list of samples of average and maximum network performance metrics (throughput and WAN traffic) for sites, filtered by start date and end date, and optional intervals. +The following options are available: + +* To view average and maximum network performance of throughput vs. WAN traffic of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. +* To view average and maximum network performance of throughput and WAN traffic between two sites, specify both the protected site identifier and the recovery site identifier. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkSiteAveragePerformance -protectedSiteIdentifier "7890-1234-5678" +``` + +Returns outgoing networks performance average from site with identifier "7890-1234-5678" + +### Example 2 +```powershell +PS C:\> Get-ZANetworkSiteAveragePerformance -protectedSiteIdentifier "7890-1234-5678" -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns network performance average between sites with identifiers "7890-1234-5678" and "9876-5432-1098" + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per hour, for up to 15 days' time frame or per day, for between 15 to 30 days' time frame. Submit value in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -protectedSiteIdentifier +Protected site identifier. +A site identification is required for at least one of the sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +Recovery site identifier. +If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the executive summary. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network Site Average Performance](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_network_performance_average) diff --git a/docs/Get-ZANetworkSiteStat.md b/docs/Get-ZANetworkSiteStat.md index c07a784..ba37894 100644 --- a/docs/Get-ZANetworkSiteStat.md +++ b/docs/Get-ZANetworkSiteStat.md @@ -1,167 +1,167 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAMonitoring.md -schema: 2.0.0 ---- - -# Get-ZANetworkSiteStat - -## SYNOPSIS - -Get Max, Avg. and Min network statistics for Throughput, Wan and IOPS traffic for sites, filtered by start date and end date. - -## SYNTAX - -### ProtectedSite (Default) -``` -Get-ZANetworkSiteStat -protectedSiteIdentifier [-recoverySiteIdentifier ] - [-startDate ] [-endDate ] [-zOrgIdentifier ] [] -``` - -### RecoverySite -``` -Get-ZANetworkSiteStat [-protectedSiteIdentifier ] -recoverySiteIdentifier - [-startDate ] [-endDate ] [-zOrgIdentifier ] [] -``` - -## DESCRIPTION - -Get Max, Avg. and Min network statistics for Throughput, Wan and IOPS traffic for sites, filtered by start date and end date. The following options are available: - -* To view network stats of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. -* To view network stats between two sites, specify both the protected site identifier and the recovery site identifier. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZANetworkSiteStat -protectedSiteIdentifier "7890-1234-5678" -``` - -Returns all outgoing networks stats from site with identifier "7890-1234-5678" - -### Example 2 -```powershell -PS C:\> Get-ZANetworkSiteStat -protectedSiteIdentifier "7890-1234-5678" -recoverySiteIdentifier "9876-5432-1098" -``` - -Returns all networks stats between sites with identifiers "7890-1234-5678" and "9876-5432-1098" - -## PARAMETERS - -### -endDate -End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the end date is omitted, the default end date is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -protectedSiteIdentifier -Protected site identifier. -A site identification is required for at least one of the sites. - -```yaml -Type: String -Parameter Sets: ProtectedSite -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -```yaml -Type: String -Parameter Sets: RecoverySite -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -recoverySiteIdentifier -Recovery site identifier. -If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites. - -```yaml -Type: String -Parameter Sets: ProtectedSite -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -```yaml -Type: String -Parameter Sets: RecoverySite -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the start date is omitted, the default start date is 7 days before the end date. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -zOrgIdentifier -The ZORG identifier by which to filter the executive summary. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Network Site Summary](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_network_stats) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAMonitoring.md +schema: 2.0.0 +--- + +# Get-ZANetworkSiteStat + +## SYNOPSIS + +Get Max, Avg. and Min network statistics for Throughput, Wan and IOPS traffic for sites, filtered by start date and end date. + +## SYNTAX + +### ProtectedSite (Default) +``` +Get-ZANetworkSiteStat -protectedSiteIdentifier [-recoverySiteIdentifier ] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +### RecoverySite +``` +Get-ZANetworkSiteStat [-protectedSiteIdentifier ] -recoverySiteIdentifier + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +## DESCRIPTION + +Get Max, Avg. and Min network statistics for Throughput, Wan and IOPS traffic for sites, filtered by start date and end date. The following options are available: + +* To view network stats of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. +* To view network stats between two sites, specify both the protected site identifier and the recovery site identifier. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkSiteStat -protectedSiteIdentifier "7890-1234-5678" +``` + +Returns all outgoing networks stats from site with identifier "7890-1234-5678" + +### Example 2 +```powershell +PS C:\> Get-ZANetworkSiteStat -protectedSiteIdentifier "7890-1234-5678" -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns all networks stats between sites with identifiers "7890-1234-5678" and "9876-5432-1098" + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -protectedSiteIdentifier +Protected site identifier. +A site identification is required for at least one of the sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +Recovery site identifier. +If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the executive summary. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network Site Summary](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_network_stats) diff --git a/docs/Get-ZANetworkSiteSummary.md b/docs/Get-ZANetworkSiteSummary.md index 935e7e0..6840ac0 100644 --- a/docs/Get-ZANetworkSiteSummary.md +++ b/docs/Get-ZANetworkSiteSummary.md @@ -1,167 +1,167 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkSiteSummary.md -schema: 2.0.0 ---- - -# Get-ZANetworkSiteSummary - -## SYNOPSIS - -Get a network executive summary for sites, filtered by start date and end date. - -## SYNTAX - -### ProtectedSite (Default) -``` -Get-ZANetworkSiteSummary -protectedSiteIdentifier [-recoverySiteIdentifier ] - [-startDate ] [-endDate ] [-zOrgIdentifier ] [] -``` - -### RecoverySite -``` -Get-ZANetworkSiteSummary [-protectedSiteIdentifier ] -recoverySiteIdentifier - [-startDate ] [-endDate ] [-zOrgIdentifier ] [] -``` - -## DESCRIPTION - -Get a network executive summary for sites, filtered by start date and end date.The following options are available: - -* To view the network executive summary of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. -* To view the network executive summary between two sites, specify both the protected site identifier and the recovery site identifier. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZANetworkSiteSummary -protectedSiteIdentifier "7890-1234-5678" -``` - -Returns outgoing networks summary from site with identifier "7890-1234-5678" - -### Example 2 -```powershell -PS C:\> Get-ZANetworkSiteSummary -protectedSiteIdentifier "7890-1234-5678" -recoverySiteIdentifier "9876-5432-1098" -``` - -Returns network summary between sites with identifiers "7890-1234-5678" and "9876-5432-1098" - -## PARAMETERS - -### -endDate -End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the end date is omitted, the default end date is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -protectedSiteIdentifier -Protected site identifier. -A site identification is required for at least one of the sites. - -```yaml -Type: String -Parameter Sets: ProtectedSite -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -```yaml -Type: String -Parameter Sets: RecoverySite -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -recoverySiteIdentifier -Recovery site identifier. -If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites. - -```yaml -Type: String -Parameter Sets: ProtectedSite -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -```yaml -Type: String -Parameter Sets: RecoverySite -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the start date is omitted, the default start date is 7 days before the end date. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -zOrgIdentifier -The ZORG identifier by which to filter the executive summary. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Network Site Summary](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_network_summary) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkSiteSummary.md +schema: 2.0.0 +--- + +# Get-ZANetworkSiteSummary + +## SYNOPSIS + +Get a network executive summary for sites, filtered by start date and end date. + +## SYNTAX + +### ProtectedSite (Default) +``` +Get-ZANetworkSiteSummary -protectedSiteIdentifier [-recoverySiteIdentifier ] + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +### RecoverySite +``` +Get-ZANetworkSiteSummary [-protectedSiteIdentifier ] -recoverySiteIdentifier + [-startDate ] [-endDate ] [-zOrgIdentifier ] [] +``` + +## DESCRIPTION + +Get a network executive summary for sites, filtered by start date and end date.The following options are available: + +* To view the network executive summary of all outgoing traffic from a protected site to all its replicating sites, specify only the protected site identifier. +* To view the network executive summary between two sites, specify both the protected site identifier and the recovery site identifier. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkSiteSummary -protectedSiteIdentifier "7890-1234-5678" +``` + +Returns outgoing networks summary from site with identifier "7890-1234-5678" + +### Example 2 +```powershell +PS C:\> Get-ZANetworkSiteSummary -protectedSiteIdentifier "7890-1234-5678" -recoverySiteIdentifier "9876-5432-1098" +``` + +Returns network summary between sites with identifiers "7890-1234-5678" and "9876-5432-1098" + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -protectedSiteIdentifier +Protected site identifier. +A site identification is required for at least one of the sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoverySiteIdentifier +Recovery site identifier. +If the recovery site identifier is omitted, the API will show all outgoing traffic from the protected site to its replicating sites. + +```yaml +Type: String +Parameter Sets: ProtectedSite +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: String +Parameter Sets: RecoverySite +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the executive summary. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network Site Summary](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_network_summary) diff --git a/docs/Get-ZANetworkVpgAverageIOPS.md b/docs/Get-ZANetworkVpgAverageIOPS.md index 8bd5a09..ad707f9 100644 --- a/docs/Get-ZANetworkVpgAverageIOPS.md +++ b/docs/Get-ZANetworkVpgAverageIOPS.md @@ -1,109 +1,109 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkVpgAverageIOPS.md -schema: 2.0.0 ---- - -# Get-ZANetworkVpgAverageIOPS - -## SYNOPSIS - -Get average and maximum IOPS performance for a specific VPG, filtered by start date and end date, and optional intervals. - -## SYNTAX - -``` -Get-ZANetworkVpgAverageIOPS [-vpgIdentifier] [[-startDate] ] [[-endDate] ] - [[-interval] ] [] -``` - -## DESCRIPTION - -Get average and maximum IOPS performance for a specific VPG, filtered by start date and end date, and optional intervals. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZANetworkVpgAverageIOPS -vpgIdentifier "3456-7890-1234" -interval 3600 -``` - -Get Network VPG Average IOPS for VPG with Identifier "3456-7890-1234" for the last 7 days at an interval of 1 hour. - -## PARAMETERS - -### -endDate -End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the end date is omitted, the default end date is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -interval -The interval selected within the duration of the report. The interval can be per minute - for up to 6 hours, per hour - for 6 hours to 15 days, or per day - for 15 days up to 30 days. If an interval is not specified, the default is 60 seconds. Submit value in Seconds. - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: 0 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the start date is omitted, the default start date is 7 days before the end date. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The VPG identifier. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Network VPG Average IOPS](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_vpg_network_iops_average) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkVpgAverageIOPS.md +schema: 2.0.0 +--- + +# Get-ZANetworkVpgAverageIOPS + +## SYNOPSIS + +Get average and maximum IOPS performance for a specific VPG, filtered by start date and end date, and optional intervals. + +## SYNTAX + +``` +Get-ZANetworkVpgAverageIOPS [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get average and maximum IOPS performance for a specific VPG, filtered by start date and end date, and optional intervals. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkVpgAverageIOPS -vpgIdentifier "3456-7890-1234" -interval 3600 +``` + +Get Network VPG Average IOPS for VPG with Identifier "3456-7890-1234" for the last 7 days at an interval of 1 hour. + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per minute - for up to 6 hours, per hour - for 6 hours to 15 days, or per day - for 15 days up to 30 days. If an interval is not specified, the default is 60 seconds. Submit value in Seconds. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The VPG identifier. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network VPG Average IOPS](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_vpg_network_iops_average) diff --git a/docs/Get-ZANetworkVpgAveragePerformance.md b/docs/Get-ZANetworkVpgAveragePerformance.md index 83e07e9..8c66050 100644 --- a/docs/Get-ZANetworkVpgAveragePerformance.md +++ b/docs/Get-ZANetworkVpgAveragePerformance.md @@ -1,109 +1,109 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkVpgAveragePerformance.md -schema: 2.0.0 ---- - -# Get-ZANetworkVpgAveragePerformance - -## SYNOPSIS - -Get average and maximum network performance of throughput vs. WAN traffic for a specific VPG filtered by start date and end date, and optional intervals. - -## SYNTAX - -``` -Get-ZANetworkVpgAveragePerformance [-vpgIdentifier] [[-startDate] ] [[-endDate] ] - [[-interval] ] [] -``` - -## DESCRIPTION - -Get average and maximum network performance of throughput vs. WAN traffic for a specific VPG filtered by start date and end date, and optional intervals - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZANetworkVpgAveragePerformance -vpgIdentifier "3456-7890-1234" -interval 3600 -``` - -Get Network VPG Average Performance for VPG with Identifier "3456-7890-1234" for the last 7 days at an interval of 1 hour. - -## PARAMETERS - -### -endDate -End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the end date is omitted, the default end date is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -interval -The interval selected within the duration of the report. The interval can be per minute - for up to 6 hours, per hour - for 6 hours to 15 days, or per day - for 15 days up to 30 days. If an interval is not specified, the default is 60 seconds. Submit value in Seconds. - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: 0 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the start date is omitted, the default start date is 7 days before the end date. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The VPG identifier. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Network VPG Average Performance](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_vpg_network_performance_average) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkVpgAveragePerformance.md +schema: 2.0.0 +--- + +# Get-ZANetworkVpgAveragePerformance + +## SYNOPSIS + +Get average and maximum network performance of throughput vs. WAN traffic for a specific VPG filtered by start date and end date, and optional intervals. + +## SYNTAX + +``` +Get-ZANetworkVpgAveragePerformance [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [[-interval] ] [] +``` + +## DESCRIPTION + +Get average and maximum network performance of throughput vs. WAN traffic for a specific VPG filtered by start date and end date, and optional intervals + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkVpgAveragePerformance -vpgIdentifier "3456-7890-1234" -interval 3600 +``` + +Get Network VPG Average Performance for VPG with Identifier "3456-7890-1234" for the last 7 days at an interval of 1 hour. + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. The interval can be per minute - for up to 6 hours, per hour - for 6 hours to 15 days, or per day - for 15 days up to 30 days. If an interval is not specified, the default is 60 seconds. Submit value in Seconds. + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The VPG identifier. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network VPG Average Performance](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_vpg_network_performance_average) diff --git a/docs/Get-ZANetworkVpgStat.md b/docs/Get-ZANetworkVpgStat.md index 40a50c2..2820450 100644 --- a/docs/Get-ZANetworkVpgStat.md +++ b/docs/Get-ZANetworkVpgStat.md @@ -1,94 +1,94 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkVpgStat.md -schema: 2.0.0 ---- - -# Get-ZANetworkVpgStat - -## SYNOPSIS - -Get Max, Avg. and Min network statistics for Throughput, Wan and IOPS traffic for a given VPG, filtered by start date and end date. - -## SYNTAX - -``` -Get-ZANetworkVpgStat [-vpgIdentifier] [[-startDate] ] [[-endDate] ] - [] -``` - -## DESCRIPTION - -Get Max, Avg. and Min network statistics for Throughput, Wan and IOPS traffic for a given VPG, filtered by start date and end date. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZANetworkVpgStat -vpgIdentifier "3456-7890-1234" -``` - -Get Network VPG Stats for VPG with Identifier "3456-7890-1234" for the last 7 days. - -## PARAMETERS - -### -endDate -End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the end date is omitted, the default end date is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the start date is omitted, the default start date is 7 days before the end date. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The VPG identifier. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Network VPG Summary](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_vpg_network_summary) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkVpgStat.md +schema: 2.0.0 +--- + +# Get-ZANetworkVpgStat + +## SYNOPSIS + +Get Max, Avg. and Min network statistics for Throughput, Wan and IOPS traffic for a given VPG, filtered by start date and end date. + +## SYNTAX + +``` +Get-ZANetworkVpgStat [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Get Max, Avg. and Min network statistics for Throughput, Wan and IOPS traffic for a given VPG, filtered by start date and end date. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkVpgStat -vpgIdentifier "3456-7890-1234" +``` + +Get Network VPG Stats for VPG with Identifier "3456-7890-1234" for the last 7 days. + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The VPG identifier. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network VPG Summary](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_vpg_network_summary) diff --git a/docs/Get-ZANetworkVpgSummary.md b/docs/Get-ZANetworkVpgSummary.md index 10ac2a4..54eef27 100644 --- a/docs/Get-ZANetworkVpgSummary.md +++ b/docs/Get-ZANetworkVpgSummary.md @@ -1,94 +1,94 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkVpgSummary.md -schema: 2.0.0 ---- - -# Get-ZANetworkVpgSummary - -## SYNOPSIS - -Get a network executive summary for a given VPG, filtered by start date and end date. - -## SYNTAX - -``` -Get-ZANetworkVpgSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] - [] -``` - -## DESCRIPTION - -Get a network executive summary for a given VPG, filtered by start date and end date. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZANetworkVpgSummary -vpgIdentifier "3456-7890-1234" -``` - -Get Network VPG Summary for VPG with Identifier "3456-7890-1234" for the last 7 days. - -## PARAMETERS - -### -endDate -End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the end date is omitted, the default end date is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the start date is omitted, the default start date is 7 days before the end date. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The VPG identifier. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Network VPG Summary](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_vpg_network_summary) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZANetworkVpgSummary.md +schema: 2.0.0 +--- + +# Get-ZANetworkVpgSummary + +## SYNOPSIS + +Get a network executive summary for a given VPG, filtered by start date and end date. + +## SYNTAX + +``` +Get-ZANetworkVpgSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Get a network executive summary for a given VPG, filtered by start date and end date. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZANetworkVpgSummary -vpgIdentifier "3456-7890-1234" +``` + +Get Network VPG Summary for VPG with Identifier "3456-7890-1234" for the last 7 days. + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default end date is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The VPG identifier. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Network VPG Summary](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_vpg_network_summary) diff --git a/docs/Get-ZAPlannerJournalSizeReport.md b/docs/Get-ZAPlannerJournalSizeReport.md index 9796b5f..8d69627 100644 --- a/docs/Get-ZAPlannerJournalSizeReport.md +++ b/docs/Get-ZAPlannerJournalSizeReport.md @@ -1,163 +1,163 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerJournalSizeReport.md -schema: 2.0.0 ---- - -# Get-ZAPlannerJournalSizeReport - -## SYNOPSIS -Create a report request to retrieve the Journal Size for a specific VMs list, and timeframe. - -## SYNTAX - -``` -Get-ZAPlannerJournalSizeReport [-siteIdentifier] [-recoveryType] [-vmIdentifier] - [[-desiredJournalHistory] ] [[-startDate] ] [[-endDate] ] [] -``` - -## DESCRIPTION -Create a report request to retrieve the Journal Size for a specific VMs list, and timeframe. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAPlannerJournalSizeReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -``` - -Gets a Journal report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. The report will cover a Journal History of 24 hours. This will use all data contained in Zerto Analytics to create the Journal report. - -### Example 2 -```powershell -PS C:\> Get-ZAPlannerJournalSizeReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -desiredJournalHistory 96 -``` - -Gets a Journal report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. The report will cover a Journal History of 96 hours (4 days). This will use all data contained in Zerto Analytics to create the Journal report. - -### Example 3 -```powershell -PS C:\> Get-ZAPlannerJournalSizeReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -desiredJournalHistory 96 -startDate '2020-01-01' -``` - -Gets a Journal report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. The report will cover a Journal History of 96 hours (4 days). This will use all data starting from Jan 1st to today contained in Zerto Analytics to create the Journal report. - -### Example 4 -```powershell -PS C:\> Get-ZAPlannerJournalSizeReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -desiredJournalHistory 96 -startDate '2020-01-01' -endDate '2020-01-30' -``` - -Gets a Journal report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. The report will cover a Journal History of 96 hours (4 days). This will use all data starting from Jan 1st to Jan 30th contained in Zerto Analytics to create the Journal report. - -## PARAMETERS - -### -desiredJournalHistory -The desired journal history in hours. -The default is 24 hours. -Limited to a 1 hour up to 720 hours, or the equivalent of 30 days - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: 24 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -endDate -The latest timestamp of an event to return, in RFC 3339 standard. -('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 6 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -recoveryType -Type of target recovery site. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -siteIdentifier -The site identifier(s) for which to return detailed information. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The earliest timestamp of an event to return, in RFC 3339 standard. -('1970-01-01T00:00:00Z'). -The default is one year ago. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 5 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vmIdentifier -Identifiers of the VMs you want to recover at the target recovery site. - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Planner Journal Size Report - Post](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_stats_journal_size) -[Zerto Planner Journal Size Report - Get](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_stats_journal_size) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerJournalSizeReport.md +schema: 2.0.0 +--- + +# Get-ZAPlannerJournalSizeReport + +## SYNOPSIS +Create a report request to retrieve the Journal Size for a specific VMs list, and timeframe. + +## SYNTAX + +``` +Get-ZAPlannerJournalSizeReport [-siteIdentifier] [-recoveryType] [-vmIdentifier] + [[-desiredJournalHistory] ] [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION +Create a report request to retrieve the Journal Size for a specific VMs list, and timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAPlannerJournalSizeReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' +``` + +Gets a Journal report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. The report will cover a Journal History of 24 hours. This will use all data contained in Zerto Analytics to create the Journal report. + +### Example 2 +```powershell +PS C:\> Get-ZAPlannerJournalSizeReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -desiredJournalHistory 96 +``` + +Gets a Journal report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. The report will cover a Journal History of 96 hours (4 days). This will use all data contained in Zerto Analytics to create the Journal report. + +### Example 3 +```powershell +PS C:\> Get-ZAPlannerJournalSizeReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -desiredJournalHistory 96 -startDate '2020-01-01' +``` + +Gets a Journal report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. The report will cover a Journal History of 96 hours (4 days). This will use all data starting from Jan 1st to today contained in Zerto Analytics to create the Journal report. + +### Example 4 +```powershell +PS C:\> Get-ZAPlannerJournalSizeReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -desiredJournalHistory 96 -startDate '2020-01-01' -endDate '2020-01-30' +``` + +Gets a Journal report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. The report will cover a Journal History of 96 hours (4 days). This will use all data starting from Jan 1st to Jan 30th contained in Zerto Analytics to create the Journal report. + +## PARAMETERS + +### -desiredJournalHistory +The desired journal history in hours. +The default is 24 hours. +Limited to a 1 hour up to 720 hours, or the equivalent of 30 days + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 24 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -endDate +The latest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 6 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoveryType +Type of target recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -siteIdentifier +The site identifier(s) for which to return detailed information. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The earliest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is one year ago. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vmIdentifier +Identifiers of the VMs you want to recover at the target recovery site. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Planner Journal Size Report - Post](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_stats_journal_size) +[Zerto Planner Journal Size Report - Get](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_stats_journal_size) diff --git a/docs/Get-ZAPlannerNetworkPerformanceReport.md b/docs/Get-ZAPlannerNetworkPerformanceReport.md index 2b8c1eb..e69dbbd 100644 --- a/docs/Get-ZAPlannerNetworkPerformanceReport.md +++ b/docs/Get-ZAPlannerNetworkPerformanceReport.md @@ -1,158 +1,158 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerNetworkPerformanceReport.md -schema: 2.0.0 ---- - -# Get-ZAPlannerNetworkPerformanceReport - -## SYNOPSIS -Create a report request to retrieve the Network Performance for a specific VMs list, and timeframe. - -## SYNTAX - -``` -Get-ZAPlannerNetworkPerformanceReport [-siteIdentifier] [-recoveryType] - [-vmIdentifier] [[-interval] ] [[-startDate] ] [[-endDate] ] - [] -``` - -## DESCRIPTION -Create a report request to retrieve the Network Performance for a specific VMs list, and timeframe. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAPlannerNetworkPerformanceReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -``` - -Gets a Network Performance report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. This will use all data contained in Zerto Analytics to create the Journal report. - -### Example 2 -```powershell -PS C:\> Get-ZAPlannerNetworkPerformanceReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -startDate '2020-01-01' -interval 86400 -``` - -Gets a Network Performance report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. This will use data contained in Zerto Analytics starting Jan 1st, 2020 ending on the day the report is run to create the Journal report. Sample reporting interval will be 86400 seconds (1 day). - -### Example 3 -```powershell -PS C:\> Get-ZAPlannerNetworkPerformanceReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -startDate '2020-01-01' -endDate '2020-01-30' -interval 86400 -``` - -Gets a Network Performance report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. This will use data contained in Zerto Analytics starting Jan 1st, 2020 ending on Jan 30th, 2020 to create the Journal report. Sample reporting interval will be 86400 seconds (1 day). - -## PARAMETERS - -### -endDate -The latest timestamp of an event to return, in RFC 3339 standard. -('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 6 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -interval -The desired sample interval in seconds. -The default is 3600 seconds (1 Hour). -Limited to a 60 second to 86,400 second (24 Hour) interval - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: 3600 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -recoveryType -Type of target recovery site. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -siteIdentifier -The site identifier(s) for which to return detailed information. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The earliest timestamp of an event to return, in RFC 3339 standard. -('1970-01-01T00:00:00Z'). -The default is one year ago. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 5 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vmIdentifier -Identifiers of the VMs you want to recover at the target recovery site. - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics Planner Network-Performance API Endpoint - POST](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_network_performance) -[Zerto Analytics Planner Network-Performance API Endpoint - GET](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_network_performance) - +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerNetworkPerformanceReport.md +schema: 2.0.0 +--- + +# Get-ZAPlannerNetworkPerformanceReport + +## SYNOPSIS +Create a report request to retrieve the Network Performance for a specific VMs list, and timeframe. + +## SYNTAX + +``` +Get-ZAPlannerNetworkPerformanceReport [-siteIdentifier] [-recoveryType] + [-vmIdentifier] [[-interval] ] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION +Create a report request to retrieve the Network Performance for a specific VMs list, and timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAPlannerNetworkPerformanceReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' +``` + +Gets a Network Performance report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. This will use all data contained in Zerto Analytics to create the Journal report. + +### Example 2 +```powershell +PS C:\> Get-ZAPlannerNetworkPerformanceReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -startDate '2020-01-01' -interval 86400 +``` + +Gets a Network Performance report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. This will use data contained in Zerto Analytics starting Jan 1st, 2020 ending on the day the report is run to create the Journal report. Sample reporting interval will be 86400 seconds (1 day). + +### Example 3 +```powershell +PS C:\> Get-ZAPlannerNetworkPerformanceReport -siteIdentifier '1234567890-01923141' -recoveryType VMware -vmIdentifier 'vmIdentifier1', 'vmIdentifier2' -startDate '2020-01-01' -endDate '2020-01-30' -interval 86400 +``` + +Gets a Network Performance report for VMs with identifiers 'vmIdentifier1' and 'vmIdentifier2' at source siteIdentifier '1234567890-01923141' where the target recovery location is VMware. This will use data contained in Zerto Analytics starting Jan 1st, 2020 ending on Jan 30th, 2020 to create the Journal report. Sample reporting interval will be 86400 seconds (1 day). + +## PARAMETERS + +### -endDate +The latest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 6 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The desired sample interval in seconds. +The default is 3600 seconds (1 Hour). +Limited to a 60 second to 86,400 second (24 Hour) interval + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 3600 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoveryType +Type of target recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -siteIdentifier +The site identifier(s) for which to return detailed information. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The earliest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is one year ago. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vmIdentifier +Identifiers of the VMs you want to recover at the target recovery site. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics Planner Network-Performance API Endpoint - POST](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_network_performance) +[Zerto Analytics Planner Network-Performance API Endpoint - GET](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_network_performance) + diff --git a/docs/Get-ZAPlannerSite.md b/docs/Get-ZAPlannerSite.md index 5003758..f977330 100644 --- a/docs/Get-ZAPlannerSite.md +++ b/docs/Get-ZAPlannerSite.md @@ -1,67 +1,67 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerSite.md -schema: 2.0.0 ---- - -# Get-ZAPlannerSite - -## SYNOPSIS -Retrieve all active Planner sites for a specific account - includes ID, Name and Type or retrieves datacenter, host, and VMs for a specific site. - -## SYNTAX - -``` -Get-ZAPlannerSite [[-siteIdentifier] ] [] -``` - -## DESCRIPTION -Retrieve all active Planner sites for a specific account - includes ID, Name and Type or retrieves datacenter, host, and VMs for a specific site. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAPlannerSite -``` - -Retrieve all active Planner sites for a specific account - -### Example 2 -```powershell -PS C:\> Get-ZAPlannerSite -siteIdentifier '0123-45676-09876' -``` - -Retrieves datacenter, host, and VMs for site with Identifier '0123-45676-09876'. - -## PARAMETERS - -### -siteIdentifier -The site identifier(s) for which to return detailed information. - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics Sites Planner Endpoint](https://docs.api.zerto.com/#/Planner/get_v2_planner_sites) -[Zerto Analytics Single Site Planner Endpoint](https://docs.api.zerto.com/#/Planner/get_v2_planner_sites__siteIdentifier_) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerSite.md +schema: 2.0.0 +--- + +# Get-ZAPlannerSite + +## SYNOPSIS +Retrieve all active Planner sites for a specific account - includes ID, Name and Type or retrieves datacenter, host, and VMs for a specific site. + +## SYNTAX + +``` +Get-ZAPlannerSite [[-siteIdentifier] ] [] +``` + +## DESCRIPTION +Retrieve all active Planner sites for a specific account - includes ID, Name and Type or retrieves datacenter, host, and VMs for a specific site. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAPlannerSite +``` + +Retrieve all active Planner sites for a specific account + +### Example 2 +```powershell +PS C:\> Get-ZAPlannerSite -siteIdentifier '0123-45676-09876' +``` + +Retrieves datacenter, host, and VMs for site with Identifier '0123-45676-09876'. + +## PARAMETERS + +### -siteIdentifier +The site identifier(s) for which to return detailed information. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics Sites Planner Endpoint](https://docs.api.zerto.com/#/Planner/get_v2_planner_sites) +[Zerto Analytics Single Site Planner Endpoint](https://docs.api.zerto.com/#/Planner/get_v2_planner_sites__siteIdentifier_) diff --git a/docs/Get-ZAPlannerStatsReport.md b/docs/Get-ZAPlannerStatsReport.md index c052737..bdecfbb 100644 --- a/docs/Get-ZAPlannerStatsReport.md +++ b/docs/Get-ZAPlannerStatsReport.md @@ -1,148 +1,149 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerStatsReport.md -schema: 2.0.0 ---- - -# Get-ZAPlannerStatsReport - -## SYNOPSIS -Create a report request for the selected VMs for a specific timeframe, retrieving all stats data for ZCAs, WAN, Journal size and array of VMs avg IOPs, avg throughput and journal size. - -## SYNTAX - -``` -Get-ZAPlannerStatsReport [-siteIdentifier] [-recoveryType] [-vmIdentifier] - [[-desiredJournalHistory] ] [[-startDate] ] [[-endDate] ] [] -``` - -## DESCRIPTION -Create a report request for the selected VMs for a specific timeframe, retrieving all stats data for ZCAs, WAN, Journal size and array of VMs avg IOPs, avg throughput and journal size. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAPlannerStatsReport -siteIdentifier '0123-45676-09876' -recoveryType vcenter -vmIdentifier 'vmIdentifier01', 'vmIdentifier02' -``` - -Will get a stats report for the two VMs listed recovering to a vCenter site with a 24 hour journal - -### Example 2 -```powershell -PS C:\> Get-ZAPlannerStatsReport -siteIdentifier '0123-45676-09876' -recoveryType Azure -vmIdentifier 'vmIdentifier01', 'vmIdentifier02' -desiredJournalHistory 72 -``` - -Will get a stats report for the two VMs listed recovering to an Azure site with a 72 hour journal - -## PARAMETERS - -### -desiredJournalHistory -The desired journal history in hours. -The default is 24 hours. -Limited to a 1 hour up to 720 hours, or the equivalent of 30 days - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: 24 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -endDate -The latest timestamp of an event to return, in RFC 3339 standard. -('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 6 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -recoveryType -Type of target recovery site. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -siteIdentifier -The site identifier(s) for which to return detailed information. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The earliest timestamp of an event to return, in RFC 3339 standard. -('1970-01-01T00:00:00Z'). -The default is one year ago. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 5 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vmIdentifier -Identifiers of the VMs you want to recover at the target recovery site. - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS -[Zerto Analytics Planner Stats API Endpoint - POST](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_stats) -[Zerto Analytics Planner Stats API Endpoint - GET](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_stats) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerStatsReport.md +schema: 2.0.0 +--- + +# Get-ZAPlannerStatsReport + +## SYNOPSIS +Create a report request for the selected VMs for a specific timeframe, retrieving all stats data for ZCAs, WAN, Journal size and array of VMs avg IOPs, avg throughput and journal size. + +## SYNTAX + +``` +Get-ZAPlannerStatsReport [-siteIdentifier] [-recoveryType] [-vmIdentifier] + [[-desiredJournalHistory] ] [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION +Create a report request for the selected VMs for a specific timeframe, retrieving all stats data for ZCAs, WAN, Journal size and array of VMs avg IOPs, avg throughput and journal size. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAPlannerStatsReport -siteIdentifier '0123-45676-09876' -recoveryType vcenter -vmIdentifier 'vmIdentifier01', 'vmIdentifier02' +``` + +Will get a stats report for the two VMs listed recovering to a vCenter site with a 24 hour journal + +### Example 2 +```powershell +PS C:\> Get-ZAPlannerStatsReport -siteIdentifier '0123-45676-09876' -recoveryType Azure -vmIdentifier 'vmIdentifier01', 'vmIdentifier02' -desiredJournalHistory 72 +``` + +Will get a stats report for the two VMs listed recovering to an Azure site with a 72 hour journal + +## PARAMETERS + +### -desiredJournalHistory +The desired journal history in hours. +The default is 24 hours. +Limited to a 1 hour up to 720 hours, or the equivalent of 30 days + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 24 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -endDate +The latest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 6 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoveryType +Type of target recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -siteIdentifier +The site identifier(s) for which to return detailed information. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The earliest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is one year ago. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vmIdentifier +Identifiers of the VMs you want to recover at the target recovery site. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics Planner Stats API Endpoint - POST](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_stats) +[Zerto Analytics Planner Stats API Endpoint - GET](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_stats) diff --git a/docs/Get-ZAPlannerWanReport.md b/docs/Get-ZAPlannerWanReport.md index a9ddb45..88e0f4c 100644 --- a/docs/Get-ZAPlannerWanReport.md +++ b/docs/Get-ZAPlannerWanReport.md @@ -1,124 +1,125 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerWanReport.md -schema: 2.0.0 ---- - -# Get-ZAPlannerWanReport - -## SYNOPSIS -Create a report request to retrieve WAN for a specific VMs list, and timeframe. - -## SYNTAX - -``` -Get-ZAPlannerWanReport [-siteIdentifier] [-recoveryType] [-vmIdentifier] - [[-startDate] ] [[-endDate] ] [] -``` - -## DESCRIPTION -Create a report request to retrieve WAN for a specific VMs list, and timeframe. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAPlannerWanReport -siteIdentifier '12345-0987654-254364' -recoveryType vcenter -vmIdentifier '1234-98789-0987', '1234-98789-1252' -``` - -Get a WAN requirements report for VMs at the protected site. - -## PARAMETERS - -### -endDate -The latest timestamp of an event to return, in RFC 3339 standard. -('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 5 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -recoveryType -Type of target recovery site. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -siteIdentifier -The site identifier(s) for which to return detailed information. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The earliest timestamp of an event to return, in RFC 3339 standard. -('1970-01-01T00:00:00Z'). -The default is one year ago. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vmIdentifier -Identifiers of the VMs you want to recover at the target recovery site. - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS -[Zerto Analytics Planner Wan Stats API Endpoint - POST](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_stats_wan) -[Zerto Analytics Planner Wan Stats API Endpoint - GET](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_stats_wan) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerWanReport.md +schema: 2.0.0 +--- + +# Get-ZAPlannerWanReport + +## SYNOPSIS +Create a report request to retrieve WAN for a specific VMs list, and timeframe. + +## SYNTAX + +``` +Get-ZAPlannerWanReport [-siteIdentifier] [-recoveryType] [-vmIdentifier] + [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION +Create a report request to retrieve WAN for a specific VMs list, and timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAPlannerWanReport -siteIdentifier '12345-0987654-254364' -recoveryType vcenter -vmIdentifier '1234-98789-0987', '1234-98789-1252' +``` + +Get a WAN requirements report for VMs at the protected site. + +## PARAMETERS + +### -endDate +The latest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoveryType +Type of target recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -siteIdentifier +The site identifier(s) for which to return detailed information. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The earliest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is one year ago. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vmIdentifier +Identifiers of the VMs you want to recover at the target recovery site. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics Planner Wan Stats API Endpoint - POST](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_stats_wan) +[Zerto Analytics Planner Wan Stats API Endpoint - GET](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_stats_wan) diff --git a/docs/Get-ZAPlannerZcasReport.md b/docs/Get-ZAPlannerZcasReport.md index bee5805..bdde4dc 100644 --- a/docs/Get-ZAPlannerZcasReport.md +++ b/docs/Get-ZAPlannerZcasReport.md @@ -1,124 +1,125 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerZcasReport.md -schema: 2.0.0 ---- - -# Get-ZAPlannerZcasReport - -## SYNOPSIS -Create a report request to retrieve ZCAs for a specific VMs list, and timeframe. - -## SYNTAX - -``` -Get-ZAPlannerZcasReport [-siteIdentifier] [-recoveryType] [-vmIdentifier] - [[-startDate] ] [[-endDate] ] [] -``` - -## DESCRIPTION -Create a report request to retrieve ZCAs for a specific VMs list, and timeframe. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAPlannerZcasReport -siteIdentifier '12345-0987654-254364' -recoveryType azure -vmIdentifier '1234-98789-0987', '1234-98789-1252' -``` - -Get a report for the number of required ZCA's in Azure to protect the supplied VMs. - -## PARAMETERS - -### -endDate -The latest timestamp of an event to return, in RFC 3339 standard. -('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 5 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -recoveryType -Type of target recovery site. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -siteIdentifier -The site identifier(s) for which to return detailed information. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The earliest timestamp of an event to return, in RFC 3339 standard. -('1970-01-01T00:00:00Z'). -The default is one year ago. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vmIdentifier -Identifiers of the VMs you want to recover at the target recovery site. - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS -[Zerto Analytics Planner ZCA Stats API Endpoint - POST](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_stats_zcas) -[Zerto Analytics Planner ZCA Stats API Endpoint - GET](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_stats_zcas) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerZcasReport.md +schema: 2.0.0 +--- + +# Get-ZAPlannerZcasReport + +## SYNOPSIS +Create a report request to retrieve ZCAs for a specific VMs list, and timeframe. + +## SYNTAX + +``` +Get-ZAPlannerZcasReport [-siteIdentifier] [-recoveryType] [-vmIdentifier] + [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION +Create a report request to retrieve ZCAs for a specific VMs list, and timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAPlannerZcasReport -siteIdentifier '12345-0987654-254364' -recoveryType azure -vmIdentifier '1234-98789-0987', '1234-98789-1252' +``` + +Get a report for the number of required ZCA's in Azure to protect the supplied VMs. + +## PARAMETERS + +### -endDate +The latest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 5 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -recoveryType +Type of target recovery site. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -siteIdentifier +The site identifier(s) for which to return detailed information. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The earliest timestamp of an event to return, in RFC 3339 standard. +('1970-01-01T00:00:00Z'). +The default is one year ago. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vmIdentifier +Identifiers of the VMs you want to recover at the target recovery site. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics Planner ZCA Stats API Endpoint - POST](https://docs.api.zerto.com/#/Planner/post_v2_planner_reports_stats_zcas) +[Zerto Analytics Planner ZCA Stats API Endpoint - GET](https://docs.api.zerto.com/#/Planner/get_v2_planner_reports_stats_zcas) diff --git a/docs/Get-ZAProtectedVm.md b/docs/Get-ZAProtectedVm.md index 61a97cd..c6726d2 100644 --- a/docs/Get-ZAProtectedVm.md +++ b/docs/Get-ZAProtectedVm.md @@ -1,120 +1,120 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVm.md -schema: 2.0.0 ---- - -# Get-ZAProtectedVm - -## SYNOPSIS -Gets information about currently protected Virtual Machines in all sites. If desired a subset of VMs can be returned by providing VM Identifiers for each virtual machine. - -## SYNTAX - -### AllVMs (Default) -``` -Get-ZAProtectedVm [-AllVms] [] -``` - -### IndividualVMs -``` -Get-ZAProtectedVm -VMIdentifier [-Volumes] [] -``` - -## DESCRIPTION -Gets information about currently protected Virtual Machines in all sites. If desired a subset of VMs can be returned by providing VM Identifiers for each virtual machine. Finally, when gathering information for individual virtual machines, the `-Volumes` parameter can be specified to return volume information for the protected VM. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAProtectedVm -``` - -Returns all protected virtual machines across all sites. - -### Example 2 -```powershell -PS C:\> Get-ZAProtectedVm -AllVMs -``` - -Returns all protected virtual machines across all sites. - -### Example 3 -```powershell -PS C:\> Get-ZAProtectedVm -VMIdentifier '09914-12345-12341235', '81238-12532-12355332' -``` - -Returns information for only the two specified virtual machines - -### Example 4 -```powershell -PS C:\> Get-ZAProtectedVm -VMIdentifier '09914-12345-12341235', '81238-12532-12355332' -Volumes -``` - -Returns volume information for the two specified virtual machines - -## PARAMETERS - -### -AllVms -Use this switch when you want a list of all protected VMs. -Please be warned this list can be quite large. - -```yaml -Type: SwitchParameter -Parameter Sets: AllVMs -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -VMIdentifier -A list of VM identifiers to query - -```yaml -Type: String[] -Parameter Sets: IndividualVMs -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Volumes -Specify this switch when you would like protected vms' volume information returned - -```yaml -Type: SwitchParameter -Parameter Sets: IndividualVMs -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS -[Zerto Analytics Protected VMs API Endpoint - AllVMs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_protected_vms) -[Zerto Analytics Protected VMs API Endpoint - List of VMs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_protected_vms__vmIdentifier_) -[Zerto Analytics Protected VMs API Endpoint - Volumes of VMs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_protected_vms__vmIdentifier__volumes) - +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVm.md +schema: 2.0.0 +--- + +# Get-ZAProtectedVm + +## SYNOPSIS +Gets information about currently protected Virtual Machines in all sites. If desired a subset of VMs can be returned by providing VM Identifiers for each virtual machine. + +## SYNTAX + +### AllVMs (Default) +``` +Get-ZAProtectedVm [-AllVms] [] +``` + +### IndividualVMs +``` +Get-ZAProtectedVm -VMIdentifier [-Volumes] [] +``` + +## DESCRIPTION +Gets information about currently protected Virtual Machines in all sites. If desired a subset of VMs can be returned by providing VM Identifiers for each virtual machine. Finally, when gathering information for individual virtual machines, the `-Volumes` parameter can be specified to return volume information for the protected VM. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAProtectedVm +``` + +Returns all protected virtual machines across all sites. + +### Example 2 +```powershell +PS C:\> Get-ZAProtectedVm -AllVMs +``` + +Returns all protected virtual machines across all sites. + +### Example 3 +```powershell +PS C:\> Get-ZAProtectedVm -VMIdentifier '09914-12345-12341235', '81238-12532-12355332' +``` + +Returns information for only the two specified virtual machines + +### Example 4 +```powershell +PS C:\> Get-ZAProtectedVm -VMIdentifier '09914-12345-12341235', '81238-12532-12355332' -Volumes +``` + +Returns volume information for the two specified virtual machines + +## PARAMETERS + +### -AllVms +Use this switch when you want a list of all protected VMs. +Please be warned this list can be quite large. + +```yaml +Type: SwitchParameter +Parameter Sets: AllVMs +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VMIdentifier +A list of VM identifiers to query + +```yaml +Type: String[] +Parameter Sets: IndividualVMs +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Volumes +Specify this switch when you would like protected vms' volume information returned + +```yaml +Type: SwitchParameter +Parameter Sets: IndividualVMs +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics Protected VMs API Endpoint - AllVMs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_protected_vms) +[Zerto Analytics Protected VMs API Endpoint - List of VMs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_protected_vms__vmIdentifier_) +[Zerto Analytics Protected VMs API Endpoint - Volumes of VMs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_protected_vms__vmIdentifier__volumes) + diff --git a/docs/Get-ZAProtectedVmReport.md b/docs/Get-ZAProtectedVmReport.md index c39f2b1..45fae12 100644 --- a/docs/Get-ZAProtectedVmReport.md +++ b/docs/Get-ZAProtectedVmReport.md @@ -1,60 +1,60 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVmReport.md -schema: 2.0.0 ---- - -# Get-ZAProtectedVmReport - -## SYNOPSIS -Creates a report of the requested protected virtual machines' volumes. - -## SYNTAX - -``` -Get-ZAProtectedVmReport -VMIdentifier [] -``` - -## DESCRIPTION -Creates a report of the requested protected virtual machines' volumes. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAProtectedVmReport -VMIdentifier '09914-12345-12341235', '81238-12532-12355332' -``` - -Generates a protected vm report for the virtual machines with the specified VMIdentifiers. - -## PARAMETERS - -### -VMIdentifier -A list of VM identifiers to include in the report. - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. -For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS -[Zerto Analytics Protected VMs Report API Endpoint - POST](https://docs.api.zerto.com/#/Monitoring/post_v2_monitoring_protected_vms) -[Zerto Analytics Protected VMs Report API Endpoint - GET](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_protected_vms_reportId__reportId_) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVmReport.md +schema: 2.0.0 +--- + +# Get-ZAProtectedVmReport + +## SYNOPSIS +Creates a report of the requested protected virtual machines' volumes. + +## SYNTAX + +``` +Get-ZAProtectedVmReport -VMIdentifier [] +``` + +## DESCRIPTION +Creates a report of the requested protected virtual machines' volumes. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAProtectedVmReport -VMIdentifier '09914-12345-12341235', '81238-12532-12355332' +``` + +Generates a protected vm report for the virtual machines with the specified VMIdentifiers. + +## PARAMETERS + +### -VMIdentifier +A list of VM identifiers to include in the report. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics Protected VMs Report API Endpoint - POST](https://docs.api.zerto.com/#/Monitoring/post_v2_monitoring_protected_vms) +[Zerto Analytics Protected VMs Report API Endpoint - GET](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_protected_vms_reportId__reportId_) diff --git a/docs/Get-ZARPOAccountAverage.md b/docs/Get-ZARPOAccountAverage.md index 9eed4cb..3d8803f 100644 --- a/docs/Get-ZARPOAccountAverage.md +++ b/docs/Get-ZARPOAccountAverage.md @@ -1,109 +1,109 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Get-ZARPOAccountAverage.md -schema: 2.0.0 ---- - -# Get-ZARPOAccountAverage - -## SYNOPSIS - -Get average RPO for all VPGs in a single account, filtered by last 30 days. - -## SYNTAX - -``` -Get-ZARPOAccountAverage [[-zOrgIdentifier] ] [[-startDate] ] [[-endDate] ] - [] -``` - -## DESCRIPTION - -Get average RPO for all VPGs in a single account, filtered by last 30 days. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZARPOAccountAverage -``` - -Get average RPO for all VPGs in a single account. - -### Example 2 -```powershell -PS C:\> Get-ZARPOAccountAverage -zOrgIdentifier "1234-5678-9012" -``` - -Get average RPO for all VPGs in zOrg with identifier "1234-5678-9012". - -### Example 3 -```powershell -PS C:\> Get-ZARPOAccountAverage -startDate "2019-06-01T00:00:00Z" -endDate "2019-06-02T00:00:00Z" -``` - -Get average RPO for all VPGs in a single account for June 6th, 2019 - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -zOrgIdentifier -The ZORG identifier by which to filter the user's average RPO for a single account. -If the ZORG identifier is omitted, statistics related to all sites, for a single account, is retrieved. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Account RPO Average](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_account_rpo_average) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Get-ZARPOAccountAverage.md +schema: 2.0.0 +--- + +# Get-ZARPOAccountAverage + +## SYNOPSIS + +Get average RPO for all VPGs in a single account, filtered by last 30 days. + +## SYNTAX + +``` +Get-ZARPOAccountAverage [[-zOrgIdentifier] ] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Get average RPO for all VPGs in a single account, filtered by last 30 days. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOAccountAverage +``` + +Get average RPO for all VPGs in a single account. + +### Example 2 +```powershell +PS C:\> Get-ZARPOAccountAverage -zOrgIdentifier "1234-5678-9012" +``` + +Get average RPO for all VPGs in zOrg with identifier "1234-5678-9012". + +### Example 3 +```powershell +PS C:\> Get-ZARPOAccountAverage -startDate "2019-06-01T00:00:00Z" -endDate "2019-06-02T00:00:00Z" +``` + +Get average RPO for all VPGs in a single account for June 6th, 2019 + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the user's average RPO for a single account. +If the ZORG identifier is omitted, statistics related to all sites, for a single account, is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Account RPO Average](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_account_rpo_average) diff --git a/docs/Get-ZARPOAverage.md b/docs/Get-ZARPOAverage.md index 77c3462..4264ab8 100644 --- a/docs/Get-ZARPOAverage.md +++ b/docs/Get-ZARPOAverage.md @@ -1,118 +1,118 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Get-ZARPOAverage.md -schema: 2.0.0 ---- - -# Get-ZARPOAverage - -## SYNOPSIS - -Retrieves list of average RPO values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the RPO samples interval. by default a 1 minutes interval. - -## SYNTAX - -``` -Get-ZARPOAverage [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [[-interval] ] - [] -``` - -## DESCRIPTION - -Retrieves list of average RPO values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the RPO samples interval. by default a 1 minutes interval. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZARPOAverage -vpgIdentifier "5678-9012-3456" -``` - -Returns RPO Average over the past 7 days for VPG with Identifier "5678-9012-3456" - -### Example 2 -```powershell -PS C:\> Get-ZARPOAverage -vpgIdentifier "5678-9012-3456" -startDate "2019-06-01T12:00:00Z" -endDate "2019-06-01T14:00:00Z" -interval 60 -``` - -Returns RPO Average in one minute intervals for the time period between June 1st, 2019 at Noon to June 1st, 2019 at 14:00 for VPG with Identifier "5678-9012-3456" - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -interval -The interval selected within the duration of the report. -The interval can be 1-minute data granularity for up to 6 hours' time frame, 1-hour data granularity for 6 hours to 15 days' time frame or 1-day data granularity for 15 days up to 30 days' time frame. -Value should be submitted in Seconds - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: 0 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The identifier of the VPG. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for RPO Average](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_rpo_average) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Get-ZARPOAverage.md +schema: 2.0.0 +--- + +# Get-ZARPOAverage + +## SYNOPSIS + +Retrieves list of average RPO values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the RPO samples interval. by default a 1 minutes interval. + +## SYNTAX + +``` +Get-ZARPOAverage [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [[-interval] ] + [] +``` + +## DESCRIPTION + +Retrieves list of average RPO values for a specific VPG, filtered by start date, end date, and optional interval. The interval defines the RPO samples interval. by default a 1 minutes interval. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOAverage -vpgIdentifier "5678-9012-3456" +``` + +Returns RPO Average over the past 7 days for VPG with Identifier "5678-9012-3456" + +### Example 2 +```powershell +PS C:\> Get-ZARPOAverage -vpgIdentifier "5678-9012-3456" -startDate "2019-06-01T12:00:00Z" -endDate "2019-06-01T14:00:00Z" -interval 60 +``` + +Returns RPO Average in one minute intervals for the time period between June 1st, 2019 at Noon to June 1st, 2019 at 14:00 for VPG with Identifier "5678-9012-3456" + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -interval +The interval selected within the duration of the report. +The interval can be 1-minute data granularity for up to 6 hours' time frame, 1-hour data granularity for 6 hours to 15 days' time frame or 1-day data granularity for 15 days up to 30 days' time frame. +Value should be submitted in Seconds + +```yaml +Type: Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for RPO Average](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_rpo_average) diff --git a/docs/Get-ZARPOBreach.md b/docs/Get-ZARPOBreach.md index 5dc64f6..5c60b30 100644 --- a/docs/Get-ZARPOBreach.md +++ b/docs/Get-ZARPOBreach.md @@ -1,107 +1,107 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZARPOBreach.md -schema: 2.0.0 ---- - -# Get-ZARPOBreach - -## SYNOPSIS - -Retrieves RPO breaches over the selected timeframe. - -## SYNTAX - -``` -Get-ZARPOBreach [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] -``` - -## DESCRIPTION - -Retrieves RPO breaches over the selected timeframe. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZARPOBreach -vpgIdentifier "3456-7890-1234" -``` - -Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" for the past 7 days. - -### Example 2 -```powershell -PS C:\> Get-ZARPOBreach -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -``` - -Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" starting January 1st, 2019 till the date this command is run. - -### Example 3 -```powershell -PS C:\> Get-ZARPOBreach -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -endDate "2019-02-01T00:00:00" -``` - -Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" for the Month of January. - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The identifier of the VPG. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for RPO Breach](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_rpo_breach) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZARPOBreach.md +schema: 2.0.0 +--- + +# Get-ZARPOBreach + +## SYNOPSIS + +Retrieves RPO breaches over the selected timeframe. + +## SYNTAX + +``` +Get-ZARPOBreach [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION + +Retrieves RPO breaches over the selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOBreach -vpgIdentifier "3456-7890-1234" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" for the past 7 days. + +### Example 2 +```powershell +PS C:\> Get-ZARPOBreach -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" starting January 1st, 2019 till the date this command is run. + +### Example 3 +```powershell +PS C:\> Get-ZARPOBreach -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -endDate "2019-02-01T00:00:00" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" for the Month of January. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for RPO Breach](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_rpo_breach) diff --git a/docs/Get-ZARPOStat.md b/docs/Get-ZARPOStat.md index c9f7ee9..e44a232 100644 --- a/docs/Get-ZARPOStat.md +++ b/docs/Get-ZARPOStat.md @@ -1,107 +1,107 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZARPOStat.md -schema: 2.0.0 ---- - -# Get-ZARPOStat - -## SYNOPSIS - -Retrieves Rpo min, max and avg. Stats. - -## SYNTAX - -``` -Get-ZARPOStat [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] -``` - -## DESCRIPTION - -Retrieves Rpo min, max and avg. Stats. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZARPOStat -vpgIdentifier "3456-7890-1234" -``` - -Gets the RPO Stats for the VPG with identifier "3456-7890-1234" for the past 7 days. - -### Example 2 -```powershell -PS C:\> Get-ZARPOStat -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -``` - -Gets the RPO Stats for the VPG with identifier "3456-7890-1234" starting January 1st, 2019 till the date this command is run. - -### Example 3 -```powershell -PS C:\> Get-ZARPOStat -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -endDate "2019-02-01T00:00:00" -``` - -Gets the RPO Stats for the VPG with identifier "3456-7890-1234" for the Month of January. - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The identifier of the VPG. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for RPO Stats](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_stats_rpo) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZARPOStat.md +schema: 2.0.0 +--- + +# Get-ZARPOStat + +## SYNOPSIS + +Retrieves Rpo min, max and avg. Stats. + +## SYNTAX + +``` +Get-ZARPOStat [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION + +Retrieves Rpo min, max and avg. Stats. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOStat -vpgIdentifier "3456-7890-1234" +``` + +Gets the RPO Stats for the VPG with identifier "3456-7890-1234" for the past 7 days. + +### Example 2 +```powershell +PS C:\> Get-ZARPOStat -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" +``` + +Gets the RPO Stats for the VPG with identifier "3456-7890-1234" starting January 1st, 2019 till the date this command is run. + +### Example 3 +```powershell +PS C:\> Get-ZARPOStat -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -endDate "2019-02-01T00:00:00" +``` + +Gets the RPO Stats for the VPG with identifier "3456-7890-1234" for the Month of January. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for RPO Stats](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_stats_rpo) diff --git a/docs/Get-ZARPOStatusProportion.md b/docs/Get-ZARPOStatusProportion.md index cb008f1..be274cf 100644 --- a/docs/Get-ZARPOStatusProportion.md +++ b/docs/Get-ZARPOStatusProportion.md @@ -1,108 +1,108 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZARPOStatusProportion.md -schema: 2.0.0 ---- - -# Get-ZARPOStatusProportion - -## SYNOPSIS - -Retrieves RPO SLA status distribution over the selected timeframe. - -## SYNTAX - -``` -Get-ZARPOStatusProportion [-vpgIdentifier] [[-startDate] ] [[-endDate] ] - [] -``` - -## DESCRIPTION - -Retrieves RPO SLA status distribution over the selected timeframe. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZARPOStatusProportion -vpgIdentifier "3456-7890-1234" -``` - -Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" for the past 7 days. - -### Example 2 -```powershell -PS C:\> Get-ZARPOStatusProportion -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -``` - -Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" starting January 1st, 2019 till the date this command is run. - -### Example 3 -```powershell -PS C:\> Get-ZARPOStatusProportion -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -endDate "2019-02-01T00:00:00" -``` - -Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" for the Month of January. - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The identifier of the VPG. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for RPO Statuses Proportions](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_rpo_statuses_proportions) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZARPOStatusProportion.md +schema: 2.0.0 +--- + +# Get-ZARPOStatusProportion + +## SYNOPSIS + +Retrieves RPO SLA status distribution over the selected timeframe. + +## SYNTAX + +``` +Get-ZARPOStatusProportion [-vpgIdentifier] [[-startDate] ] [[-endDate] ] + [] +``` + +## DESCRIPTION + +Retrieves RPO SLA status distribution over the selected timeframe. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOStatusProportion -vpgIdentifier "3456-7890-1234" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" for the past 7 days. + +### Example 2 +```powershell +PS C:\> Get-ZARPOStatusProportion -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" starting January 1st, 2019 till the date this command is run. + +### Example 3 +```powershell +PS C:\> Get-ZARPOStatusProportion -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -endDate "2019-02-01T00:00:00" +``` + +Gets the RPO Breaches for the VPG with identifier "3456-7890-1234" for the Month of January. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for RPO Statuses Proportions](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_rpo_statuses_proportions) diff --git a/docs/Get-ZARPOSummary.md b/docs/Get-ZARPOSummary.md index f6600cf..40756ee 100644 --- a/docs/Get-ZARPOSummary.md +++ b/docs/Get-ZARPOSummary.md @@ -1,107 +1,107 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAMonitoring.md -schema: 2.0.0 ---- - -# Get-ZARPOSummary - -## SYNOPSIS - -Retrieves RPO historical statistics for a given VPG. - -## SYNTAX - -``` -Get-ZARPOSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] -``` - -## DESCRIPTION - -Retrieves RPO historical statistics for a given VPG. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZARPOSummary -vpgIdentifier "3456-7890-1234" -``` - -Gets the RPO Summary for the VPG with identifier "3456-7890-1234" for the past 7 days. - -### Example 2 -```powershell -PS C:\> Get-ZARPOSummary -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -``` - -Gets the RPO Summary for the VPG with identifier "3456-7890-1234" starting January 1st, 2019 till the date this command is run. - -### Example 3 -```powershell -PS C:\> Get-ZARPOSummary -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -endDate "2019-02-01T00:00:00" -``` - -Gets the RPO Summary for the VPG with identifier "3456-7890-1234" for the Month of January. - -## PARAMETERS - -### -endDate -The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -The default is the current time. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If only the end date is added, the start date by default will be the end date minus 7 days. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The identifier of the VPG. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for RPO Summary](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_rpo_summary) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAMonitoring.md +schema: 2.0.0 +--- + +# Get-ZARPOSummary + +## SYNOPSIS + +Retrieves RPO historical statistics for a given VPG. + +## SYNTAX + +``` +Get-ZARPOSummary [-vpgIdentifier] [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION + +Retrieves RPO historical statistics for a given VPG. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZARPOSummary -vpgIdentifier "3456-7890-1234" +``` + +Gets the RPO Summary for the VPG with identifier "3456-7890-1234" for the past 7 days. + +### Example 2 +```powershell +PS C:\> Get-ZARPOSummary -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" +``` + +Gets the RPO Summary for the VPG with identifier "3456-7890-1234" starting January 1st, 2019 till the date this command is run. + +### Example 3 +```powershell +PS C:\> Get-ZARPOSummary -vpgIdentifier "3456-7890-1234" -startDate "2019-01-01T00:00:00" -endDate "2019-02-01T00:00:00" +``` + +Gets the RPO Summary for the VPG with identifier "3456-7890-1234" for the Month of January. + +## PARAMETERS + +### -endDate +The end date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +The default is the current time. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +The starting date of the report, in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If only the end date is added, the start date by default will be the end date minus 7 days. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The identifier of the VPG. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for RPO Summary](https://docs.api.zerto.com/#/RPO_Reports/get_v2_reports_rpo_summary) diff --git a/docs/Get-ZASite.md b/docs/Get-ZASite.md index 1b82595..ccc6c4b 100644 --- a/docs/Get-ZASite.md +++ b/docs/Get-ZASite.md @@ -1,69 +1,69 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZASite.md -schema: 2.0.0 ---- - -# Get-ZASite - -## SYNOPSIS - -Retrieve a list of all sites. - -## SYNTAX - -``` -Get-ZASite [[-zOrgIdentifier] ] [] -``` - -## DESCRIPTION - -Retrieve a list of all sites. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZASite -``` - -Retrieve a list of all sites. - -### Example 2 -```powershell -PS C:\> Get-ZASite -zOrgIdentifier "1234-5678-9012" -``` - -Retrieve a list of all sites managed under zOrgIdentifier "1234-5678-9012". - -## PARAMETERS - -### -zOrgIdentifier -The ZORG identifier by which to filter site list. -If the ZORG identifier is omitted, a list of all sites is retrieved. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Sites](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_sites) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZASite.md +schema: 2.0.0 +--- + +# Get-ZASite + +## SYNOPSIS + +Retrieve a list of all sites. + +## SYNTAX + +``` +Get-ZASite [[-zOrgIdentifier] ] [] +``` + +## DESCRIPTION + +Retrieve a list of all sites. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZASite +``` + +Retrieve a list of all sites. + +### Example 2 +```powershell +PS C:\> Get-ZASite -zOrgIdentifier "1234-5678-9012" +``` + +Retrieve a list of all sites managed under zOrgIdentifier "1234-5678-9012". + +## PARAMETERS + +### -zOrgIdentifier +The ZORG identifier by which to filter site list. +If the ZORG identifier is omitted, a list of all sites is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Sites](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_sites) diff --git a/docs/Get-ZASitePair.md b/docs/Get-ZASitePair.md index 081cf63..be1f53f 100644 --- a/docs/Get-ZASitePair.md +++ b/docs/Get-ZASitePair.md @@ -1,104 +1,104 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZASitePair.md -schema: 2.0.0 ---- - -# Get-ZASitePair - -## SYNOPSIS - -Get all the sites, protected and recovery, filtered by start date and end date. - -## SYNTAX - -``` -Get-ZASitePair [[-zOrgIdentifier] ] [[-startDate] ] [[-endDate] ] [] -``` - -## DESCRIPTION - -Get all the sites, protected and recovery, filtered by start date and end date. -* When startDate is omitted, the default startDate is 7 days before the endDate. -* When endDate is ommited, the default endDate is the current date. -* When both startDate and endDate are omitted, the default date range is the last 7 days. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZASitePair -``` - -Returns all site pairings. - -### Example 1 -```powershell -PS C:\> Get-ZASitePair -zOrgIdentifier "9876-5432-1098" -``` - -Returns all site pairings belonging to zOrg with Identifier "9876-5432-1098". - -## PARAMETERS - -### -endDate -End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the end date is omitted, the default endDate is the current date. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -startDate -Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). -If the start date is omitted, the default start date is 7 days before the end date. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -zOrgIdentifier -The ZORG identifier by which to filter the site list. -If the ZORG identifier is omitted, a list of all sites is retrieved. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Site Pairs](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_list) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZASitePair.md +schema: 2.0.0 +--- + +# Get-ZASitePair + +## SYNOPSIS + +Get all the sites, protected and recovery, filtered by start date and end date. + +## SYNTAX + +``` +Get-ZASitePair [[-zOrgIdentifier] ] [[-startDate] ] [[-endDate] ] [] +``` + +## DESCRIPTION + +Get all the sites, protected and recovery, filtered by start date and end date. +* When startDate is omitted, the default startDate is 7 days before the endDate. +* When endDate is ommited, the default endDate is the current date. +* When both startDate and endDate are omitted, the default date range is the last 7 days. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZASitePair +``` + +Returns all site pairings. + +### Example 1 +```powershell +PS C:\> Get-ZASitePair -zOrgIdentifier "9876-5432-1098" +``` + +Returns all site pairings belonging to zOrg with Identifier "9876-5432-1098". + +## PARAMETERS + +### -endDate +End date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the end date is omitted, the default endDate is the current date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -startDate +Start date in RFC 3339 standard ('1970-01-01T00:00:00Z'). +If the start date is omitted, the default start date is 7 days before the end date. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the site list. +If the ZORG identifier is omitted, a list of all sites is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Site Pairs](https://docs.api.zerto.com/#/Network_Reports/get_v2_reports_sites_list) diff --git a/docs/Get-ZASiteTopology.md b/docs/Get-ZASiteTopology.md index ba3bf39..93cc3de 100644 --- a/docs/Get-ZASiteTopology.md +++ b/docs/Get-ZASiteTopology.md @@ -1,70 +1,70 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZASiteTopology.md -schema: 2.0.0 ---- - -# Get-ZASiteTopology - -## SYNOPSIS - -Retrieves a collection of Sites topology information structures for all the available user's sites, including disabled and non-transmitting due to lack of a transmitter (older ZVR versions). - -## SYNTAX - -``` -Get-ZASiteTopology [[-zOrgIdentifier] ] [] -``` - -## DESCRIPTION - -Retrieves a collection of Sites topology information structures for all the available user's sites, including disabled and non-transmitting due to lack of a transmitter (older ZVR versions). | The following note should be taken into consideration: -The information might not be complete, since there are sites that do not transmit (disabled), yet this API concludes their presence and VPG count from the VPGs they share with transmitting sites. Such a disabled site might have relations with other disabled sites, which this API does not reveal. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZASiteTopology -``` - -Retrieves a collection of Sites topology information structures for all the available user's sites. - -### Example 2 -```powershell -PS C:\> Get-ZASiteTopology -zOrgIdentifier "1234-5678-9012" -``` - -Retrieves a collection of Sites topology information structures for all the available user's sites within zOrgIdentifier "1234-5678-9012". - -## PARAMETERS - -### -zOrgIdentifier -The ZORG identifier by which to filter sites topology list. -If the ZORG identifier is omitted, information related to all sites topology is retrieved. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Site Topology](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_sites_format_topology) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZASiteTopology.md +schema: 2.0.0 +--- + +# Get-ZASiteTopology + +## SYNOPSIS + +Retrieves a collection of Sites topology information structures for all the available user's sites, including disabled and non-transmitting due to lack of a transmitter (older ZVR versions). + +## SYNTAX + +``` +Get-ZASiteTopology [[-zOrgIdentifier] ] [] +``` + +## DESCRIPTION + +Retrieves a collection of Sites topology information structures for all the available user's sites, including disabled and non-transmitting due to lack of a transmitter (older ZVR versions). | The following note should be taken into consideration: +The information might not be complete, since there are sites that do not transmit (disabled), yet this API concludes their presence and VPG count from the VPGs they share with transmitting sites. Such a disabled site might have relations with other disabled sites, which this API does not reveal. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZASiteTopology +``` + +Retrieves a collection of Sites topology information structures for all the available user's sites. + +### Example 2 +```powershell +PS C:\> Get-ZASiteTopology -zOrgIdentifier "1234-5678-9012" +``` + +Retrieves a collection of Sites topology information structures for all the available user's sites within zOrgIdentifier "1234-5678-9012". + +## PARAMETERS + +### -zOrgIdentifier +The ZORG identifier by which to filter sites topology list. +If the ZORG identifier is omitted, information related to all sites topology is retrieved. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Site Topology](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_sites_format_topology) diff --git a/docs/Get-ZATask.md b/docs/Get-ZATask.md index d103415..e0bdbe7 100644 --- a/docs/Get-ZATask.md +++ b/docs/Get-ZATask.md @@ -1,112 +1,112 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZATask.md -schema: 2.0.0 ---- - -# Get-ZATask - -## SYNOPSIS - -Retrieve details of all existing tasks. - -## SYNTAX - -### zOrg (Default) -``` -Get-ZATask [-zOrgIdentifier ] [-limitTo ] [] -``` - -### taskId -``` -Get-ZATask -taskIdentifier [] -``` - -## DESCRIPTION - -Retrieve details of all existing tasks. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZATask -``` - -Retrieve details of all existing tasks. - -### Example 2 -```powershell -PS C:\> Get-ZATask -zOrgIdentifier "1234-5678-9012" -``` - -Retrieve details of all existing tasks for zOrg with Identifier "1234-5678-9012". - -### Example 1 -```powershell -PS C:\> Get-ZATask -taskIdentifier "9012-3456-7890" -``` - -Retrieve details of a specific task with identifier "9012-3456-7890". - -## PARAMETERS - -### -limitTo -The maximum number of tasks to return. - -```yaml -Type: Int32 -Parameter Sets: zOrg -Aliases: - -Required: False -Position: Named -Default value: 0 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -taskIdentifier -The task Idnetifier - -```yaml -Type: String -Parameter Sets: taskId -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -zOrgIdentifier -The ZORG identifier by which to filter the task list. -If the ZORG identifier is omitted, a list of all the tasks is retrieved. - -```yaml -Type: String -Parameter Sets: zOrg -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Tasks](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_tasks) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZATask.md +schema: 2.0.0 +--- + +# Get-ZATask + +## SYNOPSIS + +Retrieve details of all existing tasks. + +## SYNTAX + +### zOrg (Default) +``` +Get-ZATask [-zOrgIdentifier ] [-limitTo ] [] +``` + +### taskId +``` +Get-ZATask -taskIdentifier [] +``` + +## DESCRIPTION + +Retrieve details of all existing tasks. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZATask +``` + +Retrieve details of all existing tasks. + +### Example 2 +```powershell +PS C:\> Get-ZATask -zOrgIdentifier "1234-5678-9012" +``` + +Retrieve details of all existing tasks for zOrg with Identifier "1234-5678-9012". + +### Example 1 +```powershell +PS C:\> Get-ZATask -taskIdentifier "9012-3456-7890" +``` + +Retrieve details of a specific task with identifier "9012-3456-7890". + +## PARAMETERS + +### -limitTo +The maximum number of tasks to return. + +```yaml +Type: Int32 +Parameter Sets: zOrg +Aliases: + +Required: False +Position: Named +Default value: 0 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -taskIdentifier +The task Idnetifier + +```yaml +Type: String +Parameter Sets: taskId +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the task list. +If the ZORG identifier is omitted, a list of all the tasks is retrieved. + +```yaml +Type: String +Parameter Sets: zOrg +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Tasks](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_tasks) diff --git a/docs/Get-ZAVolume.md b/docs/Get-ZAVolume.md index 2eb0b78..a0030ff 100644 --- a/docs/Get-ZAVolume.md +++ b/docs/Get-ZAVolume.md @@ -1,137 +1,137 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAVolume.md -schema: 2.0.0 ---- - -# Get-ZAVolume - -## SYNOPSIS - -Retrieves account volumes by datastore. Enter a site identifier and cluster identifier to get the list of volumes that exist in the datastore cluster. Or, enter a site identifier and datastore identifier to get the list of volumes that exist in the datastore. To retrieve all volumes for a specific VPG, enter a VPG identifier only. - -## SYNTAX - -### VpgIdentifier (Default) -``` -Get-ZAVolume -vpgIdentifier [] -``` - -### SiteAndDatastoreIdentifier -``` -Get-ZAVolume -siteIdentifier -datastoreIdentifier [] -``` - -### SiteAndClusterIdentifier -``` -Get-ZAVolume -siteIdentifier -clusterIdentifier [] -``` - -## DESCRIPTION - -Retrieves account volumes by datastore. Enter a site identifier and cluster identifier to get the list of volumes that exist in the datastore cluster. Or, enter a site identifier and datastore identifier to get the list of volumes that exist in the datastore. To retrieve all volumes for a specific VPG, enter a VPG identifier only. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAVolume -vpgIdentifier "2345-6789-0123" -``` - -Returns all volume information for all VMs in VPG with Identifier "2345-6789-0123" - -### Example 2 -```powershell -PS C:\> Get-ZAVolume -siteIdentifier "3456-7890-1234" -clusterIdentifier "0123-4567-8901" -``` - -Returns all volume information for all volumes in Site with Identifier "3456-7890-1234" on Datastore Cluster with Identifier "0123-4567-8901" - -### Example 3 -```powershell -PS C:\> Get-ZAVolume -siteIdentifier "3456-7890-1234" -datastoreIdentifier "5678-9012-3456" -``` - -Returns all volume information for all volumes in Site with Identifier "3456-7890-1234" on Datastore with Identifier "5678-9012-3456" - -## PARAMETERS - -### -clusterIdentifier -The cluster identifier. -If a cluster identifier is not entered, you must enter a datastore identifier. - -```yaml -Type: String -Parameter Sets: SiteAndClusterIdentifier -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -datastoreIdentifier -The datastore identifer. -If a datastore identifier is not entered, you must enter a cluster identifier. - -```yaml -Type: String -Parameter Sets: SiteAndDatastoreIdentifier -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -siteIdentifier -The site identifier. -The site identifier is mandatory if vpgIdentifier is not entered. - -```yaml -Type: String -Parameter Sets: SiteAndDatastoreIdentifier, SiteAndClusterIdentifier -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -vpgIdentifier -The vpg identifer. - -```yaml -Type: String -Parameter Sets: VpgIdentifier -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### None - -## OUTPUTS - -### System.Object -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for Volumes](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_volumes) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAVolume.md +schema: 2.0.0 +--- + +# Get-ZAVolume + +## SYNOPSIS + +Retrieves account volumes by datastore. Enter a site identifier and cluster identifier to get the list of volumes that exist in the datastore cluster. Or, enter a site identifier and datastore identifier to get the list of volumes that exist in the datastore. To retrieve all volumes for a specific VPG, enter a VPG identifier only. + +## SYNTAX + +### VpgIdentifier (Default) +``` +Get-ZAVolume -vpgIdentifier [] +``` + +### SiteAndDatastoreIdentifier +``` +Get-ZAVolume -siteIdentifier -datastoreIdentifier [] +``` + +### SiteAndClusterIdentifier +``` +Get-ZAVolume -siteIdentifier -clusterIdentifier [] +``` + +## DESCRIPTION + +Retrieves account volumes by datastore. Enter a site identifier and cluster identifier to get the list of volumes that exist in the datastore cluster. Or, enter a site identifier and datastore identifier to get the list of volumes that exist in the datastore. To retrieve all volumes for a specific VPG, enter a VPG identifier only. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAVolume -vpgIdentifier "2345-6789-0123" +``` + +Returns all volume information for all VMs in VPG with Identifier "2345-6789-0123" + +### Example 2 +```powershell +PS C:\> Get-ZAVolume -siteIdentifier "3456-7890-1234" -clusterIdentifier "0123-4567-8901" +``` + +Returns all volume information for all volumes in Site with Identifier "3456-7890-1234" on Datastore Cluster with Identifier "0123-4567-8901" + +### Example 3 +```powershell +PS C:\> Get-ZAVolume -siteIdentifier "3456-7890-1234" -datastoreIdentifier "5678-9012-3456" +``` + +Returns all volume information for all volumes in Site with Identifier "3456-7890-1234" on Datastore with Identifier "5678-9012-3456" + +## PARAMETERS + +### -clusterIdentifier +The cluster identifier. +If a cluster identifier is not entered, you must enter a datastore identifier. + +```yaml +Type: String +Parameter Sets: SiteAndClusterIdentifier +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -datastoreIdentifier +The datastore identifer. +If a datastore identifier is not entered, you must enter a cluster identifier. + +```yaml +Type: String +Parameter Sets: SiteAndDatastoreIdentifier +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -siteIdentifier +The site identifier. +The site identifier is mandatory if vpgIdentifier is not entered. + +```yaml +Type: String +Parameter Sets: SiteAndDatastoreIdentifier, SiteAndClusterIdentifier +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +The vpg identifer. + +```yaml +Type: String +Parameter Sets: VpgIdentifier +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for Volumes](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_volumes) diff --git a/docs/Get-ZAVpg.md b/docs/Get-ZAVpg.md index 39d11e8..d8f207f 100644 --- a/docs/Get-ZAVpg.md +++ b/docs/Get-ZAVpg.md @@ -1,98 +1,98 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAVpg.md -schema: 2.0.0 ---- - -# Get-ZAVpg - -## SYNOPSIS - -Retrieve a list of all VPGs. - -## SYNTAX - -### zOrg (Default) -``` -Get-ZAVpg [-zOrgIdentifier ] [] -``` - -### vpg -``` -Get-ZAVpg -vpgIdentifier [] -``` - -## DESCRIPTION - -Retrieve a list of all VPGs. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAVpg -``` - -Retrieve a list of all VPGs. - -### Example 2 -```powershell -PS C:\> Get-ZAVpg -zOrgIdentifier "1234-5678-9012" -``` - -Retrieve a list of all VPGs associated with zOrg "1234-5678-9012" - -### Example 3 -```powershell -PS C:\> Get-ZAVpg -vpgIdentifier "2109-8765-4321" -``` - -Retrieve information for VPG with identifier "2109-8765-4321" - -## PARAMETERS - -### -vpgIdentifier -The VPG Identifier - -```yaml -Type: String -Parameter Sets: vpg -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -zOrgIdentifier -The ZORG identifier by which to filter the VPG list. -If the ZORG identifier is omitted, a list of all VPGs is retrieved. - -```yaml -Type: String -Parameter Sets: zOrg -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for VPGs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_vpgs) -[Zerto Analytics REST API Endpoint for VPG Identifier](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_vpgs__vpgIdentifier_) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAVpg.md +schema: 2.0.0 +--- + +# Get-ZAVpg + +## SYNOPSIS + +Retrieve a list of all VPGs. + +## SYNTAX + +### zOrg (Default) +``` +Get-ZAVpg [-zOrgIdentifier ] [] +``` + +### vpg +``` +Get-ZAVpg -vpgIdentifier [] +``` + +## DESCRIPTION + +Retrieve a list of all VPGs. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAVpg +``` + +Retrieve a list of all VPGs. + +### Example 2 +```powershell +PS C:\> Get-ZAVpg -zOrgIdentifier "1234-5678-9012" +``` + +Retrieve a list of all VPGs associated with zOrg "1234-5678-9012" + +### Example 3 +```powershell +PS C:\> Get-ZAVpg -vpgIdentifier "2109-8765-4321" +``` + +Retrieve information for VPG with identifier "2109-8765-4321" + +## PARAMETERS + +### -vpgIdentifier +The VPG Identifier + +```yaml +Type: String +Parameter Sets: vpg +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zOrgIdentifier +The ZORG identifier by which to filter the VPG list. +If the ZORG identifier is omitted, a list of all VPGs is retrieved. + +```yaml +Type: String +Parameter Sets: zOrg +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for VPGs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_vpgs) +[Zerto Analytics REST API Endpoint for VPG Identifier](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_vpgs__vpgIdentifier_) diff --git a/docs/Get-ZAzOrg.md b/docs/Get-ZAzOrg.md index b9f3c29..e6eb02c 100644 --- a/docs/Get-ZAzOrg.md +++ b/docs/Get-ZAzOrg.md @@ -1,46 +1,46 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAzOrg.md -schema: 2.0.0 ---- - -# Get-ZAzOrg - -## SYNOPSIS - -Retrieve a list of all ZORGs. - -## SYNTAX - -``` -Get-ZAzOrg [] -``` - -## DESCRIPTION - -Retrieve a list of all ZORGs. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-ZAzOrg -``` - -Retrieve a list of all ZORGs. - -## PARAMETERS - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics REST API Endpoint for ZOrgs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_zorgs) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAzOrg.md +schema: 2.0.0 +--- + +# Get-ZAzOrg + +## SYNOPSIS + +Retrieve a list of all ZORGs. + +## SYNTAX + +``` +Get-ZAzOrg [] +``` + +## DESCRIPTION + +Retrieve a list of all ZORGs. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-ZAzOrg +``` + +Retrieve a list of all ZORGs. + +## PARAMETERS + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics REST API Endpoint for ZOrgs](https://docs.api.zerto.com/#/Monitoring/get_v2_monitoring_zorgs) diff --git a/docs/Get-ZertoAlert.md b/docs/Get-ZertoAlert.md index bd9c944..8df174b 100644 --- a/docs/Get-ZertoAlert.md +++ b/docs/Get-ZertoAlert.md @@ -295,7 +295,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoDatastore.md b/docs/Get-ZertoDatastore.md index fca78f7..d3bc777 100644 --- a/docs/Get-ZertoDatastore.md +++ b/docs/Get-ZertoDatastore.md @@ -59,7 +59,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoEvent.md b/docs/Get-ZertoEvent.md index 390fa2e..79b37d7 100644 --- a/docs/Get-ZertoEvent.md +++ b/docs/Get-ZertoEvent.md @@ -338,7 +338,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoLicense.md b/docs/Get-ZertoLicense.md index 8bcae17..74ca60b 100644 --- a/docs/Get-ZertoLicense.md +++ b/docs/Get-ZertoLicense.md @@ -31,7 +31,7 @@ Retrieve information about a Zerto Virtual Replication license. ## PARAMETERS ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoLocalSite.md b/docs/Get-ZertoLocalSite.md index a8ecfe3..b094547 100644 --- a/docs/Get-ZertoLocalSite.md +++ b/docs/Get-ZertoLocalSite.md @@ -46,7 +46,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoPeerSite.md b/docs/Get-ZertoPeerSite.md index aa86c0c..828031b 100644 --- a/docs/Get-ZertoPeerSite.md +++ b/docs/Get-ZertoPeerSite.md @@ -162,7 +162,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoProtectedVm.md b/docs/Get-ZertoProtectedVm.md index abf2699..ec1172a 100644 --- a/docs/Get-ZertoProtectedVm.md +++ b/docs/Get-ZertoProtectedVm.md @@ -237,7 +237,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoRecoveryReport.md b/docs/Get-ZertoRecoveryReport.md index 9948bf3..d316621 100644 --- a/docs/Get-ZertoRecoveryReport.md +++ b/docs/Get-ZertoRecoveryReport.md @@ -159,7 +159,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoResourcesReport.md b/docs/Get-ZertoResourcesReport.md index 5cfdf74..ab0476f 100644 --- a/docs/Get-ZertoResourcesReport.md +++ b/docs/Get-ZertoResourcesReport.md @@ -304,7 +304,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoServiceProfile.md b/docs/Get-ZertoServiceProfile.md index b697bc4..174ae17 100644 --- a/docs/Get-ZertoServiceProfile.md +++ b/docs/Get-ZertoServiceProfile.md @@ -72,7 +72,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoTask.md b/docs/Get-ZertoTask.md index 910a8eb..e8e1410 100644 --- a/docs/Get-ZertoTask.md +++ b/docs/Get-ZertoTask.md @@ -185,7 +185,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoUnprotectedVm.md b/docs/Get-ZertoUnprotectedVm.md index 3e35e12..5da328b 100644 --- a/docs/Get-ZertoUnprotectedVm.md +++ b/docs/Get-ZertoUnprotectedVm.md @@ -31,7 +31,7 @@ Returns all virtual machines at the site not currently protected in a virtual pr ## PARAMETERS ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoVirtualizationSite.md b/docs/Get-ZertoVirtualizationSite.md index 68ec140..815019c 100644 --- a/docs/Get-ZertoVirtualizationSite.md +++ b/docs/Get-ZertoVirtualizationSite.md @@ -271,7 +271,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoVolume.md b/docs/Get-ZertoVolume.md index 3725af4..57c5d8e 100644 --- a/docs/Get-ZertoVolume.md +++ b/docs/Get-ZertoVolume.md @@ -128,7 +128,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoVpg.md b/docs/Get-ZertoVpg.md index 4010c9b..f453476 100644 --- a/docs/Get-ZertoVpg.md +++ b/docs/Get-ZertoVpg.md @@ -496,7 +496,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoVpgSetting.md b/docs/Get-ZertoVpgSetting.md index fd06803..8b671cc 100644 --- a/docs/Get-ZertoVpgSetting.md +++ b/docs/Get-ZertoVpgSetting.md @@ -424,7 +424,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoVra.md b/docs/Get-ZertoVra.md index d46d9e1..c2c8325 100644 --- a/docs/Get-ZertoVra.md +++ b/docs/Get-ZertoVra.md @@ -241,7 +241,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoZorg.md b/docs/Get-ZertoZorg.md index e7170c0..ebd30f9 100644 --- a/docs/Get-ZertoZorg.md +++ b/docs/Get-ZertoZorg.md @@ -59,7 +59,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Get-ZertoZsspSession.md b/docs/Get-ZertoZsspSession.md index 0171f34..487e2eb 100644 --- a/docs/Get-ZertoZsspSession.md +++ b/docs/Get-ZertoZsspSession.md @@ -52,7 +52,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Import-ZertoVmNicSetting.md b/docs/Import-ZertoVmNicSetting.md index 5cbf276..66876dc 100644 --- a/docs/Import-ZertoVmNicSetting.md +++ b/docs/Import-ZertoVmNicSetting.md @@ -1,96 +1,96 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVmNicSetting.md -schema: 2.0.0 ---- - -# Import-ZertoVmNicSetting - -## SYNOPSIS -Using a CSV file, will import updated Live and Test network settings for protected virtual machines. - -## SYNTAX - -``` -Import-ZertoVmNicSetting [-InputFile] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -Using a CSV file, will import updated Live and Test network settings for protected virtual machines. This function will read the provided CSV file and only update VMs defined in the file. - -Each entry in the CSV will be for one VM and a single NIC attached to that VM. Each entry MUST contain the following information: VPG Name, VM Name, Network Adapter Name, Mac Address Update for both Live and Test, and Network Name for both Live and Test. All other information is optional, but will be applied based on the following logic: - * If 'IsDhcp' is set to 'TRUE', the NIC setting will be set to DHCP and Primary DNS, Secondary DNS, and Search Domain settings will be applied along with the mandatory fields. - * If 'IsDhcp' is set to 'FALSE' or not set and there is an IP Address defined, the IP Address, Subnet Mask, Default Gateway, Primary DNS, Secondary DNS, and Search Domain settings will be applied along with the mandatory fields. - * if 'IsDhcp' is set to 'FALSE' or not set and there is NOT an IP Address defined, the current NIC settings will be removed and ONLY the mandatory fields will be applied. - -This logic is applied to both the Live and Test settings individually. It is recommended to use the `Export-ZertoVpgNicSetting` to dump all current settings and then modify a copy of the exported file with only the settings you wish to update. Import the copied file and if you need to revert, Import the original. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Import-ZertoVmNicSetting -InputFile 'C:\ZertoScripts\UpdatedNicInformation.csv' -``` - -Imports the data in the CSV located at 'C:\ZertoScripts\UpdatedNicInformation.csv' and updates each VM and each NIC as defined in the CSV file. - -## PARAMETERS - -### -InputFile -File to process for import - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Virtual Manager REST API VpgSettings end point documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.110.html%23) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVmNicSetting.md +schema: 2.0.0 +--- + +# Import-ZertoVmNicSetting + +## SYNOPSIS +Using a CSV file, will import updated Live and Test network settings for protected virtual machines. + +## SYNTAX + +``` +Import-ZertoVmNicSetting [-InputFile] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Using a CSV file, will import updated Live and Test network settings for protected virtual machines. This function will read the provided CSV file and only update VMs defined in the file. + +Each entry in the CSV will be for one VM and a single NIC attached to that VM. Each entry MUST contain the following information: VPG Name, VM Name, Network Adapter Name, Mac Address Update for both Live and Test, and Network Name for both Live and Test. All other information is optional, but will be applied based on the following logic: + * If 'IsDhcp' is set to 'TRUE', the NIC setting will be set to DHCP and Primary DNS, Secondary DNS, and Search Domain settings will be applied along with the mandatory fields. + * If 'IsDhcp' is set to 'FALSE' or not set and there is an IP Address defined, the IP Address, Subnet Mask, Default Gateway, Primary DNS, Secondary DNS, and Search Domain settings will be applied along with the mandatory fields. + * if 'IsDhcp' is set to 'FALSE' or not set and there is NOT an IP Address defined, the current NIC settings will be removed and ONLY the mandatory fields will be applied. + +This logic is applied to both the Live and Test settings individually. It is recommended to use the `Export-ZertoVpgNicSetting` to dump all current settings and then modify a copy of the exported file with only the settings you wish to update. Import the copied file and if you need to revert, Import the original. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Import-ZertoVmNicSetting -InputFile 'C:\ZertoScripts\UpdatedNicInformation.csv' +``` + +Imports the data in the CSV located at 'C:\ZertoScripts\UpdatedNicInformation.csv' and updates each VM and each NIC as defined in the CSV file. + +## PARAMETERS + +### -InputFile +File to process for import + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Virtual Manager REST API VpgSettings end point documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.110.html%23) diff --git a/docs/Import-ZertoVpg.md b/docs/Import-ZertoVpg.md index dcb275b..979a347 100644 --- a/docs/Import-ZertoVpg.md +++ b/docs/Import-ZertoVpg.md @@ -46,7 +46,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Install-ZertoVra.md b/docs/Install-ZertoVra.md index 9ff8e52..b9b6136 100644 --- a/docs/Install-ZertoVra.md +++ b/docs/Install-ZertoVra.md @@ -273,7 +273,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZARestRequest.md b/docs/Invoke-ZARestRequest.md index 692a799..cad1b96 100644 --- a/docs/Invoke-ZARestRequest.md +++ b/docs/Invoke-ZARestRequest.md @@ -1,100 +1,100 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZARestRequest.md -schema: 2.0.0 ---- - -# Invoke-ZARestRequest - -## SYNOPSIS -Function used to submit a REST request to the Zerto Analytics Portal. Should be used when attempting to submit a request inside a ZertoApiWrapper function or if attempting to perform an operation not currently covered in a ZertoApiWrapper function. - -## SYNTAX - -``` -Invoke-ZARestRequest [-uri] [[-method] ] [[-body] ] [] -``` - -## DESCRIPTION -Function used to submit a REST request to the Zerto Analytics Portal. Should be used when attempting to submit a request inside a ZertoApiWrapper function or if attempting to perform an operation not currently covered in a ZertoApiWrapper function. To function properly, you will have to have completed a connection to a Zerto Virtual Manager with the `Connect-ZertoAnalytics` function. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method GET -``` - -Submits a GET request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint'. Check the API documentation for the endpoint to ensure the URI is formatted correctly. Typically a GET request does not require a BODY parameter. - -### Example 1 -```powershell -PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method POST -Body $Body -``` - -Submits a PUT request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint' with a Body parameter. Check the API documentation for the endpoint to ensure the URI is formatted correctly and the format of the Body variable. The command above assumes that the $Body variable is an object that can be formatted into JSON. - -## PARAMETERS - -### -body -Body to be submitted to the REST API endpoint. -This needs to be submitted in JSON format - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -method -API method to be used. -GET, PUT, POST, or DELETE. -Refer to documentation for the API endpoint to ensure the correct method is being used. -If unspecified, defaults to GET - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: GET -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -uri -Parameter help description - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Analytics API Endpoint Documentation](https://docs.api.zerto.com/) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZARestRequest.md +schema: 2.0.0 +--- + +# Invoke-ZARestRequest + +## SYNOPSIS +Function used to submit a REST request to the Zerto Analytics Portal. Should be used when attempting to submit a request inside a ZertoApiWrapper function or if attempting to perform an operation not currently covered in a ZertoApiWrapper function. + +## SYNTAX + +``` +Invoke-ZARestRequest [-uri] [[-method] ] [[-body] ] [] +``` + +## DESCRIPTION +Function used to submit a REST request to the Zerto Analytics Portal. Should be used when attempting to submit a request inside a ZertoApiWrapper function or if attempting to perform an operation not currently covered in a ZertoApiWrapper function. To function properly, you will have to have completed a connection to a Zerto Virtual Manager with the `Connect-ZertoAnalytics` function. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method GET +``` + +Submits a GET request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint'. Check the API documentation for the endpoint to ensure the URI is formatted correctly. Typically a GET request does not require a BODY parameter. + +### Example 1 +```powershell +PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method POST -Body $Body +``` + +Submits a PUT request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint' with a Body parameter. Check the API documentation for the endpoint to ensure the URI is formatted correctly and the format of the Body variable. The command above assumes that the $Body variable is an object that can be formatted into JSON. + +## PARAMETERS + +### -body +Body to be submitted to the REST API endpoint. +This needs to be submitted in JSON format + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -method +API method to be used. +GET, PUT, POST, or DELETE. +Refer to documentation for the API endpoint to ensure the correct method is being used. +If unspecified, defaults to GET + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 2 +Default value: GET +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -uri +Parameter help description + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Analytics API Endpoint Documentation](https://docs.api.zerto.com/) diff --git a/docs/Invoke-ZertoEvacuateVra.md b/docs/Invoke-ZertoEvacuateVra.md index 1e01d75..aa0b2e9 100644 --- a/docs/Invoke-ZertoEvacuateVra.md +++ b/docs/Invoke-ZertoEvacuateVra.md @@ -134,7 +134,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoFailover.md b/docs/Invoke-ZertoFailover.md index 974948b..ac68d01 100644 --- a/docs/Invoke-ZertoFailover.md +++ b/docs/Invoke-ZertoFailover.md @@ -194,7 +194,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoFailoverCommit.md b/docs/Invoke-ZertoFailoverCommit.md index b9d302f..f7876b3 100644 --- a/docs/Invoke-ZertoFailoverCommit.md +++ b/docs/Invoke-ZertoFailoverCommit.md @@ -98,7 +98,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoFailoverRollback.md b/docs/Invoke-ZertoFailoverRollback.md index 2abb482..8757c40 100644 --- a/docs/Invoke-ZertoFailoverRollback.md +++ b/docs/Invoke-ZertoFailoverRollback.md @@ -50,7 +50,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoForceSync.md b/docs/Invoke-ZertoForceSync.md index 75826b4..a124bb3 100644 --- a/docs/Invoke-ZertoForceSync.md +++ b/docs/Invoke-ZertoForceSync.md @@ -46,7 +46,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoMove.md b/docs/Invoke-ZertoMove.md index 88065f0..420088e 100644 --- a/docs/Invoke-ZertoMove.md +++ b/docs/Invoke-ZertoMove.md @@ -188,7 +188,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoMoveCommit.md b/docs/Invoke-ZertoMoveCommit.md index 72c687e..08c6e92 100644 --- a/docs/Invoke-ZertoMoveCommit.md +++ b/docs/Invoke-ZertoMoveCommit.md @@ -108,7 +108,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoMoveRollback.md b/docs/Invoke-ZertoMoveRollback.md index 34f3fa2..2229cc1 100644 --- a/docs/Invoke-ZertoMoveRollback.md +++ b/docs/Invoke-ZertoMoveRollback.md @@ -76,7 +76,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Invoke-ZertoRestRequest.md b/docs/Invoke-ZertoRestRequest.md index bc14634..fb28ad2 100644 --- a/docs/Invoke-ZertoRestRequest.md +++ b/docs/Invoke-ZertoRestRequest.md @@ -1,154 +1,154 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZertoRestRequest.md -schema: 2.0.0 ---- - -# Invoke-ZertoRestRequest - -## SYNOPSIS -Function used to submit a REST request to the Zerto Virtual Manager. Should be used when attempting to submit a request inside a ZertoApiWrapper function or if attempting to perform an operation not currently covered in a ZertoApiWrapper function. - -## SYNTAX - -``` -Invoke-ZertoRestRequest [[-method] ] [-uri] [[-body] ] [[-credential] ] - [-returnHeaders] [] -``` - -## DESCRIPTION -Function used to submit a REST request to the Zerto Virtual Manager. Should be used when attempting to submit a request inside a ZertoApiWrapper function or if attempting to perform an operation not currently covered in a ZertoApiWrapper function. To function properly, you will have to have completed a connection to a Zerto Virtual Manager with the `Connect-ZertoServer` function. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method POST -Body $Body -``` - -Submits a POST request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint' with a Body parameter. Check the API documentation for the endpoint to ensure the URI is formatted correctly and the format of the Body variable. The command above assumes that the $Body variable is a string properly formatted for JSON - -### Example 2 -```powershell -PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method POST -Body ($Body | ConvertTo-Json) -``` - -Submits a POST request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint' with a Body parameter. Check the API documentation for the endpoint to ensure the URI is formatted correctly and the format of the Body variable. The command above assumes that the $Body variable is an object that can be formatted into JSON. - -### Example 3 -```powershell -PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method PUT -Body $Body -``` - -Submits a PUT request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint' with a Body parameter. Check the API documentation for the endpoint to ensure the URI is formatted correctly and the format of the Body variable. The command above assumes that the $Body variable is a string properly formatted for JSON - -### Example 4 -```powershell -PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method DELETE -``` - -Submits a DELETE request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint'. Check the API documentation for the endpoint to ensure the URI is formatted correctly. Typically a DELETE request does not require a BODY parameter. - -### Example 5 -```powershell -PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method GET -``` - -Submits a GET request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint'. Check the API documentation for the endpoint to ensure the URI is formatted correctly. Typically a GET request does not require a BODY parameter. - -## PARAMETERS - -### -body -Body to be submitted to the REST API endpoint. -This needs to be submitted in JSON format - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -credential -PSCredential object. -This is ONLY used when authenticating with the ZVM. -No other endpoints require this and generally is not used. - -```yaml -Type: PSCredential -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -method -Parameter help description - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: GET -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -returnHeaders -Use this switch if you would like the request headers returned along with the body. -Useful for troubleshooting to get HTTP error codes. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -uri -URI endpoint to be utilized. -When submitting the URI, only the endpoint needs to be submitted. -Please review the help documentation for examples. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Virtual Replication API Endpoint Documentation](https://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20(ZVM)%20-%20vSphere%20Online%20Help/content/intro/book_in_portal_-_zvr_restful_apis.htm) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Invoke-ZertoRestRequest.md +schema: 2.0.0 +--- + +# Invoke-ZertoRestRequest + +## SYNOPSIS +Function used to submit a REST request to the Zerto Virtual Manager. Should be used when attempting to submit a request inside a ZertoApiWrapper function or if attempting to perform an operation not currently covered in a ZertoApiWrapper function. + +## SYNTAX + +``` +Invoke-ZertoRestRequest [[-method] ] [-uri] [[-body] ] [[-credential] ] + [-returnHeaders] [] +``` + +## DESCRIPTION +Function used to submit a REST request to the Zerto Virtual Manager. Should be used when attempting to submit a request inside a ZertoApiWrapper function or if attempting to perform an operation not currently covered in a ZertoApiWrapper function. To function properly, you will have to have completed a connection to a Zerto Virtual Manager with the `Connect-ZertoServer` function. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method POST -Body $Body +``` + +Submits a POST request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint' with a Body parameter. Check the API documentation for the endpoint to ensure the URI is formatted correctly and the format of the Body variable. The command above assumes that the $Body variable is a string properly formatted for JSON + +### Example 2 +```powershell +PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method POST -Body ($Body | ConvertTo-Json) +``` + +Submits a POST request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint' with a Body parameter. Check the API documentation for the endpoint to ensure the URI is formatted correctly and the format of the Body variable. The command above assumes that the $Body variable is an object that can be formatted into JSON. + +### Example 3 +```powershell +PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method PUT -Body $Body +``` + +Submits a PUT request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint' with a Body parameter. Check the API documentation for the endpoint to ensure the URI is formatted correctly and the format of the Body variable. The command above assumes that the $Body variable is a string properly formatted for JSON + +### Example 4 +```powershell +PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method DELETE +``` + +Submits a DELETE request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint'. Check the API documentation for the endpoint to ensure the URI is formatted correctly. Typically a DELETE request does not require a BODY parameter. + +### Example 5 +```powershell +PS C:\> Invoke-ZertoRestRequest -uri 'apiEndpoint/subApiEndpoint' -Method GET +``` + +Submits a GET request to the connected Zerto Virtual Manager api endpoint 'apiEndpoint/subApiEndpoint'. Check the API documentation for the endpoint to ensure the URI is formatted correctly. Typically a GET request does not require a BODY parameter. + +## PARAMETERS + +### -body +Body to be submitted to the REST API endpoint. +This needs to be submitted in JSON format + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 3 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -credential +PSCredential object. +This is ONLY used when authenticating with the ZVM. +No other endpoints require this and generally is not used. + +```yaml +Type: PSCredential +Parameter Sets: (All) +Aliases: + +Required: False +Position: 4 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -method +Parameter help description + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: False +Position: 1 +Default value: GET +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -returnHeaders +Use this switch if you would like the request headers returned along with the body. +Useful for troubleshooting to get HTTP error codes. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -uri +URI endpoint to be utilized. +When submitting the URI, only the endpoint needs to be submitted. +Please review the help documentation for examples. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Virtual Replication API Endpoint Documentation](https://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20(ZVM)%20-%20vSphere%20Online%20Help/content/intro/book_in_portal_-_zvr_restful_apis.htm) diff --git a/docs/New-ZertoPairingToken.md b/docs/New-ZertoPairingToken.md index 7da1436..53454d2 100644 --- a/docs/New-ZertoPairingToken.md +++ b/docs/New-ZertoPairingToken.md @@ -1,78 +1,78 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/New-ZertoPairingToken.md -schema: 2.0.0 ---- - -# New-ZertoPairingToken - -## SYNOPSIS -Generates a new pairing token to be used during pairing ZVM to ZVM operations. - -## SYNTAX - -``` -New-ZertoPairingToken [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -Generates a new pairing token to be used during pairing ZVM to ZVM operations. This token is valid until used or 48 hours have passed, whichever comes first. This feature is only required when pairing two Zerto sites that are both operating Zerto version 7.5 or greater. To use this feature you will need to generate a pairing token from the destination site. Once that token is generated you will use that token to pair the source site to the destination site either via the GUI or via the `Add-ZertoPeerSite` function. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> New-ZertoPairingToken -``` - -Generates an object that will contain the pairing token and expiration date and time. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### None - -## OUTPUTS - -### System.Object -## NOTES - -## RELATED LINKS - -[Zerto REST API Peer Sites End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.046.html%23) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/New-ZertoPairingToken.md +schema: 2.0.0 +--- + +# New-ZertoPairingToken + +## SYNOPSIS +Generates a new pairing token to be used during pairing ZVM to ZVM operations. + +## SYNTAX + +``` +New-ZertoPairingToken [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Generates a new pairing token to be used during pairing ZVM to ZVM operations. This token is valid until used or 48 hours have passed, whichever comes first. This feature is only required when pairing two Zerto sites that are both operating Zerto version 7.5 or greater. To use this feature you will need to generate a pairing token from the destination site. Once that token is generated you will use that token to pair the source site to the destination site either via the GUI or via the `Add-ZertoPeerSite` function. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> New-ZertoPairingToken +``` + +Generates an object that will contain the pairing token and expiration date and time. + +## PARAMETERS + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS + +[Zerto REST API Peer Sites End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.046.html%23) diff --git a/docs/New-ZertoVpg.md b/docs/New-ZertoVpg.md index 29b6a7c..c288dbd 100644 --- a/docs/New-ZertoVpg.md +++ b/docs/New-ZertoVpg.md @@ -523,7 +523,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/New-ZertoVpgSettingsIdentifier.md b/docs/New-ZertoVpgSettingsIdentifier.md index 3e33a82..8128a62 100644 --- a/docs/New-ZertoVpgSettingsIdentifier.md +++ b/docs/New-ZertoVpgSettingsIdentifier.md @@ -106,7 +106,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Remove-ZertoPeerSite.md b/docs/Remove-ZertoPeerSite.md index bfedef0..a42c84b 100644 --- a/docs/Remove-ZertoPeerSite.md +++ b/docs/Remove-ZertoPeerSite.md @@ -150,7 +150,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Remove-ZertoVpg.md b/docs/Remove-ZertoVpg.md index f83b9a8..c365cd7 100644 --- a/docs/Remove-ZertoVpg.md +++ b/docs/Remove-ZertoVpg.md @@ -162,7 +162,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Remove-ZertoVpgSettingsIdentifier.md b/docs/Remove-ZertoVpgSettingsIdentifier.md index afaf640..17eb3c7 100644 --- a/docs/Remove-ZertoVpgSettingsIdentifier.md +++ b/docs/Remove-ZertoVpgSettingsIdentifier.md @@ -1,90 +1,90 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Resume-ZertoVpgSettingsIdentifier.md -schema: 2.0.0 ---- - -# Remove-ZertoVpgSettingsIdentifier - -## SYNOPSIS -When a new VpgSettingsIdentifier is created, all the settings sit in memory for 30 minutes after the last change. This operation will delete the settings from memory and discard any changes. This is akin to clicking cancel on the VPG Edit Wizard screen. - -## SYNTAX - -``` -Remove-ZertoVpgSettingsIdentifier [-vpgSettingsIdentifier] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -When a new VpgSettingsIdentifier is created, all the settings sit in memory for 30 minutes after the last change. This operation will delete the settings from memory and discard any changes. This is akin to clicking cancel on the VPG Edit Wizard screen. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Remove-ZertoVpgSettingsIdentifier -vpgSettingsIdentifier "1234-7890-5678" -``` - -Removes VPG Settings Identifier "1234-7890-5678" from the Zerto Virtual Manager without applying any settings that may have changed. - -## PARAMETERS - -### -vpgSettingsIdentifier -Settings Identifier to Remove - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Zerto Rest API VPG Settings End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.118.html%23) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Resume-ZertoVpgSettingsIdentifier.md +schema: 2.0.0 +--- + +# Remove-ZertoVpgSettingsIdentifier + +## SYNOPSIS +When a new VpgSettingsIdentifier is created, all the settings sit in memory for 30 minutes after the last change. This operation will delete the settings from memory and discard any changes. This is akin to clicking cancel on the VPG Edit Wizard screen. + +## SYNTAX + +``` +Remove-ZertoVpgSettingsIdentifier [-vpgSettingsIdentifier] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +When a new VpgSettingsIdentifier is created, all the settings sit in memory for 30 minutes after the last change. This operation will delete the settings from memory and discard any changes. This is akin to clicking cancel on the VPG Edit Wizard screen. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Remove-ZertoVpgSettingsIdentifier -vpgSettingsIdentifier "1234-7890-5678" +``` + +Removes VPG Settings Identifier "1234-7890-5678" from the Zerto Virtual Manager without applying any settings that may have changed. + +## PARAMETERS + +### -vpgSettingsIdentifier +Settings Identifier to Remove + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[Zerto Rest API VPG Settings End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.118.html%23) diff --git a/docs/Resume-ZertoVpg.md b/docs/Resume-ZertoVpg.md index 414a2c2..6e52056 100644 --- a/docs/Resume-ZertoVpg.md +++ b/docs/Resume-ZertoVpg.md @@ -46,7 +46,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Save-ZertoVpgSetting.md b/docs/Save-ZertoVpgSetting.md index 141f0d0..cd2cc59 100644 --- a/docs/Save-ZertoVpgSetting.md +++ b/docs/Save-ZertoVpgSetting.md @@ -77,7 +77,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Set-ZertoAlert.md b/docs/Set-ZertoAlert.md index 15f47a9..5ceb8ba 100644 --- a/docs/Set-ZertoAlert.md +++ b/docs/Set-ZertoAlert.md @@ -120,7 +120,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Set-ZertoLicense.md b/docs/Set-ZertoLicense.md index a915c7f..a353532 100644 --- a/docs/Set-ZertoLicense.md +++ b/docs/Set-ZertoLicense.md @@ -77,7 +77,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Start-ZertoCloneVpg.md b/docs/Start-ZertoCloneVpg.md index c05d64b..9ab204d 100644 --- a/docs/Start-ZertoCloneVpg.md +++ b/docs/Start-ZertoCloneVpg.md @@ -125,7 +125,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Start-ZertoFailoverTest.md b/docs/Start-ZertoFailoverTest.md index 8218e02..1299291 100644 --- a/docs/Start-ZertoFailoverTest.md +++ b/docs/Start-ZertoFailoverTest.md @@ -109,7 +109,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Stop-ZertoCloneVpg.md b/docs/Stop-ZertoCloneVpg.md index 822bc34..2c28b8d 100644 --- a/docs/Stop-ZertoCloneVpg.md +++ b/docs/Stop-ZertoCloneVpg.md @@ -76,7 +76,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Stop-ZertoFailoverTest.md b/docs/Stop-ZertoFailoverTest.md index 4cbdf16..5a52590 100644 --- a/docs/Stop-ZertoFailoverTest.md +++ b/docs/Stop-ZertoFailoverTest.md @@ -109,7 +109,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Suspend-ZertoVpg.md b/docs/Suspend-ZertoVpg.md index 0719793..466b6d7 100644 --- a/docs/Suspend-ZertoVpg.md +++ b/docs/Suspend-ZertoVpg.md @@ -46,7 +46,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS diff --git a/docs/Uninstall-ZertoVra.md b/docs/Uninstall-ZertoVra.md index 890496a..cae5377 100644 --- a/docs/Uninstall-ZertoVra.md +++ b/docs/Uninstall-ZertoVra.md @@ -46,7 +46,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS From dcba2b04a94a07fd061a0adbb185014cd69f6931 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 4 Apr 2020 10:30:46 -0400 Subject: [PATCH 336/479] Added Edit Password Information --- docs/Edit-ZertoVra.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/Edit-ZertoVra.md b/docs/Edit-ZertoVra.md index 4bba6fa..a34332a 100644 --- a/docs/Edit-ZertoVra.md +++ b/docs/Edit-ZertoVra.md @@ -8,7 +8,7 @@ schema: 2.0.0 # Edit-ZertoVra ## SYNOPSIS -Updates a VRA with updated settings +Updates a VRA with updated settings. Use of this function will cause a reboot of the associated VRA. ## SYNTAX @@ -24,6 +24,8 @@ It is possible to update the Bandwidth group with the -groupName setting. If the It is possible to update the static IP address, default gateway, or subnetmask. +This function can be used if the VRA was installed with host credentials to update the password to connect to the host if it has changed. + It is suggested that you use Get-ZertoVra to get the vraIdentifer parameter. ## EXAMPLES @@ -56,6 +58,13 @@ PS C:\>Edit-ZertoVra -vraIdentifier $vraIdentifier -defaultGateway "192.168.1.1" Updates the VRA default gateway to 192.168.1.1 +### Example 5 +```powershell +PS C:\>Edit-ZertoVra -HostRootPassword $HostRootPassword +``` + +Updates the VRA default gateway to 192.168.1.1 + ## PARAMETERS ### -defaultGateway From 7488e7999ff5c8f0a1860c458aa02a23d556d11e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 4 Apr 2020 10:36:51 -0400 Subject: [PATCH 337/479] Updated Release notes with current changes --- RELEASENOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 094cf75..d3c968b 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -11,6 +11,7 @@ * Moved `Invoke-ZertoRestRequest` and `Invoke-ZARestRequest` to be public functions. As there become more and more scenarios where there are not prebuilt functions to accomplish complex specialized tasks, it became apparent that these functions could be leveraged to make the experience and workflow easier. * Updated the `Install-ZertoVra` logic to ensure that the target datastore is available on the target host. There isn't currently any method to validate the target network, but if that becomes available in a later version of the API, the function will be updated. * Updated the `Install-ZertoVra` function to allow for installation of the VRA using the host password method. Please review the [Install-ZertoVra](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Install-ZertoVra.md) documentation for syntax and examples. +* Updated the `Edit-ZertoVra` function to allow for modification of the associated ESX host password if the need arises. Please review the [Edit-ZertoVra](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Edit-ZertoVra.md) documentation for syntax and examples. ### Zerto Analytics From df83277c066cb7293b0a5de58401ce008fb4a5da Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 6 Apr 2020 17:15:52 -0400 Subject: [PATCH 338/479] Create Set-ZertoUserCredential.ps1 --- .../Public/Set-ZertoUserCredential.ps1 | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 diff --git a/ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 b/ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 new file mode 100644 index 0000000..71495b3 --- /dev/null +++ b/ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 @@ -0,0 +1,33 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Set-ZertoUserCredential { + [cmdletbinding( + SupportsShouldProcess, + ConfirmImpact = 'High' + )] + param( + [Parameter( + HelpMessage = "PSCredential Object that conatins the username and password for the updated credentials.", + Mandatory + )] + [pscredential]$UserCredential + ) + + begin { + + } + + process { + $uri = '/localsite/virtualizationsettings' + $body = @{ + UserName = $UserCredential.UserName + Password = $UserCredential.GetNetworkCredential().Password + } + if ( $PSCmdlet.ShouldProcess( $script:zertoServer, "Updating hypervisor service account credentials" )) { + Invoke-ZertoRestRequest -uri $uri -Method PUT -body ($body | ConvertTo-Json) + } + } + + end { + + } +} From 536a62f792cdafd64a85329de543cf252672914b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 6 Apr 2020 17:15:57 -0400 Subject: [PATCH 339/479] Create Set-ZertoUserCredential.Tests.ps1 --- .../Public/Set-ZertoUserCredential.Tests.ps1 | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Tests/Public/Set-ZertoUserCredential.Tests.ps1 diff --git a/Tests/Public/Set-ZertoUserCredential.Tests.ps1 b/Tests/Public/Set-ZertoUserCredential.Tests.ps1 new file mode 100644 index 0000000..4cca845 --- /dev/null +++ b/Tests/Public/Set-ZertoUserCredential.Tests.ps1 @@ -0,0 +1,42 @@ +#Requires -Modules Pester +$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) +$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] + +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + InModuleScope -ModuleName ZertoApiWrapper { + + Context "$global:function::Parameter Unit Tests" { + + BeforeAll { + $script:ScriptBlock = (Get-Command $global:function).ScriptBlock + } + + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 + } + + $ParameterTestCases = @( + @{ParameterName = 'UserCredential'; Type = 'pscredential'; Mandatory = $true } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It "Supports 'SupportsShouldProcess'" { + Get-Command $global:function | Should -HaveParameter WhatIf + Get-Command $global:function | Should -HaveParameter Confirm + $script:ScriptBlock | Should -match 'SupportsShouldProcess' + $script:ScriptBlock | Should -match '\$PSCmdlet\.ShouldProcess\(.+\)' + } + } + + Context "$global:function::Parameter Functional Tests" { + + } + } +} + +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global From f34f21bb85c4395d6d97e47105e008134c8cfa78 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 7 Apr 2020 07:49:13 -0400 Subject: [PATCH 340/479] Create Set-ZertoUserCredential.md --- docs/Set-ZertoUserCredential.md | 88 +++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 docs/Set-ZertoUserCredential.md diff --git a/docs/Set-ZertoUserCredential.md b/docs/Set-ZertoUserCredential.md new file mode 100644 index 0000000..7e0a49f --- /dev/null +++ b/docs/Set-ZertoUserCredential.md @@ -0,0 +1,88 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Set-ZertoUserCredential + +## SYNOPSIS + +## SYNTAX + +``` +Set-ZertoUserCredential [-UserCredential] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +{{Fill in the Description}} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -UserCredential +PSCredential Object that conatins the username and password for the updated credentials. + +```yaml +Type: PSCredential +Parameter Sets: (All) +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. +For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +## NOTES + +## RELATED LINKS From b2e5fe7b5cfefdf3d4668b0f10c40d8e9a96621f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 7 Apr 2020 10:04:55 -0400 Subject: [PATCH 341/479] Update Set-ZertoUserCredential.md --- docs/Set-ZertoUserCredential.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/Set-ZertoUserCredential.md b/docs/Set-ZertoUserCredential.md index 7e0a49f..44ca3c4 100644 --- a/docs/Set-ZertoUserCredential.md +++ b/docs/Set-ZertoUserCredential.md @@ -1,13 +1,14 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Set-ZertoUserCredential.md schema: 2.0.0 --- # Set-ZertoUserCredential ## SYNOPSIS +Allows the change or update of the credentials used to allow the Zerto Virtual Manager to connect and communicate with the paired Hypervisor. ## SYNTAX @@ -16,21 +17,21 @@ Set-ZertoUserCredential [-UserCredential] [-WhatIf] [-Confirm] [< ``` ## DESCRIPTION -{{Fill in the Description}} +Allows the change or update of the credentials used to allow the Zerto Virtual Manager to connect and communicate with the paired Hypervisor. A PSCredential object is required and will be used to pass the updated credentials. ## EXAMPLES ### Example 1 ```powershell -PS C:\> {{ Add example code here }} +PS C:\> Set-ZertoUserCredential -UserCredential $UserCredential ``` -{{ Add example description here }} +Will update the user account used to connect the Zerto Virtual Manager to the the paired Hypervisor. ## PARAMETERS ### -UserCredential -PSCredential Object that conatins the username and password for the updated credentials. +PSCredential Object that contains the username and password for the updated credentials. ```yaml Type: PSCredential @@ -86,3 +87,4 @@ For more information, see about_CommonParameters (http://go.microsoft.com/fwlink ## NOTES ## RELATED LINKS +[PSCredential Object Information](https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.pscredential) From 77fb3c8f678136de5b01aa5799bd1f953c89fed9 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 7 Apr 2020 10:05:31 -0400 Subject: [PATCH 342/479] Fix helpmessage typo --- ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 b/ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 index 71495b3..423f02c 100644 --- a/ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 +++ b/ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 @@ -6,7 +6,7 @@ function Set-ZertoUserCredential { )] param( [Parameter( - HelpMessage = "PSCredential Object that conatins the username and password for the updated credentials.", + HelpMessage = "PSCredential Object that contains the username and password for the updated credentials.", Mandatory )] [pscredential]$UserCredential From a5f3ad4de0b7462720e517c61956e04622971078 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 7 Apr 2020 10:05:34 -0400 Subject: [PATCH 343/479] Update RELEASENOTES.md --- RELEASENOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index d3c968b..0c8b2f3 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -12,6 +12,7 @@ * Updated the `Install-ZertoVra` logic to ensure that the target datastore is available on the target host. There isn't currently any method to validate the target network, but if that becomes available in a later version of the API, the function will be updated. * Updated the `Install-ZertoVra` function to allow for installation of the VRA using the host password method. Please review the [Install-ZertoVra](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Install-ZertoVra.md) documentation for syntax and examples. * Updated the `Edit-ZertoVra` function to allow for modification of the associated ESX host password if the need arises. Please review the [Edit-ZertoVra](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Edit-ZertoVra.md) documentation for syntax and examples. +* Added a new function, `Set-ZertoUserCredential`, to allow the updating of the username and password used to connect the Zerto Virtual Manager to the paired hypervisor. Please see the [Set-ZertoUserCredential](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Set-ZertoUserCredential.md) help for additional information. ### Zerto Analytics From e12bf9d85edfa5aacce37aa7de448b84dcb89f9f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 7 Apr 2020 10:18:37 -0400 Subject: [PATCH 344/479] Fix script level variable --- ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 b/ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 index 423f02c..c2e1a9e 100644 --- a/ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 +++ b/ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 @@ -22,7 +22,7 @@ function Set-ZertoUserCredential { UserName = $UserCredential.UserName Password = $UserCredential.GetNetworkCredential().Password } - if ( $PSCmdlet.ShouldProcess( $script:zertoServer, "Updating hypervisor service account credentials" )) { + if ( $PSCmdlet.ShouldProcess( $script:zvmServer, "Updating hypervisor service account credentials" )) { Invoke-ZertoRestRequest -uri $uri -Method PUT -body ($body | ConvertTo-Json) } } From ad2073f404011081cdbb53ff6c1be736a0e42ed8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 7 Apr 2020 10:27:22 -0400 Subject: [PATCH 345/479] Fixed submitted body formatting --- ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 b/ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 index c2e1a9e..110be91 100644 --- a/ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 +++ b/ZertoApiWrapper/Public/Set-ZertoUserCredential.ps1 @@ -19,8 +19,10 @@ function Set-ZertoUserCredential { process { $uri = '/localsite/virtualizationsettings' $body = @{ - UserName = $UserCredential.UserName - Password = $UserCredential.GetNetworkCredential().Password + Credentials = @{ + UserName = $UserCredential.UserName + Password = $UserCredential.GetNetworkCredential().Password + } } if ( $PSCmdlet.ShouldProcess( $script:zvmServer, "Updating hypervisor service account credentials" )) { Invoke-ZertoRestRequest -uri $uri -Method PUT -body ($body | ConvertTo-Json) From 0d6bc39c86d85a08033e9a41913fe413d3fe6a0d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 7 Apr 2020 10:30:42 -0400 Subject: [PATCH 346/479] Add an additional example --- docs/Set-ZertoUserCredential.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/Set-ZertoUserCredential.md b/docs/Set-ZertoUserCredential.md index 44ca3c4..9fd7d20 100644 --- a/docs/Set-ZertoUserCredential.md +++ b/docs/Set-ZertoUserCredential.md @@ -28,6 +28,13 @@ PS C:\> Set-ZertoUserCredential -UserCredential $UserCredential Will update the user account used to connect the Zerto Virtual Manager to the the paired Hypervisor. +### Example 2 +```powershell +PS C:\> Set-ZertoUserCredential -UserCredential $UserCredential -Confirm:$False +``` + +Will update the user account used to connect the Zerto Virtual Manager to the the paired Hypervisor. CAUTION: By adding the `-Confirm:$False` parameter, this will suppress the confirmation dialog and you will not be prompted if you wish to complete this action. + ## PARAMETERS ### -UserCredential From 90434b56a29612a8fbf64129d231d277bf6fbb57 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 7 Apr 2020 17:35:55 -0400 Subject: [PATCH 347/479] Updated for new Repositories endpoint --- .../Public/Get-ZertoVirtualizationSite.ps1 | 14 ++++++++++- docs/Get-ZertoVirtualizationSite.md | 24 +++++++++++++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 b/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 index e296887..27d5e42 100644 --- a/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 @@ -52,6 +52,11 @@ function Get-ZertoVirtualizationSite { Mandatory = $true, HelpMessage = "The identifier of the Zerto Virtual Manager site." )] + [Parameter( + ParameterSetName = "repositories", + Mandatory = $true, + HelpMessage = "The identifier of the Zerto Virtual Manager site." + )] [ValidateNotNullOrEmpty()] [Alias("siteId")] [string]$siteIdentifier, @@ -121,7 +126,14 @@ function Get-ZertoVirtualizationSite { Mandatory = $true, HelpMessage = "Return all VMs at the selected site." )] - [switch]$vms + [switch]$vms, + [Parameter( + ParameterSetName = "repositories", + Mandatory = $true, + HelpMessage = "The identifier of the Zerto Virtual Manager site." + )] + [switch]$repositories + ) begin { diff --git a/docs/Get-ZertoVirtualizationSite.md b/docs/Get-ZertoVirtualizationSite.md index 815019c..12c1872 100644 --- a/docs/Get-ZertoVirtualizationSite.md +++ b/docs/Get-ZertoVirtualizationSite.md @@ -18,6 +18,11 @@ Returns information about the hypervisor site where the API is run and all the s Get-ZertoVirtualizationSite [] ``` +### repositories +``` +Get-ZertoVirtualizationSite -siteIdentifier [-repositories] [] +``` + ### folders ``` Get-ZertoVirtualizationSite -siteIdentifier [-folders] [] @@ -225,6 +230,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -repositories +The identifier of the Zerto Virtual Manager site. + +```yaml +Type: SwitchParameter +Parameter Sets: repositories +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -resourcePools Return all resource pools at the selected site. @@ -245,7 +265,7 @@ The identifier of the Zerto Virtual Manager site. ```yaml Type: String -Parameter Sets: folders, devices, vms, resourcePools, networks, hosts, hostClusters, datastores, datastoreClusters, siteIdentifier +Parameter Sets: repositories, folders, devices, vms, resourcePools, networks, hosts, hostClusters, datastores, datastoreClusters, siteIdentifier Aliases: siteId Required: True @@ -271,7 +291,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS From d15111a883f0b8373fcb9b14f5b54a02a561d36f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 8 Apr 2020 15:19:46 -0400 Subject: [PATCH 348/479] Add new LTR API Endpoint Added new LTR endpoint and help messages to indicate that it will only work with Version 8.0 and above. Also updated help message for backup settings indicating that backup settings only work with 7.5 and below. --- .../Public/Get-ZertoVpgSetting.ps1 | 27 ++++++++++--- docs/Get-ZertoVpgSetting.md | 39 ++++++++++++++++--- 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 b/ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 index cf64840..533430b 100644 --- a/ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 @@ -19,7 +19,7 @@ function Get-ZertoVpgSetting { ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, Mandatory = $true, - HelpMessage = "The identifier of the VPG settings object for which information is retrieved." + HelpMessage = "The identifier of the VPG settings object for which information is retrieved. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error." )] [Parameter( ParameterSetName = "dayOfWeek", @@ -149,31 +149,39 @@ function Get-ZertoVpgSetting { Mandatory = $true, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] + [Parameter( + ParameterSetName = "ltr", + ValueFromPipeline = $true, + ValueFromPipelineByPropertyName = $true, + ValueFromRemainingArguments = $true, + Mandatory = $true, + HelpMessage = "The identifier of the VPG settings object for which information is retrieved." + )] [ValidateNotNullOrEmpty()] [Alias("vpgSettingsId", "settingsId")] [string[]]$vpgSettingsIdentifier, [Parameter( ParameterSetName = "backup", Mandatory = $true, - HelpMessage = "Return backup information for VPG identifier specified" + HelpMessage = "Return backup information for VPG identifier specified. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error." )] [switch]$backup, [Parameter( ParameterSetName = "dayOfWeek", Mandatory = $true, - HelpMessage = "Get the day of week a backup is scheduled" + HelpMessage = "Get the day of week a backup is scheduled. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error." )] [switch]$dayOfWeek, [Parameter( ParameterSetName = "retentionPeriod", Mandatory = $true, - HelpMessage = "Get the retention period for a backup" + HelpMessage = "Get the retention period for a backup. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error." )] [switch]$retentionPeriod, [Parameter( ParameterSetName = "schedulerPeriod", Mandatory = $true, - HelpMessage = "Get the backup schedule" + HelpMessage = "Get the backup schedule. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error." )] [switch]$schedulerPeriod, [Parameter( @@ -280,7 +288,14 @@ function Get-ZertoVpgSetting { )] [ValidateNotNullOrEmpty()] [Alias("volumeId")] - [string]$volumeIdentifier + [string]$volumeIdentifier, + [Parameter( + ParameterSetName = "ltr", + Mandatory = $true, + HelpMessage = "Return LTR information for the specified VPG. Please note, this parameter is ONLY available in Zerto version 8.0 and later. Attempting to run this switch against a Zerto Virtual Manager version 7.5 or lower will result in an error." + )] + [switch]$ltr + ) begin { diff --git a/docs/Get-ZertoVpgSetting.md b/docs/Get-ZertoVpgSetting.md index 8b671cc..998eae0 100644 --- a/docs/Get-ZertoVpgSetting.md +++ b/docs/Get-ZertoVpgSetting.md @@ -17,6 +17,11 @@ Returns information when a VPG Settings object is created to create a new or edi Get-ZertoVpgSetting [] ``` +### ltr +``` +Get-ZertoVpgSetting -vpgSettingsIdentifier [-ltr] [] +``` + ### volumeIdentifier ``` Get-ZertoVpgSetting -vpgSettingsIdentifier -vmIdentifier -volumeIdentifier @@ -151,10 +156,17 @@ PS C:\> Get-ZertoVpgSetting -vpgSettingsIdentifier "MySettingsIdentifier" -basic Returns current basic settings for vpgSettingsIdentifier "MySettingsIdentifier" +### Example 6 +```powershell +PS C:\> Get-ZertoVpgSetting -vpgSettingsIdentifier "MySettingsIdentifier" -ltr +``` + +Returns current LTR settings for vpgSettingsIdentifier "MySettingsIdentifier" + ## PARAMETERS ### -backup -Return backup information for VPG identifier specified +Return backup information for VPG identifier specified. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error. ```yaml Type: SwitchParameter @@ -199,7 +211,7 @@ Accept wildcard characters: False ``` ### -dayOfWeek -Get the day of week a backup is scheduled +Get the day of week a backup is scheduled. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error. ```yaml Type: SwitchParameter @@ -228,6 +240,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ltr +Return LTR information for the specified VPG. Please note, this parameter is ONLY available in Zerto version 8.0 and later. Attempting to run this switch against a Zerto Virtual Manager version 7.5 or lower will result in an error. + +```yaml +Type: SwitchParameter +Parameter Sets: ltr +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -networks Get VPG Network Settings @@ -304,7 +331,7 @@ Accept wildcard characters: False ``` ### -retentionPeriod -Get the retention period for a backup +Get the retention period for a backup. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error. ```yaml Type: SwitchParameter @@ -319,7 +346,7 @@ Accept wildcard characters: False ``` ### -schedulerPeriod -Get the backup schedule +Get the backup schedule. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error. ```yaml Type: SwitchParameter @@ -413,7 +440,7 @@ The identifier of the VPG settings object for which information is retrieved. ```yaml Type: String[] -Parameter Sets: volumeIdentifier, volumes, nicIdentifier, nics, vmIdentifier, vms, scripting, recovery, priority, networks, journal, bootGroup, basic, schedulerPeriod, retentionPeriod, dayOfWeek, backup, vpgSettingsIdentifier +Parameter Sets: ltr, volumeIdentifier, volumes, nicIdentifier, nics, vmIdentifier, vms, scripting, recovery, priority, networks, journal, bootGroup, basic, schedulerPeriod, retentionPeriod, dayOfWeek, backup, vpgSettingsIdentifier Aliases: vpgSettingsId, settingsId Required: True @@ -424,7 +451,7 @@ Accept wildcard characters: False ``` ### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). ## INPUTS From 96b3e65be22080248a8a0fa16bb5f020a97bcb0c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 8 Apr 2020 15:26:10 -0400 Subject: [PATCH 349/479] Update RELEASENOTES.md --- RELEASENOTES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 0c8b2f3..44ecdd6 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -13,6 +13,9 @@ * Updated the `Install-ZertoVra` function to allow for installation of the VRA using the host password method. Please review the [Install-ZertoVra](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Install-ZertoVra.md) documentation for syntax and examples. * Updated the `Edit-ZertoVra` function to allow for modification of the associated ESX host password if the need arises. Please review the [Edit-ZertoVra](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Edit-ZertoVra.md) documentation for syntax and examples. * Added a new function, `Set-ZertoUserCredential`, to allow the updating of the username and password used to connect the Zerto Virtual Manager to the paired hypervisor. Please see the [Set-ZertoUserCredential](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Set-ZertoUserCredential.md) help for additional information. +* With the release of [Zerto 8.0](https://www.zerto.com/zerto-8-0-general-availability/) some additional API endpoints have become available. + * Updated `Get-ZertoVirtualizationSite` to add the `-repository` parameter to enable returning information for LTR repositories. + * Updated `Get-ZertoVpgSetting` to add the `-ltr` parameter to enable returning information for current LTR settings for the selected VPG. ### Zerto Analytics From e3cba682c7b1459adea405db2a78517e16c27629 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 9 Apr 2020 10:37:36 -0400 Subject: [PATCH 350/479] DRY Refactor --- .../Public/Get-ZertoVirtualizationSite.ps1 | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 b/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 index 27d5e42..2dd1b23 100644 --- a/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 @@ -133,33 +133,27 @@ function Get-ZertoVirtualizationSite { HelpMessage = "The identifier of the Zerto Virtual Manager site." )] [switch]$repositories - ) begin { - $baseUri = "virtualizationsites" - $returnObject = @() + } process { # Return information based on ParameterSetName invoked. + $baseUri = "virtualizationsites" switch ( $PSCmdlet.ParameterSetName ) { - # If no ParameterSetName is specified, return all data "main" { - $returnObject = Invoke-ZertoRestRequest -uri $baseUri + $uri = $baseUri } # If devices is specified along with a hostId, build return just that host information, otherwise return all devices at the site - #TODO - remove foreach, only one siteIdentifier can be specified. "devices" { - $returnObject = foreach ( $id in $siteIdentifier ) { - if ( $PSBoundParameters.ContainsKey( "hostIdentifier" ) ) { - $uri = "{0}/{1}/devices?hostIdentifier={2}" -f $baseUri, $siteIdentifier, $hostIdentifier - } else { - $uri = "{0}/{1}/devices" -f $baseUri, $siteIdentifier - } - Invoke-ZertoRestRequest -uri $uri + if ( $PSBoundParameters.ContainsKey( "hostIdentifier" ) ) { + $uri = "{0}/{1}/devices?hostIdentifier={2}" -f $baseUri, $siteIdentifier, $hostIdentifier + } else { + $uri = "{0}/{1}/devices" -f $baseUri, $siteIdentifier } } @@ -170,24 +164,22 @@ function Get-ZertoVirtualizationSite { } else { $uri = "{0}/{1}/hosts" -f $baseUri, $siteIdentifier } - $returnObject = Invoke-ZertoRestRequest -uri $uri } # If siteIdentifier is specified, return information for that site. "siteIdentifier" { $uri = "{0}/{1}" -f $baseUri, $siteIdentifier - $returnObject = Invoke-ZertoRestRequest -uri $uri } # If a different ParameterSetName is selected, use that information to build the URI and return that information default { $uri = "{0}/{1}/{2}" -f $baseUri, $siteIdentifier, $PSCmdlet.ParameterSetName.ToLower() - $returnObject = Invoke-ZertoRestRequest -uri $uri } } + Invoke-ZertoRestRequest -uri $uri } end { - return $returnObject + } } From 7fbc550390ce0f8a58b26246d1576692963ac1d6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 9 Apr 2020 12:48:04 -0400 Subject: [PATCH 351/479] Add Mocks for Tests --- Tests/Public/Mocks/VirtualSite-Folders.json | 14 +++++ Tests/Public/Mocks/VirtualSite-Networks.json | 4 ++ Tests/Public/Mocks/VirtualSite-NoParams.json | 10 +++ .../Mocks/VirtualSite-ResourcePools.json | 4 ++ Tests/Public/Mocks/VirtualSite-SiteId.json | 4 ++ Tests/Public/Mocks/VirtualSite-VMs.json | 18 ++++++ .../Mocks/VirtualSite-datastoreClusters.json | 4 ++ .../Public/Mocks/VirtualSite-datastores.json | 34 ++++++++++ .../Mocks/VirtualSite-devices-hostid.json | 62 +++++++++++++++++++ Tests/Public/Mocks/VirtualSite-devices.json | 62 +++++++++++++++++++ .../Mocks/VirtualSite-hostClusters.json | 4 ++ .../Mocks/VirtualSite-hosts-hostid.json | 4 ++ Tests/Public/Mocks/VirtualSite-hosts.json | 14 +++++ .../Mocks/VirtualSite-repositories.json | 7 +++ 14 files changed, 245 insertions(+) create mode 100644 Tests/Public/Mocks/VirtualSite-Folders.json create mode 100644 Tests/Public/Mocks/VirtualSite-Networks.json create mode 100644 Tests/Public/Mocks/VirtualSite-NoParams.json create mode 100644 Tests/Public/Mocks/VirtualSite-ResourcePools.json create mode 100644 Tests/Public/Mocks/VirtualSite-SiteId.json create mode 100644 Tests/Public/Mocks/VirtualSite-VMs.json create mode 100644 Tests/Public/Mocks/VirtualSite-datastoreClusters.json create mode 100644 Tests/Public/Mocks/VirtualSite-datastores.json create mode 100644 Tests/Public/Mocks/VirtualSite-devices-hostid.json create mode 100644 Tests/Public/Mocks/VirtualSite-devices.json create mode 100644 Tests/Public/Mocks/VirtualSite-hostClusters.json create mode 100644 Tests/Public/Mocks/VirtualSite-hosts-hostid.json create mode 100644 Tests/Public/Mocks/VirtualSite-hosts.json create mode 100644 Tests/Public/Mocks/VirtualSite-repositories.json diff --git a/Tests/Public/Mocks/VirtualSite-Folders.json b/Tests/Public/Mocks/VirtualSite-Folders.json new file mode 100644 index 0000000..c14eb73 --- /dev/null +++ b/Tests/Public/Mocks/VirtualSite-Folders.json @@ -0,0 +1,14 @@ +[ + { + "FolderIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.group-v3", + "FolderName": "/" + }, + { + "FolderIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.group-v27", + "FolderName": "Templates" + }, + { + "FolderIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.group-v9", + "FolderName": "Discovered virtual machine" + } +] diff --git a/Tests/Public/Mocks/VirtualSite-Networks.json b/Tests/Public/Mocks/VirtualSite-Networks.json new file mode 100644 index 0000000..3c08c27 --- /dev/null +++ b/Tests/Public/Mocks/VirtualSite-Networks.json @@ -0,0 +1,4 @@ +{ + "NetworkIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.network-20", + "VirtualizationNetworkName": "VM Network" +} diff --git a/Tests/Public/Mocks/VirtualSite-NoParams.json b/Tests/Public/Mocks/VirtualSite-NoParams.json new file mode 100644 index 0000000..feccaa9 --- /dev/null +++ b/Tests/Public/Mocks/VirtualSite-NoParams.json @@ -0,0 +1,10 @@ +[ + { + "SiteIdentifier": "8e1c9f53-4973-4a4a-b2dd-1ebb293614d8", + "VirtualizationSiteName": "cavc.nc.lab" + }, + { + "SiteIdentifier": "15aa0d43-69cd-400a-8b99-fe94bbac3e19", + "VirtualizationSiteName": "ncvc.nc.lab" + } +] diff --git a/Tests/Public/Mocks/VirtualSite-ResourcePools.json b/Tests/Public/Mocks/VirtualSite-ResourcePools.json new file mode 100644 index 0000000..7d65eff --- /dev/null +++ b/Tests/Public/Mocks/VirtualSite-ResourcePools.json @@ -0,0 +1,4 @@ +{ + "ResourcePoolIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.resgroup-8", + "ResourcepoolName": "Resources" +} diff --git a/Tests/Public/Mocks/VirtualSite-SiteId.json b/Tests/Public/Mocks/VirtualSite-SiteId.json new file mode 100644 index 0000000..4abdcc3 --- /dev/null +++ b/Tests/Public/Mocks/VirtualSite-SiteId.json @@ -0,0 +1,4 @@ +{ + "SiteIdentifier": "8e1c9f53-4973-4a4a-b2dd-1ebb293614d8", + "VirtualizationSiteName": "cavc.nc.lab" +} diff --git a/Tests/Public/Mocks/VirtualSite-VMs.json b/Tests/Public/Mocks/VirtualSite-VMs.json new file mode 100644 index 0000000..6debd36 --- /dev/null +++ b/Tests/Public/Mocks/VirtualSite-VMs.json @@ -0,0 +1,18 @@ +[ + { + "VmIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.vm-55", + "VmName": "TimeSeries" + }, + { + "VmIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.vm-53", + "VmName": "AnsibleTarget" + }, + { + "VmIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.vm-28", + "VmName": "cazvm.nc.lab" + }, + { + "VmIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.vm-26", + "VmName": "WinTemplate" + } +] diff --git a/Tests/Public/Mocks/VirtualSite-datastoreClusters.json b/Tests/Public/Mocks/VirtualSite-datastoreClusters.json new file mode 100644 index 0000000..82a0a11 --- /dev/null +++ b/Tests/Public/Mocks/VirtualSite-datastoreClusters.json @@ -0,0 +1,4 @@ +{ + "DatastoreClusterIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.group-p44", + "DatastoreClusterName": "CA_DS_Cluster" +} diff --git a/Tests/Public/Mocks/VirtualSite-datastores.json b/Tests/Public/Mocks/VirtualSite-datastores.json new file mode 100644 index 0000000..0bdbc15 --- /dev/null +++ b/Tests/Public/Mocks/VirtualSite-datastores.json @@ -0,0 +1,34 @@ +[ + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-40", + "DatastoreName": "MgmtLUN" + }, + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-23", + "DatastoreName": "LabPool" + }, + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-22", + "DatastoreName": "datastore1 (2)" + }, + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-21", + "DatastoreName": "datastore1 (1)" + }, + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-19", + "DatastoreName": "datastore1" + }, + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-41", + "DatastoreName": "CA_DS_01" + }, + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-42", + "DatastoreName": "CA_DS_02" + }, + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-43", + "DatastoreName": "CA_DS_03" + } +] diff --git a/Tests/Public/Mocks/VirtualSite-devices-hostid.json b/Tests/Public/Mocks/VirtualSite-devices-hostid.json new file mode 100644 index 0000000..f2768c4 --- /dev/null +++ b/Tests/Public/Mocks/VirtualSite-devices-hostid.json @@ -0,0 +1,62 @@ +[ + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-40", + "DeviceIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.naa.6001405a18009ded4f84d4177d8893d6", + "DeviceName": "SYNOLOGY iSCSI Disk (naa.6001405a18009ded4f84d4177d8893d6)", + "HostIdentifiers": [ + "09db6c5b-b956-430f-9589-b58876ca377a.host-18", + "09db6c5b-b956-430f-9589-b58876ca377a.host-15", + "09db6c5b-b956-430f-9589-b58876ca377a.host-12" + ], + "SizeInBytes": 1073741824000, + "VmIdentifier": null + }, + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-22", + "DeviceIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.mpx.vmhba1:C0:T0:L0", + "DeviceName": "Local VMware Disk (mpx.vmhba1:C0:T0:L0)", + "HostIdentifiers": [ + "09db6c5b-b956-430f-9589-b58876ca377a.host-18", + "09db6c5b-b956-430f-9589-b58876ca377a.host-15", + "09db6c5b-b956-430f-9589-b58876ca377a.host-12" + ], + "SizeInBytes": 42949672960, + "VmIdentifier": null + }, + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-42", + "DeviceIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.naa.6001405922cd662dc343d4683d9aecd1", + "DeviceName": "SYNOLOGY iSCSI Disk (naa.6001405922cd662dc343d4683d9aecd1)", + "HostIdentifiers": [ + "09db6c5b-b956-430f-9589-b58876ca377a.host-18", + "09db6c5b-b956-430f-9589-b58876ca377a.host-15", + "09db6c5b-b956-430f-9589-b58876ca377a.host-12" + ], + "SizeInBytes": 536870912000, + "VmIdentifier": null + }, + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-41", + "DeviceIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.naa.6001405522c4ad5d65a6d4113d9657dc", + "DeviceName": "SYNOLOGY iSCSI Disk (naa.6001405522c4ad5d65a6d4113d9657dc)", + "HostIdentifiers": [ + "09db6c5b-b956-430f-9589-b58876ca377a.host-18", + "09db6c5b-b956-430f-9589-b58876ca377a.host-15", + "09db6c5b-b956-430f-9589-b58876ca377a.host-12" + ], + "SizeInBytes": 536870912000, + "VmIdentifier": null + }, + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-43", + "DeviceIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.naa.600140533d732abd8caed42cfda50ed1", + "DeviceName": "SYNOLOGY iSCSI Disk (naa.600140533d732abd8caed42cfda50ed1)", + "HostIdentifiers": [ + "09db6c5b-b956-430f-9589-b58876ca377a.host-18", + "09db6c5b-b956-430f-9589-b58876ca377a.host-15", + "09db6c5b-b956-430f-9589-b58876ca377a.host-12" + ], + "SizeInBytes": 536870912000, + "VmIdentifier": null + } +] diff --git a/Tests/Public/Mocks/VirtualSite-devices.json b/Tests/Public/Mocks/VirtualSite-devices.json new file mode 100644 index 0000000..f2768c4 --- /dev/null +++ b/Tests/Public/Mocks/VirtualSite-devices.json @@ -0,0 +1,62 @@ +[ + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-40", + "DeviceIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.naa.6001405a18009ded4f84d4177d8893d6", + "DeviceName": "SYNOLOGY iSCSI Disk (naa.6001405a18009ded4f84d4177d8893d6)", + "HostIdentifiers": [ + "09db6c5b-b956-430f-9589-b58876ca377a.host-18", + "09db6c5b-b956-430f-9589-b58876ca377a.host-15", + "09db6c5b-b956-430f-9589-b58876ca377a.host-12" + ], + "SizeInBytes": 1073741824000, + "VmIdentifier": null + }, + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-22", + "DeviceIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.mpx.vmhba1:C0:T0:L0", + "DeviceName": "Local VMware Disk (mpx.vmhba1:C0:T0:L0)", + "HostIdentifiers": [ + "09db6c5b-b956-430f-9589-b58876ca377a.host-18", + "09db6c5b-b956-430f-9589-b58876ca377a.host-15", + "09db6c5b-b956-430f-9589-b58876ca377a.host-12" + ], + "SizeInBytes": 42949672960, + "VmIdentifier": null + }, + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-42", + "DeviceIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.naa.6001405922cd662dc343d4683d9aecd1", + "DeviceName": "SYNOLOGY iSCSI Disk (naa.6001405922cd662dc343d4683d9aecd1)", + "HostIdentifiers": [ + "09db6c5b-b956-430f-9589-b58876ca377a.host-18", + "09db6c5b-b956-430f-9589-b58876ca377a.host-15", + "09db6c5b-b956-430f-9589-b58876ca377a.host-12" + ], + "SizeInBytes": 536870912000, + "VmIdentifier": null + }, + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-41", + "DeviceIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.naa.6001405522c4ad5d65a6d4113d9657dc", + "DeviceName": "SYNOLOGY iSCSI Disk (naa.6001405522c4ad5d65a6d4113d9657dc)", + "HostIdentifiers": [ + "09db6c5b-b956-430f-9589-b58876ca377a.host-18", + "09db6c5b-b956-430f-9589-b58876ca377a.host-15", + "09db6c5b-b956-430f-9589-b58876ca377a.host-12" + ], + "SizeInBytes": 536870912000, + "VmIdentifier": null + }, + { + "DatastoreIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.datastore-43", + "DeviceIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.naa.600140533d732abd8caed42cfda50ed1", + "DeviceName": "SYNOLOGY iSCSI Disk (naa.600140533d732abd8caed42cfda50ed1)", + "HostIdentifiers": [ + "09db6c5b-b956-430f-9589-b58876ca377a.host-18", + "09db6c5b-b956-430f-9589-b58876ca377a.host-15", + "09db6c5b-b956-430f-9589-b58876ca377a.host-12" + ], + "SizeInBytes": 536870912000, + "VmIdentifier": null + } +] diff --git a/Tests/Public/Mocks/VirtualSite-hostClusters.json b/Tests/Public/Mocks/VirtualSite-hostClusters.json new file mode 100644 index 0000000..2a28338 --- /dev/null +++ b/Tests/Public/Mocks/VirtualSite-hostClusters.json @@ -0,0 +1,4 @@ +{ + "ClusterIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.domain-c7", + "VirtualizationClusterName": "CA Cluster" +} diff --git a/Tests/Public/Mocks/VirtualSite-hosts-hostid.json b/Tests/Public/Mocks/VirtualSite-hosts-hostid.json new file mode 100644 index 0000000..7a74266 --- /dev/null +++ b/Tests/Public/Mocks/VirtualSite-hosts-hostid.json @@ -0,0 +1,4 @@ +{ + "HostIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.host-18", + "VirtualizationHostName": "caesx3.nc.lab" +} diff --git a/Tests/Public/Mocks/VirtualSite-hosts.json b/Tests/Public/Mocks/VirtualSite-hosts.json new file mode 100644 index 0000000..8f0ba82 --- /dev/null +++ b/Tests/Public/Mocks/VirtualSite-hosts.json @@ -0,0 +1,14 @@ +[ + { + "HostIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.host-18", + "VirtualizationHostName": "caesx3.nc.lab" + }, + { + "HostIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.host-15", + "VirtualizationHostName": "caesx2.nc.lab" + }, + { + "HostIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.host-12", + "VirtualizationHostName": "caesx1.nc.lab" + } +] diff --git a/Tests/Public/Mocks/VirtualSite-repositories.json b/Tests/Public/Mocks/VirtualSite-repositories.json new file mode 100644 index 0000000..95b7921 --- /dev/null +++ b/Tests/Public/Mocks/VirtualSite-repositories.json @@ -0,0 +1,7 @@ +{ + "ConnectionType": "ServerMessageBlock", + "Path": "\\\\192.168.1.150\\zBackups", + "RepositoryIdentifier": "120355ce-fcd0-4820-a971-787d0470793b", + "RepositoryName": "Synology", + "StorageType": "NetworkShare" +} From 83e95516925fb37a96f82b01a3dcb42d62e18a44 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 9 Apr 2020 12:48:33 -0400 Subject: [PATCH 352/479] Add tests for function --- .../Get-ZertoVirtualizationSite.Tests.ps1 | 234 ++++++++++++++++++ 1 file changed, 234 insertions(+) diff --git a/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 b/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 index e6e6083..436928b 100644 --- a/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 @@ -3,13 +3,247 @@ $global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { + BeforeAll { + $script:ScriptBlock = (Get-Command $global:function).ScriptBlock + } Context "$global:function::Parameter Unit Tests" { + It "$global:function should have exactly 23 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 23 + } + + $ParameterTestCases = @( + @{ParameterName = 'siteIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'hostIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'folders'; Type = 'Switch'; Mandatory = $true; Validation = $Null } + @{ParameterName = 'hostClusters'; Type = 'Switch'; Mandatory = $true; Validation = $Null } + @{ParameterName = 'hosts'; Type = 'Switch'; Mandatory = $true; Validation = $Null } + @{ParameterName = 'networks'; Type = 'Switch'; Mandatory = $true; Validation = $Null } + @{ParameterName = 'resourcePools'; Type = 'Switch'; Mandatory = $true; Validation = $Null } + @{ParameterName = 'vms'; Type = 'Switch'; Mandatory = $true; Validation = $Null } + @{ParameterName = 'repositories'; Type = 'Switch'; Mandatory = $true; Validation = $Null } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting of " -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Validation) + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + Switch ($Validation) { + + 'NotNullOrEmpty' { + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + $Null { + $Type -match 'Switch' | Should -BeTrue -Because "Only Switch Parameters should not have validation" + } + + default { + $true | Should -BeFalse -Because "No Validation Selected. Review test cases" + } + + } + } + + It "$($global:function) does not have 'SupportsShouldProcess'" { + Get-Command $global:function | Should -not -HaveParameter WhatIf + Get-Command $global:function | Should -not -HaveParameter Confirm + $script:ScriptBlock | Should -not -match 'SupportsShouldProcess' + $script:ScriptBlock | Should -not -match '\$PSCmdlet\.ShouldProcess\(.+\)' + } } Context "$global:function::Parameter Functional Tests" { + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites' + } { + return (Get-Content "$global:here\Mocks\VirtualSite-NoParams.json" -Raw) | ConvertFrom-Json + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/devices' + } { + return (Get-Content "$global:here\Mocks\VirtualSite-devices.json" -Raw) | ConvertFrom-Json + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/devices?hostIdentifier=4567' + } { + return (Get-Content "$global:here\Mocks\VirtualSite-devices-hostid.json" -Raw) | ConvertFrom-Json + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/hosts' + } { + return (Get-Content "$global:here\Mocks\VirtualSite-hosts.json" -Raw) | ConvertFrom-Json + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/hosts/4567' + } { + return (Get-Content "$global:here\Mocks\VirtualSite-hosts-hostid.json" -Raw) | ConvertFrom-Json + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234' + } { + return (Get-Content "$global:here\Mocks\VirtualSite-siteId.json" -Raw) | ConvertFrom-Json + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/datastores' + } { + return (Get-Content "$global:here\Mocks\VirtualSite-datastores.json" -Raw) | ConvertFrom-Json + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/datastoreclusters' + } { + return (Get-Content "$global:here\Mocks\VirtualSite-datastoreClusters.json" -Raw) | ConvertFrom-Json + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/networks' + } { + return (Get-Content "$global:here\Mocks\VirtualSite-Networks.json" -Raw) | ConvertFrom-Json + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/folders' + } { + return (Get-Content "$global:here\Mocks\VirtualSite-Folders.json" -Raw) | ConvertFrom-Json + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/hostclusters' + } { + return (Get-Content "$global:here\Mocks\VirtualSite-hostClusters.json" -Raw) | ConvertFrom-Json + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/resourcepools' + } { + return (Get-Content "$global:here\Mocks\VirtualSite-ResourcePools.json" -Raw) | ConvertFrom-Json + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/vms' + } { + return (Get-Content "$global:here\Mocks\VirtualSite-VMs.json" -Raw) | ConvertFrom-Json + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/repositories' + } { + return (Get-Content "$global:here\Mocks\VirtualSite-repositories.json" -Raw) | ConvertFrom-Json + } -Verifiable + It "Should return all known sites when called without parameters" { + $results = Get-ZertoVirtualizationSite + $results.Count | Should -BeExactly 2 + } + + It "Should return a single site when a siteIdentifier is provided" { + $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' + $results.Count | Should -BeExactly 1 + } + + It "Should return a list of devices with the '-devices' switch" { + $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -devices + $results.Count | Should -BeExactly 5 + } + + It "Should return a list of devices with the '-devices' switch and hostIdentifier provided" { + $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -devices -hostIdentifier '4567' + $results.Count | Should -BeExactly 5 + } + + It "Should return a list of hosts with the '-hosts' switch" { + $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -hosts + $results.Count | Should -BeExactly 3 + } + + It "Should return a single host with the '-hosts' switch and hostIdentifier provided" { + $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -hosts -hostIdentifier '4567' + $results.Count | Should -BeExactly 1 + } + + It "Should return a list of datastores with the '-datastores' switch" { + $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -datastores + $results.Count | Should -BeExactly 8 + } + + It "Should return a list of datastores with the '-datastoreClusters' switch" { + $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -datastoreClusters + $results.Count | Should -BeExactly 1 + } + + It "Should return a list of Networks with the '-networks' switch" { + $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -networks + $results.Count | Should -BeExactly 1 + } + + It "Should return a list of folders with the '-folders' switch" { + $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -folders + $results.Count | Should -BeExactly 3 + } + + It "Should return a list of Host Clusters with the '-hostClusters' switch" { + $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -hostClusters + $results.Count | Should -BeExactly 1 + } + + It "Should return a list of Resource Pools with the '-resourcePools' switch" { + $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -resourcePools + $results.Count | Should -BeExactly 1 + } + + It "Should return a list of VMs with the '-VMs' switch" { + $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -vms + $results.Count | Should -BeExactly 4 + } + + It "Should return a list of LTR Repositories with the '-repositories' switch" { + $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -repositories + $results.Count | Should -BeExactly 1 + } + + Assert-VerifiableMock + + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites' + } -Exactly 1 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234' + } -Exactly 1 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/devices' + } -Exactly 1 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/devices?hostIdentifier=4567' + } -Exactly 1 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/hosts' + } -Exactly 1 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/hosts/4567' + } -Exactly 1 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/datastores' + } -Exactly 1 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/datastoreclusters' + } -Exactly 1 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/networks' + } -Exactly 1 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/folders' + } -Exactly 1 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/hostclusters' + } -Exactly 1 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/resourcepools' + } -Exactly 1 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/vms' + } -Exactly 1 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq 'virtualizationsites/1234/repositories' + } -Exactly 1 } } From a306391a14cbec5aa62a6d278b66eba26eb9a8a0 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 9 Apr 2020 12:55:41 -0400 Subject: [PATCH 353/479] Fix Filename Case --- Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 b/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 index 436928b..0152942 100644 --- a/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 @@ -87,7 +87,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { $uri -eq 'virtualizationsites/1234' } { - return (Get-Content "$global:here\Mocks\VirtualSite-siteId.json" -Raw) | ConvertFrom-Json + return (Get-Content "$global:here\Mocks\VirtualSite-SiteId.json" -Raw) | ConvertFrom-Json } -Verifiable Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { $uri -eq 'virtualizationsites/1234/datastores' From e7658fcfec8cf1151060a4df87af5044e49d7460 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 9 Apr 2020 13:22:42 -0400 Subject: [PATCH 354/479] Update the version of Pester to latest version --- ZertoApiWrapper.Depend.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper.Depend.psd1 b/ZertoApiWrapper.Depend.psd1 index cb3f97d..d832d27 100644 --- a/ZertoApiWrapper.Depend.psd1 +++ b/ZertoApiWrapper.Depend.psd1 @@ -19,7 +19,7 @@ SkipPublisherCheck = $true } Target = 'CurrentUser' - Version = '4.8.1' + Version = '4.10.1' Tags = 'Bootstrap' } From 616cdcf7a27ce2eac0db7db5c063ead1656390e1 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 9 Apr 2020 13:22:57 -0400 Subject: [PATCH 355/479] Update Tests for WindowPS --- .../Get-ZertoVirtualizationSite.Tests.ps1 | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 b/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 index 0152942..b5f0f7e 100644 --- a/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 @@ -137,7 +137,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { It "Should return a single site when a siteIdentifier is provided" { $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' - $results.Count | Should -BeExactly 1 + $results.VirtualizationSiteName | Should -BeExactly 'cavc.nc.lab' + $results.siteIdentifier | Should -BeExactly '8e1c9f53-4973-4a4a-b2dd-1ebb293614d8' } It "Should return a list of devices with the '-devices' switch" { @@ -157,7 +158,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { It "Should return a single host with the '-hosts' switch and hostIdentifier provided" { $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -hosts -hostIdentifier '4567' - $results.Count | Should -BeExactly 1 + $results.VirtualizationHostName | Should -BeExactly "caesx3.nc.lab" + $results.hostIdentifier | Should -BeExactly "09db6c5b-b956-430f-9589-b58876ca377a.host-18" } It "Should return a list of datastores with the '-datastores' switch" { @@ -167,12 +169,14 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { It "Should return a list of datastores with the '-datastoreClusters' switch" { $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -datastoreClusters - $results.Count | Should -BeExactly 1 + $results.DatastoreClusterIdentifier | Should -BeExactly "09db6c5b-b956-430f-9589-b58876ca377a.group-p44" + $results.DatastoreClusterName | Should -BeExactly "CA_DS_Cluster" } It "Should return a list of Networks with the '-networks' switch" { $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -networks - $results.Count | Should -BeExactly 1 + $results.NetworkIdentifier | Should -BeExactly "09db6c5b-b956-430f-9589-b58876ca377a.network-20" + $results.VirtualizationNetworkName | Should -BeExactly "VM Network" } It "Should return a list of folders with the '-folders' switch" { @@ -182,12 +186,14 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { It "Should return a list of Host Clusters with the '-hostClusters' switch" { $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -hostClusters - $results.Count | Should -BeExactly 1 + $results.ClusterIdentifier | Should -BeExactly "09db6c5b-b956-430f-9589-b58876ca377a.domain-c7" + $results.VirtualizationClusterName | Should -BeExactly "CA Cluster" } It "Should return a list of Resource Pools with the '-resourcePools' switch" { $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -resourcePools - $results.Count | Should -BeExactly 1 + $results.ResourcePoolIdentifier | Should -BeExactly "09db6c5b-b956-430f-9589-b58876ca377a.resgroup-8" + $results.ResourcePoolName | Should -BeExactly "Resources" } It "Should return a list of VMs with the '-VMs' switch" { @@ -197,7 +203,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { It "Should return a list of LTR Repositories with the '-repositories' switch" { $results = Get-ZertoVirtualizationSite -siteIdentifier '1234' -repositories - $results.Count | Should -BeExactly 1 + $results.ConnectionType | Should -BeExactly "ServerMessageBlock" + $results.RepositoryIdentifier | Should -BeExactly "120355ce-fcd0-4820-a971-787d0470793b" + $results.RepositoryName | Should -BeExactly "Synology" + $results.StorageType | Should -BeExactly "NetworkShare" + $results.Path | Should -not -be $null } Assert-VerifiableMock From c422e269035db90b3b7ac43d6ed465fa0f3a9cc6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 9 Apr 2020 14:37:27 -0400 Subject: [PATCH 356/479] Update Readme for release --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 28a8c2f..4f845d7 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ PowerShell wrapper for Zerto Virtual Manager API ## Current Build Status -[![Codacy Badge](https://api.codacy.com/project/badge/Grade/0e31e5cdad534271ac688a82cc3ca17d)](https://app.codacy.com/app/wcarroll/ZertoApiWrapper?utm_source=github.com&utm_medium=referral&utm_content=wcarroll/ZertoApiWrapper&utm_campaign=Badge_Grade_Settings) [![Build Status](https://dev.azure.com/ZertoPublic/ZertoApiWrapper/_apis/build/status/ZertoPublic.ZertoApiWrapper?branchName=master)](https://dev.azure.com/ZertoPublic/ZertoApiWrapper/_build/latest?definitionId=1&branchName=master) +![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/ZertoApiWrapper?label=PowerShell%20Gallery%20Downloads) ## Legal Disclaimer @@ -32,6 +32,7 @@ PS> Install-Module -name ZertoApiWrapper ## Recent Updates +* April 10th, 2020: April Release. See [Release Notes](https://github.com/ZertoPublic/ZertoApiWrapper/releases/tag/1.4.0.20200410). * December 1st, 2019: November Release. See [Release Notes](https://github.com/ZertoPublic/ZertoApiWrapper/releases/tag/1.3.0.20191201). * August 1st, 2019: August Release. See [Release Notes](https://github.com/ZertoPublic/ZertoApiWrapper/releases/tag/1.2.0.20190801). * June 16th, 2019: Added functionality for Zerto Analytics. From e35939e592aca32a61c39782af3e4f1d27a57c09 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 9 Apr 2020 14:37:38 -0400 Subject: [PATCH 357/479] Bump Version --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index f0bb29e..88c5fb8 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.3.0 +1.4.0 From 9913c96d658cfaf7b0cfc41259588804f51775f3 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 14 Apr 2020 09:26:22 -0400 Subject: [PATCH 358/479] Refactor Function --- ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 index 4608c6e..de4f2bc 100644 --- a/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Copy-ZertoVpg.ps1 @@ -25,32 +25,25 @@ function Copy-ZertoVpg { process { $VpgIdToCopy = @{ VpgIdentifier = (Get-ZertoVpg -vpgName $SourceVpgName).vpgIdentifier } if ( $null -eq $VpgIdToCopy.VpgIdentifier ) { - Write-Error -Message "Unable to find a VPG with the name: $SourceVpgName. Please check the name and try again." - Break - } elseif ($VpgIdToCopy.VpgIdentifier.Count -gt 1) { - Write-Error -Message "More than one VPG was returned when searching for the VPG name: $SourceVpgName. Please try again." - Break + Throw "Unable to find a VPG with the name: $SourceVpgName. Please check the name and try again." } $BaseUri = "vpgSettings/copyVpgSettings" - $UnprotectedVms = Get-ZertoUnprotectedVm - $ProtectedVms = Get-ZertoProtectedVm + $VmsMap = Get-Map -InputObject (Get-ZertoUnprotectedVm) -Key 'VmName' -Value 'VmIdentifier' + $VmsMap += Get-Map -InputObject (Get-ZertoProtectedVm) -Key 'VmName' -Value 'VmIdentifier' $VMsToAdd = foreach ($VM in $VMs) { - if ($UnprotectedVms.VmName -contains $VM) { - $VmId = $UnprotectedVms | Where-Object { $_.VmName -like $VM } | Select-Object -ExpandProperty VmIdentifier - } elseif ($ProtectedVms.VmName -contains $VM) { - $VmId = $ProtectedVms | Where-Object { $_.VmName -like $VM } | Select-Object -ExpandProperty VmIdentifier + if ($VmsMap.Keys -contains $VM) { + [PSCustomObject]@{ + VmIdentifier = $VmsMap[$VM] + } } else { Write-Warning -Message "Unable to find VM with Name $VM. Skipping." } - $returnObject = New-Object PSObject - $returnObject | Add-Member -MemberType NoteProperty -Name "VmIdentifier" -Value $VmId - $returnObject } if ($PSCmdlet.ShouldProcess("$VMsToAdd", "Copying $SourceVpgName to $NewVpgName with Settings")) { $NewVpgId = Invoke-ZertoRestRequest -Uri $BaseUri -Body ($VpgIdToCopy | ConvertTo-Json) -Method "POST" $Uri = "{0}/{1}/vms" -f "vpgSettings", $NewVpgId foreach ($VM in $VMsToAdd) { - $null = Invoke-ZertoRestRequest -Uri $Uri -Body ($VM | ConvertTo-Json) -Method "POST" + $null = Invoke-ZertoRestRequest -Uri $Uri -Body ($VM | ConvertTo-Json) -Method "POST" -ErrorAction Stop } $Uri = "vpgSettings/{0}" -f $NewVpgId $CurrentSettings = Invoke-ZertoRestRequest -Uri $Uri @@ -58,7 +51,6 @@ function Copy-ZertoVpg { $Null = Invoke-ZertoRestRequest -Uri $Uri -Method "Put" -Body $($CurrentSettings | ConvertTo-Json -Depth 20) Save-ZertoVpgSetting -vpgSettingsIdentifier $NewVpgId } - } end { From 589a3b7d6e194632089c294ca8865b82c4154615 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 14 Apr 2020 09:25:16 -0400 Subject: [PATCH 359/479] Create Mock Data for Tests --- Tests/Public/Mocks/CopyVpgSettings.json | 79 +++++++++++++++++++++++++ Tests/Public/Mocks/UnprotectedVms.json | 18 ++++++ Tests/Public/Mocks/VpgId.txt | 1 + 3 files changed, 98 insertions(+) create mode 100644 Tests/Public/Mocks/CopyVpgSettings.json create mode 100644 Tests/Public/Mocks/UnprotectedVms.json create mode 100644 Tests/Public/Mocks/VpgId.txt diff --git a/Tests/Public/Mocks/CopyVpgSettings.json b/Tests/Public/Mocks/CopyVpgSettings.json new file mode 100644 index 0000000..07f85c3 --- /dev/null +++ b/Tests/Public/Mocks/CopyVpgSettings.json @@ -0,0 +1,79 @@ +{ + "Basic": { + "JournalHistoryInHours": 24, + "Name": "Test-SQL_Copy_1", + "Priority": "Medium", + "ProtectedSiteIdentifier": "15aa0d43-69cd-400a-8b99-fe94bbac3e19", + "RecoverySiteIdentifier": "8e1c9f53-4973-4a4a-b2dd-1ebb293614d8", + "RpoInSeconds": 300, + "ServiceProfileIdentifier": null, + "TestIntervalInMinutes": 262080, + "UseWanCompression": true, + "ZorgIdentifier": null + }, + "BootGroups": { + "BootGroups": [ + "@{BootDelayInSeconds=0; BootGroupIdentifier=00000000-0000-0000-0000-000000000000; Name=Default}" + ] + }, + "Journal": { + "DatastoreIdentifier": null, + "Limitation": { + "HardLimitInMB": 153600, + "HardLimitInPercent": 0, + "WarningThresholdInMB": 115200, + "WarningThresholdInPercent": 0 + } + }, + "LongTermRetention": null, + "Networks": { + "Failover": { + "Hypervisor": "@{DefaultNetworkIdentifier=09db6c5b-b956-430f-9589-b58876ca377a.network-20}", + "PublicCloud": null, + "VCD": null + }, + "FailoverTest": { + "Hypervisor": "@{DefaultNetworkIdentifier=09db6c5b-b956-430f-9589-b58876ca377a.network-20}", + "PublicCloud": null, + "VCD": null + } + }, + "Protected": { + "VCD": null + }, + "Recovery": { + "DefaultDatastoreClusterIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.group-p44", + "DefaultDatastoreIdentifier": null, + "DefaultFolderIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.group-v3", + "DefaultHostClusterIdentifier": "09db6c5b-b956-430f-9589-b58876ca377a.domain-c7", + "DefaultHostIdentifier": null, + "PublicCloud": null, + "ResourcePoolIdentifier": null, + "VCD": null + }, + "Scripting": { + "PostBackup": null, + "PostRecovery": { + "Command": null, + "Parameters": null, + "TimeoutInSeconds": 300 + }, + "PreRecovery": { + "Command": null, + "Parameters": null, + "TimeoutInSeconds": 300 + } + }, + "Vms": [ + { + "BootGroupIdentifier": "00000000-0000-0000-0000-000000000000", + "Journal": "@{DatastoreIdentifier=; Limitation=}", + "Nics": "", + "Recovery": "@{DatastoreClusterIdentifier=09db6c5b-b956-430f-9589-b58876ca377a.group-p44; DatastoreIdentifier=; FolderIdentifier=09db6c5b-b956-430f-9589-b58876ca377a.group-v3; HostClusterIdentifier=09db6c5b-b956-430f-9589-b58876ca377a.domain-c7; HostIdentifier=; PublicCloud=; ResourcePoolIdentifier=; VCD=}", + "VmIdentifier": "d809de8e-deb7-45cc-b620-08030a1143e1.vm-87", + "Volumes": "" + } + ], + "VpgIdentifier": null, + "VpgSettingsIdentifier": "0be951ef-229a-401c-9e0d-bd8a5baea19a" +} diff --git a/Tests/Public/Mocks/UnprotectedVms.json b/Tests/Public/Mocks/UnprotectedVms.json new file mode 100644 index 0000000..985c8fb --- /dev/null +++ b/Tests/Public/Mocks/UnprotectedVms.json @@ -0,0 +1,18 @@ +[ + { + "VmIdentifier": "d809de8e-deb7-45cc-b620-08030a1143e1.vm-87", + "VmName": "sql01-prod" + }, + { + "VmIdentifier": "d809de8e-deb7-45cc-b620-08030a1143e1.vm-34", + "VmName": "Ubuntu01" + }, + { + "VmIdentifier": "d809de8e-deb7-45cc-b620-08030a1143e1.vm-79", + "VmName": "Win2019Template" + }, + { + "VmIdentifier": "d809de8e-deb7-45cc-b620-08030a1143e1.vm-25", + "VmName": "WinTemplate" + } +] diff --git a/Tests/Public/Mocks/VpgId.txt b/Tests/Public/Mocks/VpgId.txt new file mode 100644 index 0000000..d6714d6 --- /dev/null +++ b/Tests/Public/Mocks/VpgId.txt @@ -0,0 +1 @@ +9607f923-00a7-477b-8b04-26a386214455 From c1b7c490ff902169218902baf03cd705375dba11 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 14 Apr 2020 09:26:56 -0400 Subject: [PATCH 360/479] Create Function Tests --- Tests/Public/Copy-ZertoVpg.Tests.ps1 | 71 ++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/Tests/Public/Copy-ZertoVpg.Tests.ps1 b/Tests/Public/Copy-ZertoVpg.Tests.ps1 index cd53274..4bb19e4 100644 --- a/Tests/Public/Copy-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Copy-ZertoVpg.Tests.ps1 @@ -48,7 +48,78 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } Context "$($global:function)::Function Unit Tests" { + Mock -ModuleName ZertoApiWrapper -CommandName Get-ZertoVpg -ParameterFilter { + $vpgName -eq "MyVpg" + } { + return (Get-Content "$global:here\Mocks\GetVpg.json" -Raw | ConvertFrom-Json) + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Get-ZertoVpg -ParameterFilter { + $vpgName -eq "NotAVpg" + } { + return $null + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Get-ZertoUnprotectedVm { + return (Get-Content "$global:here\Mocks\UnprotectedVms.json" -Raw | ConvertFrom-Json) + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Get-ZertoProtectedVm { + return (Get-Content "$global:here\Mocks\ProtectedVms.json" -Raw | ConvertFrom-Json) + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq "vpgSettings/copyVpgSettings" + } { + return (Get-Content "$global:here\Mocks\VpgId.txt") + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq "vpgSettings/9607f923-00a7-477b-8b04-26a386214455/vms" + } { + return $null + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + $uri -eq "vpgSettings/9607f923-00a7-477b-8b04-26a386214455" + } { + return (Get-Content "$global:here\Mocks\CopyVpgSettings.json" -Raw | ConvertFrom-Json) + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Save-ZertoVpgSetting { + return (Get-Content "$global:here\Mocks\TaskId.txt") + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Get-Map -ParameterFilter { + $null -ne $InputObject[0].VpgName + } { + @{ + "WindowsBox" = "d809de8e-deb7-45cc-b620-08030a1143e1.vm-90" + "CentOS-Test" = "d809de8e-deb7-45cc-b620-08030a1143e1.vm-88" + "Application01" = "d809de8e-deb7-45cc-b620-08030a1143e1.vm-35" + "sql01-test" = "d809de8e-deb7-45cc-b620-08030a1143e1.vm-73" + "jenkins" = "d809de8e-deb7-45cc-b620-08030a1143e1.vm-75" + } + } -Verifiable + Mock -ModuleName ZertoApiWrapper -CommandName Get-Map -ParameterFilter { + $null -eq $InputObject[0].VpgName + } { + @{ + "Win2019Template" = "d809de8e-deb7-45cc-b620-08030a1143e1.vm-79" + "Ubuntu01" = "d809de8e-deb7-45cc-b620-08030a1143e1.vm-34" + "WinTemplate" = "d809de8e-deb7-45cc-b620-08030a1143e1.vm-25" + "sql01-prod" = "d809de8e-deb7-45cc-b620-08030a1143e1.vm-87" + "nczvm.nc.lab" = "d809de8e-deb7-45cc-b620-08030a1143e1.vm-30" + } + } -Verifiable + It "Should throw an error when no VPG is found" { + { Copy-ZertoVpg -SourceVpgName "NotAVpg" -NewVpgName "NewVpg" -VMs 'sql01-prod', 'Ubuntu01' } | Should Throw "Unable to find a VPG with the name:" + } + + It "Returns a TaskIdentifier when called correctly" { + Copy-ZertoVpg -SourceVpgName "MyVpg" -NewVpgName "NewVpg" -VMs 'sql01-prod', 'Ubuntu01' | Should -Be "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a" + } + + It "Should warn when VM is not found" { + $results = Copy-ZertoVpg -SourceVpgName "MyVpg" -NewVpgName "NewVpg" -VMs 'sql01-prod', 'Ubuntu01', 'DoesNotExist' 3>&1 + $results[0].ToString() | Should -Match 'Unable to find VM with Name DoesNotExist. Skipping.' + + } + + Assert-VerifiableMock } } From 9fafe4b58be64eeb1eb1ce88cf0f151bbb2a4093 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 17 Apr 2020 08:50:27 -0400 Subject: [PATCH 361/479] Make PowerShell Gallery Badge Clickable --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f845d7..23216ba 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ PowerShell wrapper for Zerto Virtual Manager API ## Current Build Status [![Build Status](https://dev.azure.com/ZertoPublic/ZertoApiWrapper/_apis/build/status/ZertoPublic.ZertoApiWrapper?branchName=master)](https://dev.azure.com/ZertoPublic/ZertoApiWrapper/_build/latest?definitionId=1&branchName=master) -![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/ZertoApiWrapper?label=PowerShell%20Gallery%20Downloads) +[![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/ZertoApiWrapper?label=PowerShell%20Gallery%20Downloads)](https://www.powershellgallery.com/packages/ZertoApiWrapper) ## Legal Disclaimer From b186c561e62d0d38c44d29d79523fc5b38323b80 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 20 Apr 2020 16:14:41 -0400 Subject: [PATCH 362/479] Start of Next Releasenotes --- RELEASENOTES.md | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 44ecdd6..a0d9dc1 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -2,28 +2,4 @@ ### Zerto Virtual Manager -* Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/60) in the `Get-ZertoRecoveryReport` function where the `-VpgIdentifier` parameter was not working. This parameter is not accepted by the API as a valid filter and is ignored. This parameter has been removed from the function. -* Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/61) where the `Export-ZertoVpgNicSetting` function would not properly execute when run against a VM with no NICs attached. -* In reviewing the `Export-ZertoVpgNicSetting`, a review of the `Import-ZertoVpgNicSetting` was completed and it was determined to update the import logic based on various test cases. Along with this, it is now possible to reset the NIC settings to the default state with the `Import-ZertoVpgNicSetting` command. Please review the [Import-ZertoVpgNicSetting help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVmNicSetting.md) to review the updated options and import logic. -* Refactored the `Checkpoint-ZertoVpg` command to allow pipeline input (ByValue and ByProperty) for the VpgName parameter. -* Corrected a parameter typo in the `Get-ZertoVpgSetting` function. The misspelt parameter was added as an alias to ensure any existing scripts using the parameter continue to function. -* Refactored the `Get-ZertoVpg` command to remove repetitive commands and variables that are no longer required. -* Moved `Invoke-ZertoRestRequest` and `Invoke-ZARestRequest` to be public functions. As there become more and more scenarios where there are not prebuilt functions to accomplish complex specialized tasks, it became apparent that these functions could be leveraged to make the experience and workflow easier. -* Updated the `Install-ZertoVra` logic to ensure that the target datastore is available on the target host. There isn't currently any method to validate the target network, but if that becomes available in a later version of the API, the function will be updated. -* Updated the `Install-ZertoVra` function to allow for installation of the VRA using the host password method. Please review the [Install-ZertoVra](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Install-ZertoVra.md) documentation for syntax and examples. -* Updated the `Edit-ZertoVra` function to allow for modification of the associated ESX host password if the need arises. Please review the [Edit-ZertoVra](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Edit-ZertoVra.md) documentation for syntax and examples. -* Added a new function, `Set-ZertoUserCredential`, to allow the updating of the username and password used to connect the Zerto Virtual Manager to the paired hypervisor. Please see the [Set-ZertoUserCredential](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Set-ZertoUserCredential.md) help for additional information. -* With the release of [Zerto 8.0](https://www.zerto.com/zerto-8-0-general-availability/) some additional API endpoints have become available. - * Updated `Get-ZertoVirtualizationSite` to add the `-repository` parameter to enable returning information for LTR repositories. - * Updated `Get-ZertoVpgSetting` to add the `-ltr` parameter to enable returning information for current LTR settings for the selected VPG. - -### Zerto Analytics - -* Added several functions for the newly added [Zerto Analytics](https://analytics.zerto.com) Planner. - * `Get-ZAPlannerSite` Help can be found here: [Get-ZAPlannerSite](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerSite.md) - * `Get-ZAPlannerStatsReport` Help can be found here: [Get-ZAPlannerStatsReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerStatsReport.md) - * `Get-ZAPlannerJournalSizeReport` Help can be found here: [Get-ZAPlannerJournalSizeReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerJournalSizeReport.md) - * `Get-ZAPlannerNetworkPerformanceReport` Help can be found here: [Get-ZAPlannerNetworkPerformanceReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerNetworkPerformanceReport.md) - * `Get-ZAPlannerWanReport` Help can be found here: [Get-ZAPlannerWanReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerWanReport.md) - * `Get-ZAPlannerZcasReport` Help can be found here: [Get-ZAPlannerZcasReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerZcasReport.md) -* Created `Get-ZAProtectedVm` and `Get-ZAProtectedVmReport` functions to leverage the newly released Zerto Analytics APIs for this data. Help files can be found here: [Get-ZAProtectedVm](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVm.md) and [Get-ZAProtectedVmReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVmReport.md) +* Refactored `Copy-ZertoVpg` functionality to leverage identifier and name maps and eliminate `where-object` searches. From fb45693fb19e8ac2851bdfa7a7aa08fb94201a8d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 11 Apr 2020 22:35:23 -0400 Subject: [PATCH 363/479] Pester 5 Prep --- Tests/Private/Get-ZertoApiFilter.Tests.ps1 | 4 ++-- Tests/Public/Add-ZertoPeerSite.Tests.ps1 | 6 +++--- Tests/Public/Connect-ZertoAnalytics.Tests.ps1 | 3 --- Tests/Public/Connect-ZertoServer.Tests.ps1 | 8 ++++---- Tests/Public/Get-ZAAlert.Tests.ps1 | 10 +++++----- Tests/Public/Get-ZADatastore.Tests.ps1 | 6 +++--- Tests/Public/Get-ZAEvent.Tests.ps1 | 12 ++++++------ Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 | 10 +++++----- Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 | 10 +++++----- Tests/Public/Get-ZAJournalBreach.Tests.ps1 | 6 +++--- Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 | 6 +++--- .../Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 | 10 +++++----- Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 | 10 +++++----- Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 | 10 +++++----- .../Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 | 10 +++++----- Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 | 10 +++++----- Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 | 6 +++--- Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 | 6 +++--- Tests/Public/Get-ZAJournalSummary.Tests.ps1 | 6 +++--- Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 | 6 +++--- .../Get-ZANetworkSiteAveragePerformance.Tests.ps1 | 6 +++--- Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 | 2 +- Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 | 2 +- Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 | 6 +++--- .../Get-ZANetworkVpgAveragePerformance.Tests.ps1 | 6 +++--- Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 | 2 +- Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 | 2 +- .../Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 | 2 +- .../Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 | 2 +- Tests/Public/Get-ZAPlannerSite.Tests.ps1 | 2 +- Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 | 2 +- Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 | 2 +- Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 | 2 +- Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 | 2 +- Tests/Public/Get-ZARPOAverage.Tests.ps1 | 6 +++--- Tests/Public/Get-ZARPOBreach.Tests.ps1 | 2 +- Tests/Public/Get-ZARPOStat.Tests.ps1 | 2 +- Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 | 2 +- Tests/Public/Get-ZARPOSummary.Tests.ps1 | 2 +- Tests/Public/Get-ZASite.Tests.ps1 | 2 +- Tests/Public/Get-ZASitePair.Tests.ps1 | 2 +- Tests/Public/Get-ZASiteTopology.Tests.ps1 | 2 +- Tests/Public/Get-ZATask.Tests.ps1 | 6 +++--- Tests/Public/Get-ZAVolume.Tests.ps1 | 2 +- Tests/Public/Get-ZAVpg.Tests.ps1 | 2 +- Tests/Public/Get-ZertoDatastore.Tests.ps1 | 2 +- Tests/Public/Get-ZertoEvent.Tests.ps1 | 8 ++++---- Tests/Public/Get-ZertoPeerSite.Tests.ps1 | 2 +- Tests/Public/Invoke-ZARestRequest.Tests.ps1 | 2 +- Tests/Public/Invoke-ZertoFailover.Tests.ps1 | 10 +++++----- Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 | 6 +++--- Tests/Public/Invoke-ZertoMove.Tests.ps1 | 8 ++++---- Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 | 6 +++--- Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 | 4 ++-- 54 files changed, 135 insertions(+), 138 deletions(-) diff --git a/Tests/Private/Get-ZertoApiFilter.Tests.ps1 b/Tests/Private/Get-ZertoApiFilter.Tests.ps1 index a4b5978..a42e57e 100644 --- a/Tests/Private/Get-ZertoApiFilter.Tests.ps1 +++ b/Tests/Private/Get-ZertoApiFilter.Tests.ps1 @@ -52,11 +52,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } it "one item test" { - Get-ZertoApiFilter -filtertable $oneItemTest | should be "?OneItem=Test" + Get-ZertoApiFilter -filtertable $oneItemTest | should -Be "?OneItem=Test" } it "should ignore CommonParameters" { - Get-ZertoApiFilter -filtertable $commonParamTest | should be "?OneItem=Test" + Get-ZertoApiFilter -filtertable $commonParamTest | should -Be "?OneItem=Test" } it "should process a filter table with more than one item" { diff --git a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 index bdf4f52..3bbe71b 100644 --- a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 @@ -43,7 +43,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } @@ -53,11 +53,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } It "targetPort Parameter should have a Min value of 1024" { - (Get-Command $global:function).Parameters['targetPort'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 1024 + (Get-Command $global:function).Parameters['targetPort'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 1024 } It "targetPort Parameter should have a Max value of 65535" { - (Get-Command $global:function).Parameters['targetPort'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 65535 + (Get-Command $global:function).Parameters['targetPort'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 65535 } It "Supports 'SupportsShouldProcess'" { diff --git a/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 index 661e985..2c335b6 100644 --- a/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 +++ b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 @@ -13,8 +13,6 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } } - - Context "$($global:function)::Function Unit Tests" { InModuleScope -ModuleName ZertoApiWrapper { @@ -68,7 +66,6 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZARestRequest -Exactly 1 } - } Remove-Variable -Name function -Scope Global diff --git a/Tests/Public/Connect-ZertoServer.Tests.ps1 b/Tests/Public/Connect-ZertoServer.Tests.ps1 index 1cdc5b6..b43ca28 100644 --- a/Tests/Public/Connect-ZertoServer.Tests.ps1 +++ b/Tests/Public/Connect-ZertoServer.Tests.ps1 @@ -105,11 +105,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $headers = Connect-ZertoServer -zertoServer $Server -credential $credential -returnHeaders It "returns a Hashtable with 2 keys" { $headers | Should -BeOfType Hashtable - $headers.keys.count | Should be 2 + $headers.keys.count | Should -Be 2 } It "return value has a key called 'x-zerto-session'" { - $headers.ContainsKey('x-zerto-session') | Should be $true + $headers.ContainsKey('x-zerto-session') | Should -Be $true } It "return key 'x-zerto-session' value should be a string" { @@ -118,11 +118,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } It "return value has a key called 'accept'" { - $headers.ContainsKey('accept') | Should be $true + $headers.ContainsKey('accept') | Should -Be $true } It "return key 'accept' value should be 'application/json'" { - $headers['accept'] | Should be 'application/json' + $headers['accept'] | Should -Be 'application/json' } It "should not require a port to be specified" { diff --git a/Tests/Public/Get-ZAAlert.Tests.ps1 b/Tests/Public/Get-ZAAlert.Tests.ps1 index 9695510..474bf6f 100644 --- a/Tests/Public/Get-ZAAlert.Tests.ps1 +++ b/Tests/Public/Get-ZAAlert.Tests.ps1 @@ -6,8 +6,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } $ParameterTestCases = @( @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } It "LimitTo Parameter should have a Min value of 1" { - (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 1 + (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 1 } It "LimitTo Parameter should have a Max value of 1000000" { - (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 1000000 + (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 1000000 } } diff --git a/Tests/Public/Get-ZADatastore.Tests.ps1 b/Tests/Public/Get-ZADatastore.Tests.ps1 index c148811..c1e5653 100644 --- a/Tests/Public/Get-ZADatastore.Tests.ps1 +++ b/Tests/Public/Get-ZADatastore.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } $ParameterTestCases = @( @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAEvent.Tests.ps1 b/Tests/Public/Get-ZAEvent.Tests.ps1 index e1e40f6..3766d44 100644 --- a/Tests/Public/Get-ZAEvent.Tests.ps1 +++ b/Tests/Public/Get-ZAEvent.Tests.ps1 @@ -6,8 +6,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 16 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 16 + It "$global:function should have exactly 16 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 16 } $ParameterTestCases = @( @@ -42,21 +42,21 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } It "LimitTo Parameter should have a Min value of 1" { - (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 1 + (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 1 } It "LimitTo Parameter should have a Max value of 1000000" { - (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 1000000 + (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 1000000 } It "Category parameter should only have 2 options" { - (Get-Command $global:function).Parameters['category'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should Be 2 + (Get-Command $global:function).Parameters['category'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should -Be 2 } It "Category parameter should take 'events'" { diff --git a/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 index 80bf748..1032f8f 100644 --- a/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 @@ -6,8 +6,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( @@ -36,17 +36,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } It "Interval Parameter should have a Min value of 60" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60 } It "Interval Parameter should have a Max value of 2678400" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400 } } diff --git a/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 index f013489..ada02a1 100644 --- a/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } It "Interval Parameter should have a Min value of 60" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60 } It "Interval Parameter should have a Max value of 2678400" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400 } } diff --git a/Tests/Public/Get-ZAJournalBreach.Tests.ps1 b/Tests/Public/Get-ZAJournalBreach.Tests.ps1 index b0761f1..b0ad1b1 100644 --- a/Tests/Public/Get-ZAJournalBreach.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalBreach.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } $ParameterTestCases = @( @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 b/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 index b0761f1..b0ad1b1 100644 --- a/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } $ParameterTestCases = @( @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 index 6583c27..a5f82d1 100644 --- a/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } It "Interval Parameter should have a Min value of 60" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60 } It "Interval Parameter should have a Max value of 2678400" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400 } } diff --git a/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 index 6583c27..a5f82d1 100644 --- a/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } It "Interval Parameter should have a Min value of 60" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60 } It "Interval Parameter should have a Max value of 2678400" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400 } } diff --git a/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 index 6583c27..a5f82d1 100644 --- a/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } It "Interval Parameter should have a Min value of 60" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60 } It "Interval Parameter should have a Max value of 2678400" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400 } } diff --git a/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 index 6583c27..a5f82d1 100644 --- a/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } It "Interval Parameter should have a Min value of 60" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60 } It "Interval Parameter should have a Max value of 2678400" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400 } } diff --git a/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 index 6583c27..a5f82d1 100644 --- a/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } It "Interval Parameter should have a Min value of 60" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60 } It "Interval Parameter should have a Max value of 2678400" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400 } } diff --git a/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 b/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 index b0761f1..b0ad1b1 100644 --- a/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } $ParameterTestCases = @( @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 b/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 index b0761f1..b0ad1b1 100644 --- a/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } $ParameterTestCases = @( @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAJournalSummary.Tests.ps1 b/Tests/Public/Get-ZAJournalSummary.Tests.ps1 index b0761f1..b0ad1b1 100644 --- a/Tests/Public/Get-ZAJournalSummary.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSummary.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } $ParameterTestCases = @( @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 index df1588a..1a3b5cc 100644 --- a/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 @@ -37,17 +37,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } It "Interval Parameter should have a Min value of 60" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60 } It "Interval Parameter should have a Max value of 2678400" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400 } } diff --git a/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 index df1588a..1a3b5cc 100644 --- a/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 @@ -37,17 +37,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } It "Interval Parameter should have a Min value of 60" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60 } It "Interval Parameter should have a Max value of 2678400" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400 } } diff --git a/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 index 80f948f..2c7833c 100644 --- a/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 @@ -36,7 +36,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 index 80f948f..2c7833c 100644 --- a/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 @@ -36,7 +36,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 index 191f7a9..ada02a1 100644 --- a/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } It "Interval Parameter should have a Min value of 60" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60 } It "Interval Parameter should have a Max value of 2678400" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400 } } diff --git a/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 index 191f7a9..ada02a1 100644 --- a/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } It "Interval Parameter should have a Min value of 60" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60 } It "Interval Parameter should have a Max value of 2678400" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400 } } diff --git a/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 index e9026db..f1ad9c2 100644 --- a/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 @@ -34,7 +34,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 index e9026db..f1ad9c2 100644 --- a/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 @@ -34,7 +34,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 index bed9818..376f710 100644 --- a/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 @@ -42,7 +42,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 index 5e2b7f6..be0afa1 100644 --- a/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 @@ -42,7 +42,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAPlannerSite.Tests.ps1 b/Tests/Public/Get-ZAPlannerSite.Tests.ps1 index ef63e5c..f15ee7b 100644 --- a/Tests/Public/Get-ZAPlannerSite.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerSite.Tests.ps1 @@ -27,7 +27,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 index bed9818..376f710 100644 --- a/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 @@ -42,7 +42,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 index 238ba22..97173fa 100644 --- a/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 @@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 index 0412e64..c7302d5 100644 --- a/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 @@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 b/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 index 18f58ae..7cb989f 100644 --- a/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 +++ b/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZARPOAverage.Tests.ps1 b/Tests/Public/Get-ZARPOAverage.Tests.ps1 index 8619700..aa6d9e7 100644 --- a/Tests/Public/Get-ZARPOAverage.Tests.ps1 +++ b/Tests/Public/Get-ZARPOAverage.Tests.ps1 @@ -35,17 +35,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } It "Interval Parameter should have a Min value of 60" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 60 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 60 } It "Interval Parameter should have a Max value of 2678400" { - (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 2678400 + (Get-Command $global:function).Parameters['Interval'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 2678400 } } diff --git a/Tests/Public/Get-ZARPOBreach.Tests.ps1 b/Tests/Public/Get-ZARPOBreach.Tests.ps1 index 38456f9..b0ad1b1 100644 --- a/Tests/Public/Get-ZARPOBreach.Tests.ps1 +++ b/Tests/Public/Get-ZARPOBreach.Tests.ps1 @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZARPOStat.Tests.ps1 b/Tests/Public/Get-ZARPOStat.Tests.ps1 index 38456f9..b0ad1b1 100644 --- a/Tests/Public/Get-ZARPOStat.Tests.ps1 +++ b/Tests/Public/Get-ZARPOStat.Tests.ps1 @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 b/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 index 38456f9..b0ad1b1 100644 --- a/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 +++ b/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZARPOSummary.Tests.ps1 b/Tests/Public/Get-ZARPOSummary.Tests.ps1 index 38456f9..b0ad1b1 100644 --- a/Tests/Public/Get-ZARPOSummary.Tests.ps1 +++ b/Tests/Public/Get-ZARPOSummary.Tests.ps1 @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZASite.Tests.ps1 b/Tests/Public/Get-ZASite.Tests.ps1 index fd61b07..e9c710c 100644 --- a/Tests/Public/Get-ZASite.Tests.ps1 +++ b/Tests/Public/Get-ZASite.Tests.ps1 @@ -14,7 +14,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } It "zOrgIdentifier has the NotNullOrEmpty Validator" { - (Get-Command $global:function).Parameters['zOrgIdentifier'].Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should Be 1 + (Get-Command $global:function).Parameters['zOrgIdentifier'].Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 } } diff --git a/Tests/Public/Get-ZASitePair.Tests.ps1 b/Tests/Public/Get-ZASitePair.Tests.ps1 index 18f58ae..7cb989f 100644 --- a/Tests/Public/Get-ZASitePair.Tests.ps1 +++ b/Tests/Public/Get-ZASitePair.Tests.ps1 @@ -29,7 +29,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZASiteTopology.Tests.ps1 b/Tests/Public/Get-ZASiteTopology.Tests.ps1 index f1136ba..f97e366 100644 --- a/Tests/Public/Get-ZASiteTopology.Tests.ps1 +++ b/Tests/Public/Get-ZASiteTopology.Tests.ps1 @@ -27,7 +27,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZATask.Tests.ps1 b/Tests/Public/Get-ZATask.Tests.ps1 index 7e712d4..c8ceb12 100644 --- a/Tests/Public/Get-ZATask.Tests.ps1 +++ b/Tests/Public/Get-ZATask.Tests.ps1 @@ -34,17 +34,17 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } It "Interval Parameter should have a Min value of 1" { - (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should Be 1 + (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 1 } It "Interval Parameter should have a Max value of 1000000" { - (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should Be 1000000 + (Get-Command $global:function).Parameters['limitTo'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 1000000 } } diff --git a/Tests/Public/Get-ZAVolume.Tests.ps1 b/Tests/Public/Get-ZAVolume.Tests.ps1 index c4b6a8c..6d1a5a0 100644 --- a/Tests/Public/Get-ZAVolume.Tests.ps1 +++ b/Tests/Public/Get-ZAVolume.Tests.ps1 @@ -30,7 +30,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZAVpg.Tests.ps1 b/Tests/Public/Get-ZAVpg.Tests.ps1 index ae44aa0..3b9bd52 100644 --- a/Tests/Public/Get-ZAVpg.Tests.ps1 +++ b/Tests/Public/Get-ZAVpg.Tests.ps1 @@ -28,7 +28,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Get-ZertoDatastore.Tests.ps1 b/Tests/Public/Get-ZertoDatastore.Tests.ps1 index 5deb346..49d9e80 100644 --- a/Tests/Public/Get-ZertoDatastore.Tests.ps1 +++ b/Tests/Public/Get-ZertoDatastore.Tests.ps1 @@ -12,7 +12,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } It "datastoreIdentifier parameter does not take null or empty values" { - (Get-Command $global:function).Parameters['datastoreIdentifier'].Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.count | Should Be 1 + (Get-Command $global:function).Parameters['datastoreIdentifier'].Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.count | Should -Be 1 } } diff --git a/Tests/Public/Get-ZertoEvent.Tests.ps1 b/Tests/Public/Get-ZertoEvent.Tests.ps1 index b257e26..4149371 100644 --- a/Tests/Public/Get-ZertoEvent.Tests.ps1 +++ b/Tests/Public/Get-ZertoEvent.Tests.ps1 @@ -53,13 +53,13 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } It "entityType parameter only accecpts 4 different values" { - (Get-Command $global:function).Parameters['entityType'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should be 4 + (Get-Command $global:function).Parameters['entityType'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should -Be 4 } It "entityType parameter accecpts 'VPG' as a Value" { @@ -79,7 +79,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } It "category parameter only accecpts 3 different values" { - (Get-Command $global:function).Parameters['category'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should be 3 + (Get-Command $global:function).Parameters['category'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should -Be 3 } It "category parameter accecpts 'All' as a Value" { @@ -95,7 +95,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } It "eventCategory parameter only accecpts 3 different values" { - (Get-Command $global:function).Parameters['eventCategory'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should be 3 + (Get-Command $global:function).Parameters['eventCategory'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues.Count | Should -Be 3 } It "eventCategory parameter accecpts 'All' as a Value" { diff --git a/Tests/Public/Get-ZertoPeerSite.Tests.ps1 b/Tests/Public/Get-ZertoPeerSite.Tests.ps1 index 2583c97..9456bd7 100644 --- a/Tests/Public/Get-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoPeerSite.Tests.ps1 @@ -38,7 +38,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | Should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Invoke-ZARestRequest.Tests.ps1 b/Tests/Public/Invoke-ZARestRequest.Tests.ps1 index c545e56..7a6eade 100644 --- a/Tests/Public/Invoke-ZARestRequest.Tests.ps1 +++ b/Tests/Public/Invoke-ZARestRequest.Tests.ps1 @@ -63,7 +63,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } It "runs when called" { - Invoke-ZARestRequest -uri "myuri" | Should Be "Ran Command" + Invoke-ZARestRequest -uri "myuri" | Should -Be "Ran Command" } It "throws when the last action was over 60 minutes ago" { diff --git a/Tests/Public/Invoke-ZertoFailover.Tests.ps1 b/Tests/Public/Invoke-ZertoFailover.Tests.ps1 index 11dd2f9..efe2cc7 100644 --- a/Tests/Public/Invoke-ZertoFailover.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailover.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 20 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 20 + It "$global:function should have exactly 20 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 20 } $ParameterTestCases = @( @@ -55,7 +55,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } @@ -82,11 +82,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { (Get-Command $global:function).Parameters['shutdownPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 2 } - it "Time to wait before shutdown in sec should have a default value of 3600" { + It "Time to wait before shutdown in sec should have a default value of 3600" { Get-Command $global:function | Should -HaveParameter timeToWaitBeforeShutdownInSec -DefaultValue 3600 } - it "Time to wait before shutdown in sec should have a minimum value of 300 and max value of 86400" { + It "Time to wait before shutdown in sec should have a minimum value of 300 and max value of 86400" { (Get-Command $global:function).Parameters['timeToWaitBeforeShutdownInSec'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 300 (Get-Command $global:function).Parameters['timeToWaitBeforeShutdownInSec'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 86400 } diff --git a/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 b/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 index aec697f..b5d1cd6 100644 --- a/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 @@ -6,8 +6,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 15 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 15 + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 } $ParameterTestCases = @( @@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Invoke-ZertoMove.Tests.ps1 b/Tests/Public/Invoke-ZertoMove.Tests.ps1 index 6217a52..393d66b 100644 --- a/Tests/Public/Invoke-ZertoMove.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMove.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 20 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 20 + It "$global:function should have exactly 20 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 20 } $ParameterTestCases = @( @@ -55,7 +55,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } @@ -67,7 +67,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { (Get-Command $global:function).Parameters['commitPolicy'].Attributes.Where{ $_ -is [ValidateSet] }.ValidValues | Should -Contain 'None' } - it "Commit Policy Timeout should have a minimum value of 300 and max value of 86400" { + It "Commit Policy Timeout should have a minimum value of 300 and max value of 86400" { (Get-Command $global:function).Parameters['commitPolicyTimeout'].Attributes.Where{ $_ -is [ValidateRange] }.MinRange | Should -Be 300 (Get-Command $global:function).Parameters['commitPolicyTimeout'].Attributes.Where{ $_ -is [ValidateRange] }.MaxRange | Should -Be 86400 } diff --git a/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 b/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 index b8abfd8..81f585a 100644 --- a/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 @@ -6,8 +6,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 16 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 16 + It "$global:function should have exactly 16 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 16 } $ParameterTestCases = @( @@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } default { - $true | should be $false -Because "No Validation Selected. Review test cases" + $true | Should -Be $false -Because "No Validation Selected. Review test cases" } } } diff --git a/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 b/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 index f7a23d5..f0c7315 100644 --- a/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 @@ -40,12 +40,12 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { It " parameter cannot be null or empty" -TestCases $ParameterValidationTestCases { param($ParameterName) $thisParameter = $thisCommand.Parameters[$ParameterName] - $thisParameter.Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should Be 1 + $thisParameter.Attributes.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 } It "Method parameter can only be 'GET', 'POST', 'PUT', 'DELETE'" { $thisParameter = $thisCommand.Parameters['method'] - $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.Count | Should Be 1 + $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.Count | Should -Be 1 $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'GET' | Should -BeTrue $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'PUT' | Should -BeTrue $thisParameter.Attributes.Where{ $_ -is [ValidateSet] }.validValues -contains 'POST' | Should -BeTrue From 71610ce9fe37b01820a4025905c2a5c093c50eff Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 14 Apr 2020 16:03:15 -0400 Subject: [PATCH 364/479] Pin Pester v4 --- ZertoApiWrapper.build.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 197036c..1bafeee 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -31,9 +31,11 @@ task CheckPlatyPSInstalled { <# Synopsis: Ensure Pester is installed #> task CheckPesterInstalled { + Get-Module -Name Pester | Remove-Module -Force if ($null -eq (Get-Module -List Pester)) { - Install-Module -Scope CurrentUser -Repository PSGallery -Name Pester + Install-Module -Scope CurrentUser -Repository PSGallery -Name Pester -MaximumVersion 4.99 } + Import-Module -Name Pester -MaximumVersion 4.99 -Force } <# Synopsis: Ensure PSScriptAnalyzer is installed #> From 6620246e4cd13488ebbc18a71874734ec1b9f4a4 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 20 Apr 2020 16:35:02 -0400 Subject: [PATCH 365/479] Update Method to Grab Path https://jakubjares.com/2020/04/11/pester5-importing-ps-files/ --- Tests/Private/Get-Map.Tests.ps1 | 26 +++++++++---------- Tests/Private/Get-ZertoApiFilter.Tests.ps1 | 20 +++++++------- Tests/Public/Add-ZertoPeerSite.Tests.ps1 | 4 +-- Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 | 4 +-- Tests/Public/Connect-ZertoAnalytics.Tests.ps1 | 4 +-- Tests/Public/Connect-ZertoServer.Tests.ps1 | 4 +-- Tests/Public/Copy-ZertoVpg.Tests.ps1 | 4 +-- Tests/Public/Disconnect-ZertoServer.Tests.ps1 | 4 +-- Tests/Public/Edit-ZertoVra.Tests.ps1 | 16 ++++++------ .../Public/Export-ZertoVmNicSetting.Tests.ps1 | 8 +++--- Tests/Public/Export-ZertoVpg.Tests.ps1 | 12 ++++----- Tests/Public/Get-ZAAlert.Tests.ps1 | 4 +-- Tests/Public/Get-ZADatastore.Tests.ps1 | 4 +-- Tests/Public/Get-ZAEvent.Tests.ps1 | 4 +-- .../Get-ZAJournalAverageHistory.Tests.ps1 | 4 +-- .../Public/Get-ZAJournalAverageSize.Tests.ps1 | 4 +-- Tests/Public/Get-ZAJournalBreach.Tests.ps1 | 4 +-- .../Public/Get-ZAJournalHistoryStat.Tests.ps1 | 4 +-- .../Get-ZAJournalSiteAverageHistory.Tests.ps1 | 4 +-- .../Get-ZAJournalSiteAverageSize.Tests.ps1 | 4 +-- .../Get-ZAJournalSiteHistoryStat.Tests.ps1 | 4 +-- .../Get-ZAJournalSiteHistorySummary.Tests.ps1 | 4 +-- .../Get-ZAJournalSiteSizeStat.Tests.ps1 | 4 +-- .../Get-ZAJournalStatusProportion.Tests.ps1 | 4 +-- .../Public/Get-ZAJournalStorageStat.Tests.ps1 | 4 +-- Tests/Public/Get-ZAJournalSummary.Tests.ps1 | 4 +-- Tests/Public/Get-ZALicense.Tests.ps1 | 8 +++--- Tests/Public/Get-ZAMonitoring.Tests.ps1 | 10 +++---- .../Get-ZANetworkSiteAverageIOPS.Tests.ps1 | 4 +-- ...-ZANetworkSiteAveragePerformance.Tests.ps1 | 4 +-- Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 | 4 +-- .../Public/Get-ZANetworkSiteSummary.Tests.ps1 | 4 +-- .../Get-ZANetworkVpgAverageIOPS.Tests.ps1 | 4 +-- ...t-ZANetworkVpgAveragePerformance.Tests.ps1 | 4 +-- Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 | 4 +-- .../Public/Get-ZANetworkVpgSummary.Tests.ps1 | 4 +-- .../Get-ZAPlannerJournalSizeReport.Tests.ps1 | 4 +-- ...APlannerNetworkPerformanceReport.Tests.ps1 | 4 +-- Tests/Public/Get-ZAPlannerSite.Tests.ps1 | 4 +-- .../Public/Get-ZAPlannerStatsReport.Tests.ps1 | 4 +-- Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 | 4 +-- .../Public/Get-ZAPlannerZcasReport.Tests.ps1 | 4 +-- Tests/Public/Get-ZAProtectedVm.Tests.ps1 | 4 +-- .../Public/Get-ZAProtectedVmReport.Tests.ps1 | 4 +-- .../Public/Get-ZARPOAccountAverage.Tests.ps1 | 4 +-- Tests/Public/Get-ZARPOAverage.Tests.ps1 | 4 +-- Tests/Public/Get-ZARPOBreach.Tests.ps1 | 4 +-- Tests/Public/Get-ZARPOStat.Tests.ps1 | 4 +-- .../Get-ZARPOStatusProportion.Tests.ps1 | 4 +-- Tests/Public/Get-ZARPOSummary.Tests.ps1 | 4 +-- Tests/Public/Get-ZASite.Tests.ps1 | 4 +-- Tests/Public/Get-ZASitePair.Tests.ps1 | 4 +-- Tests/Public/Get-ZASiteTopology.Tests.ps1 | 4 +-- Tests/Public/Get-ZATask.Tests.ps1 | 4 +-- Tests/Public/Get-ZAVolume.Tests.ps1 | 4 +-- Tests/Public/Get-ZAVpg.Tests.ps1 | 4 +-- Tests/Public/Get-ZAzOrg.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoAlert.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoDatastore.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoEvent.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoLicense.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoLocalSite.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoPeerSite.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoProtectedVm.Tests.ps1 | 4 +-- .../Public/Get-ZertoRecoveryReport.Tests.ps1 | 4 +-- .../Public/Get-ZertoResourcesReport.Tests.ps1 | 4 +-- .../Public/Get-ZertoServiceProfile.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoTask.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 | 4 +-- .../Get-ZertoVirtualizationSite.Tests.ps1 | 6 ++--- Tests/Public/Get-ZertoVolume.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoVpg.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoVpgSetting.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoVra.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoZorg.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoZsspSession.Tests.ps1 | 4 +-- .../Public/Import-ZertoVmNicSetting.Tests.ps1 | 8 +++--- Tests/Public/Import-ZertoVpg.Tests.ps1 | 8 +++--- Tests/Public/Install-ZertoVra.Tests.ps1 | 4 +-- Tests/Public/Invoke-ZARestRequest.Tests.ps1 | 4 +-- .../Public/Invoke-ZertoEvacuateVra.Tests.ps1 | 4 +-- Tests/Public/Invoke-ZertoFailover.Tests.ps1 | 4 +-- .../Invoke-ZertoFailoverCommit.Tests.ps1 | 4 +-- .../Invoke-ZertoFailoverRollback.Tests.ps1 | 10 +++---- Tests/Public/Invoke-ZertoForceSync.Tests.ps1 | 10 +++---- Tests/Public/Invoke-ZertoMove.Tests.ps1 | 4 +-- Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 | 4 +-- .../Public/Invoke-ZertoMoveRollback.Tests.ps1 | 10 +++---- .../Public/Invoke-ZertoRestRequest.Tests.ps1 | 4 +-- Tests/Public/New-ZertoPairingToken.Tests.ps1 | 4 +-- Tests/Public/New-ZertoVpg.Tests.ps1 | 4 +-- .../New-ZertoVpgSettingsIdentifier.Tests.ps1 | 4 +-- Tests/Public/Remove-ZertoPeerSite.Tests.ps1 | 4 +-- Tests/Public/Remove-ZertoVpg.Tests.ps1 | 4 +-- ...emove-ZertoVpgSettingsIdentifier.Tests.ps1 | 4 +-- Tests/Public/Resume-ZertoVpg.Tests.ps1 | 4 +-- Tests/Public/Save-ZertoVpgSetting.Tests.ps1 | 4 +-- Tests/Public/Set-ZertoAlert.Tests.ps1 | 4 +-- Tests/Public/Set-ZertoLicense.Tests.ps1 | 4 +-- .../Public/Set-ZertoUserCredential.Tests.ps1 | 4 +-- Tests/Public/Start-ZertoCloneVpg.Tests.ps1 | 4 +-- .../Public/Start-ZertoFailoverTest.Tests.ps1 | 4 +-- Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 | 4 +-- Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 | 4 +-- Tests/Public/Suspend-ZertoVpg.Tests.ps1 | 4 +-- Tests/Public/Uninstall-ZertoVra.Tests.ps1 | 4 +-- Tests/ZertoApiWrapper.Tests.ps1 | 22 ++++++++-------- 107 files changed, 273 insertions(+), 273 deletions(-) diff --git a/Tests/Private/Get-Map.Tests.ps1 b/Tests/Private/Get-Map.Tests.ps1 index 8aeca06..040afda 100644 --- a/Tests/Private/Get-Map.Tests.ps1 +++ b/Tests/Private/Get-Map.Tests.ps1 @@ -1,45 +1,45 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { InModuleScope -ModuleName ZertoApiWrapper { Context "$global:function::Parameter Unit Tests" { - it "have a mandatory parameter for the Input Object" { + It "have a mandatory parameter for the Input Object" { Get-Command $global:function | Should -HaveParameter InputObject -Mandatory -Type PSCustomObject } - it "Input Object should not accecpt a Null or Empty value" { + It "Input Object should not accecpt a Null or Empty value" { $myObj = [PSCustomObject]@{ } { Get-Map -InputObject $myObj -Key "Key" -Value "Value" } | Should Throw { Get-Map -InputObject $null -Key "Key" -Value "Value" } | Should Throw { Get-Map -InputObject "" -Key "Key" -Value "Value" } | Should Throw } - it "have a mandatory string parameter for the Map Key" { + It "have a mandatory string parameter for the Map Key" { Get-Command $global:function | Should -HaveParameter Key -Mandatory -Type String } - it "The Map variable should not accecpt a Null or Empty value" { + It "The Map variable should not accecpt a Null or Empty value" { $myObj = [PSCustomObject]@{one = 1; two = 2 } { Get-Map -InputObject $myObj -Key "" -Value "Value" } | Should Throw { Get-Map -InputObject $null -Key $null -Value "Value" } | Should Throw { Get-Map -InputObject $myObj -Key 1 -Value "Value" } | Should Throw } - it "The Value variable should not accecpt a Null or Empty value" { + It "The Value variable should not accecpt a Null or Empty value" { $myObj = [PSCustomObject]@{one = 1; two = 2 } { Get-Map -InputObject $myObj -Key "Key" -Value "" } | Should Throw { Get-Map -InputObject $myObj -Key "Key" -Value $null } | Should Throw { Get-Map -InputObject $myObj -Key "Key" -Value 1 } | Should Throw } - it "have a mandatory string parameter for the Map Value" { + It "have a mandatory string parameter for the Map Value" { Get-Command $global:function | Should -HaveParameter Value -Mandatory -Type String } - it "should have an Output type of Hashtable" { + It "should have an Output type of Hashtable" { (Get-Command $global:function).OutputType.Name | Should -Match "Hashtable" } } @@ -49,15 +49,15 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeEach { $MyMap = Get-Map -InputObject $MyObj -Key "vmIdentifier" -Value "vmName" } - it "Returned object should be a hashtable" { + It "Returned object should be a hashtable" { $myMap | Should -BeOfType Hashtable } - it "should return a hashtable with 3 entries" { - $myMap.count | should -Be 3 + It "should return a hashtable with 3 entries" { + $myMap.count | Should -Be 3 } - it "should be properly mapped" { + It "should be properly mapped" { $myMap["vmid.12"] | Should -Be "ExchangeMailbox" $myMap["vmid.13"] | Should -Be "ExchangeApplication" $myMap["vmid.14"] | Should -Be "ExchangeWeb" diff --git a/Tests/Private/Get-ZertoApiFilter.Tests.ps1 b/Tests/Private/Get-ZertoApiFilter.Tests.ps1 index a42e57e..ce0fbfb 100644 --- a/Tests/Private/Get-ZertoApiFilter.Tests.ps1 +++ b/Tests/Private/Get-ZertoApiFilter.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -16,7 +16,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { { Get-ZertoApiFilter -filtertable $null } | Should Throw } - it "should have an Output type of String" { + It "should have an Output type of String" { (Get-Command $global:function).OutputType.Name | Should -Match "String" } } @@ -47,19 +47,19 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } } - it "converts bool to text" { - Get-ZertoApiFilter -filtertable $singleBoolItemTest | should -Be "?BoolItem=True" + It "converts bool to text" { + Get-ZertoApiFilter -filtertable $singleBoolItemTest | Should -Be "?BoolItem=True" } - it "one item test" { - Get-ZertoApiFilter -filtertable $oneItemTest | should -Be "?OneItem=Test" + It "one item test" { + Get-ZertoApiFilter -filtertable $oneItemTest | Should -Be "?OneItem=Test" } - it "should ignore CommonParameters" { - Get-ZertoApiFilter -filtertable $commonParamTest | should -Be "?OneItem=Test" + It "should ignore CommonParameters" { + Get-ZertoApiFilter -filtertable $commonParamTest | Should -Be "?OneItem=Test" } - it "should process a filter table with more than one item" { + It "should process a filter table with more than one item" { $returnString = Get-ZertoApiFilter -filtertable $twoItemTest $returnString | Should -match "^\?" $returnString | Should -match "&" diff --git a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 index 3bbe71b..60a9fd3 100644 --- a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { diff --git a/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 b/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 index 7ae3eea..4fbb862 100644 --- a/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { diff --git a/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 index 2c335b6..d91ed80 100644 --- a/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 +++ b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { diff --git a/Tests/Public/Connect-ZertoServer.Tests.ps1 b/Tests/Public/Connect-ZertoServer.Tests.ps1 index b43ca28..da0ab18 100644 --- a/Tests/Public/Connect-ZertoServer.Tests.ps1 +++ b/Tests/Public/Connect-ZertoServer.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { diff --git a/Tests/Public/Copy-ZertoVpg.Tests.ps1 b/Tests/Public/Copy-ZertoVpg.Tests.ps1 index 4bb19e4..6f0c629 100644 --- a/Tests/Public/Copy-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Copy-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { diff --git a/Tests/Public/Disconnect-ZertoServer.Tests.ps1 b/Tests/Public/Disconnect-ZertoServer.Tests.ps1 index 873fab2..51e5f2c 100644 --- a/Tests/Public/Disconnect-ZertoServer.Tests.ps1 +++ b/Tests/Public/Disconnect-ZertoServer.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Edit-ZertoVra.Tests.ps1 b/Tests/Public/Edit-ZertoVra.Tests.ps1 index 9c872fc..3767301 100644 --- a/Tests/Public/Edit-ZertoVra.Tests.ps1 +++ b/Tests/Public/Edit-ZertoVra.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -28,7 +28,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { @{ParameterName = 'vraIpAddress'; Type = 'String'; Mandatory = $false } @{ParameterName = 'defaultGateway'; Type = 'String'; Mandatory = $false } @{ParameterName = 'subnetMask'; Type = 'String'; Mandatory = $false } - @{ParameterName = 'HostRootPassword'; Type = 'securestring'; Mandatory = $false} + @{ParameterName = 'HostRootPassword'; Type = 'securestring'; Mandatory = $false } ) It " parameter is of type" -TestCases $ParameterTestCases { @@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { @{ ParameterName = 'groupName' } ) - it " validates against null or empty values" -TestCases $StringTestCases { + It " validates against null or empty values" -TestCases $StringTestCases { param($ParameterName) $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 @@ -53,7 +53,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { @{ParameterName = 'subnetMask' } ) - it " validates string for a valid IP Address" -TestCases $IpAddrTestCases { + It " validates string for a valid IP Address" -TestCases $IpAddrTestCases { param($ParameterName) $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes $attrs.Where{ $_ -is [ValidateScript] }.Count | Should -Be 1 @@ -65,8 +65,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { It "Returns a task id string" { $results = Edit-ZertoVra -vraIdentifier "MyVraIdentifier" -groupName "MyGroup" - $results | should not benullorempty - $results | should -BeOfType "String" + $results | Should not benullorempty + $results | Should -BeOfType "String" $results | Should -BeExactly "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a" } @@ -82,7 +82,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Edit-ZertoVra -vraIdentifier "DhcpVraIdentifier" -groupName "MyNewGroup" | Should -BeExactly "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a" } - it "Supports 'SupportsShouldProcess'" { + It "Supports 'SupportsShouldProcess'" { Get-Command $global:function | Should -HaveParameter WhatIf Get-Command $global:function | Should -HaveParameter Confirm (Get-Command $global:function).ScriptBlock | Should -Match 'SupportsShouldProcess' diff --git a/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 b/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 index be52ffb..f7ecbb1 100644 --- a/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 +++ b/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -16,7 +16,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type } - it " has validation set" -TestCases $ParameterTestCases { + It " has validation set" -TestCases $ParameterTestCases { param($ParameterName) $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 @@ -24,7 +24,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } Context "$global:function::Function Unit Tests" { - + } } diff --git a/Tests/Public/Export-ZertoVpg.Tests.ps1 b/Tests/Public/Export-ZertoVpg.Tests.ps1 index e733e93..957092a 100644 --- a/Tests/Public/Export-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Export-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -199,11 +199,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $outputPath = "TestDrive:" - it "Output path should exist" { + It "Output path should exist" { $outputPath | Should -Exist } - it "Exported JSON file should exist after function called" { + It "Exported JSON file should exist after function called" { $vpgName = "HRIS" Export-ZertoVpg -outputPath $outputPath -vpgName $vpgName $outputFile = "{0}\{1}.json" -f $outputPath, $vpgName @@ -211,11 +211,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $outputFile | Should -Not -BeNullOrEmpty } - it "Only one file should be present in the TestDrive" { + It "Only one file should be present in the TestDrive" { (Get-ChildItem $outputPath).Count | Should -BeExactly 1 } - it "Should be valid JSON" { + It "Should be valid JSON" { $vpgName = "HRIS" Export-ZertoVpg -outputPath $outputPath -vpgName $vpgName $outputFile = "{0}\{1}.json" -f $outputPath, $vpgName diff --git a/Tests/Public/Get-ZAAlert.Tests.ps1 b/Tests/Public/Get-ZAAlert.Tests.ps1 index 474bf6f..1a4cd6d 100644 --- a/Tests/Public/Get-ZAAlert.Tests.ps1 +++ b/Tests/Public/Get-ZAAlert.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZADatastore.Tests.ps1 b/Tests/Public/Get-ZADatastore.Tests.ps1 index c1e5653..8cc0132 100644 --- a/Tests/Public/Get-ZADatastore.Tests.ps1 +++ b/Tests/Public/Get-ZADatastore.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAEvent.Tests.ps1 b/Tests/Public/Get-ZAEvent.Tests.ps1 index 3766d44..61bcfd8 100644 --- a/Tests/Public/Get-ZAEvent.Tests.ps1 +++ b/Tests/Public/Get-ZAEvent.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 index 1032f8f..4ab1f59 100644 --- a/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 index ada02a1..4ab0358 100644 --- a/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalBreach.Tests.ps1 b/Tests/Public/Get-ZAJournalBreach.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZAJournalBreach.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalBreach.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 b/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 index a5f82d1..b91ec04 100644 --- a/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 index a5f82d1..b91ec04 100644 --- a/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 index a5f82d1..b91ec04 100644 --- a/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 index a5f82d1..b91ec04 100644 --- a/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 index a5f82d1..b91ec04 100644 --- a/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 b/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 b/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalSummary.Tests.ps1 b/Tests/Public/Get-ZAJournalSummary.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZAJournalSummary.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSummary.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZALicense.Tests.ps1 b/Tests/Public/Get-ZALicense.Tests.ps1 index c7e8462..e3e16ee 100644 --- a/Tests/Public/Get-ZALicense.Tests.ps1 +++ b/Tests/Public/Get-ZALicense.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 11 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 11 + It "$global:function should have exactly 11 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 11 } } diff --git a/Tests/Public/Get-ZAMonitoring.Tests.ps1 b/Tests/Public/Get-ZAMonitoring.Tests.ps1 index 69c36ca..1ced87b 100644 --- a/Tests/Public/Get-ZAMonitoring.Tests.ps1 +++ b/Tests/Public/Get-ZAMonitoring.Tests.ps1 @@ -1,15 +1,15 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 12 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 12 + It "$global:function should have exactly 12 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 12 } - it "$global:function has a non-mandatory string parameter for the zOrgIdentifier" { + It "$global:function has a non-mandatory string parameter for the zOrgIdentifier" { Get-Command $global:function | Should -HaveParameter zOrgIdentifier -Type String Get-Command $global:function | Should -HaveParameter zOrgIdentifier -not -Mandatory } diff --git a/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 index 1a3b5cc..be1237c 100644 --- a/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 index 1a3b5cc..be1237c 100644 --- a/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 index 2c7833c..0d7b26a 100644 --- a/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 index 2c7833c..0d7b26a 100644 --- a/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 index ada02a1..4ab0358 100644 --- a/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 index ada02a1..4ab0358 100644 --- a/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 index f1ad9c2..e2ece1b 100644 --- a/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 index f1ad9c2..e2ece1b 100644 --- a/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 index 376f710..f6b7536 100644 --- a/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 index be0afa1..357d797 100644 --- a/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAPlannerSite.Tests.ps1 b/Tests/Public/Get-ZAPlannerSite.Tests.ps1 index f15ee7b..0697f3d 100644 --- a/Tests/Public/Get-ZAPlannerSite.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 index 376f710..f6b7536 100644 --- a/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 index 97173fa..6f43e52 100644 --- a/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 index c7302d5..9940422 100644 --- a/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAProtectedVm.Tests.ps1 b/Tests/Public/Get-ZAProtectedVm.Tests.ps1 index 89e1e5d..cb28168 100644 --- a/Tests/Public/Get-ZAProtectedVm.Tests.ps1 +++ b/Tests/Public/Get-ZAProtectedVm.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAProtectedVmReport.Tests.ps1 b/Tests/Public/Get-ZAProtectedVmReport.Tests.ps1 index 95ad321..40af444 100644 --- a/Tests/Public/Get-ZAProtectedVmReport.Tests.ps1 +++ b/Tests/Public/Get-ZAProtectedVmReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 b/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 index 7cb989f..5ba5c2d 100644 --- a/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 +++ b/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZARPOAverage.Tests.ps1 b/Tests/Public/Get-ZARPOAverage.Tests.ps1 index aa6d9e7..eb3a548 100644 --- a/Tests/Public/Get-ZARPOAverage.Tests.ps1 +++ b/Tests/Public/Get-ZARPOAverage.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZARPOBreach.Tests.ps1 b/Tests/Public/Get-ZARPOBreach.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZARPOBreach.Tests.ps1 +++ b/Tests/Public/Get-ZARPOBreach.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZARPOStat.Tests.ps1 b/Tests/Public/Get-ZARPOStat.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZARPOStat.Tests.ps1 +++ b/Tests/Public/Get-ZARPOStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 b/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 +++ b/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZARPOSummary.Tests.ps1 b/Tests/Public/Get-ZARPOSummary.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZARPOSummary.Tests.ps1 +++ b/Tests/Public/Get-ZARPOSummary.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZASite.Tests.ps1 b/Tests/Public/Get-ZASite.Tests.ps1 index e9c710c..6ce1ca9 100644 --- a/Tests/Public/Get-ZASite.Tests.ps1 +++ b/Tests/Public/Get-ZASite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZASitePair.Tests.ps1 b/Tests/Public/Get-ZASitePair.Tests.ps1 index 7cb989f..5ba5c2d 100644 --- a/Tests/Public/Get-ZASitePair.Tests.ps1 +++ b/Tests/Public/Get-ZASitePair.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZASiteTopology.Tests.ps1 b/Tests/Public/Get-ZASiteTopology.Tests.ps1 index f97e366..ebe6cb0 100644 --- a/Tests/Public/Get-ZASiteTopology.Tests.ps1 +++ b/Tests/Public/Get-ZASiteTopology.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZATask.Tests.ps1 b/Tests/Public/Get-ZATask.Tests.ps1 index c8ceb12..2a38bde 100644 --- a/Tests/Public/Get-ZATask.Tests.ps1 +++ b/Tests/Public/Get-ZATask.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAVolume.Tests.ps1 b/Tests/Public/Get-ZAVolume.Tests.ps1 index 6d1a5a0..7042d03 100644 --- a/Tests/Public/Get-ZAVolume.Tests.ps1 +++ b/Tests/Public/Get-ZAVolume.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAVpg.Tests.ps1 b/Tests/Public/Get-ZAVpg.Tests.ps1 index 3b9bd52..90f9b3f 100644 --- a/Tests/Public/Get-ZAVpg.Tests.ps1 +++ b/Tests/Public/Get-ZAVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAzOrg.Tests.ps1 b/Tests/Public/Get-ZAzOrg.Tests.ps1 index 8ac00f2..e3e16ee 100644 --- a/Tests/Public/Get-ZAzOrg.Tests.ps1 +++ b/Tests/Public/Get-ZAzOrg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoAlert.Tests.ps1 b/Tests/Public/Get-ZertoAlert.Tests.ps1 index 8f3c29b..9944cda 100644 --- a/Tests/Public/Get-ZertoAlert.Tests.ps1 +++ b/Tests/Public/Get-ZertoAlert.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoDatastore.Tests.ps1 b/Tests/Public/Get-ZertoDatastore.Tests.ps1 index 49d9e80..a250084 100644 --- a/Tests/Public/Get-ZertoDatastore.Tests.ps1 +++ b/Tests/Public/Get-ZertoDatastore.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoEvent.Tests.ps1 b/Tests/Public/Get-ZertoEvent.Tests.ps1 index 4149371..5a418e8 100644 --- a/Tests/Public/Get-ZertoEvent.Tests.ps1 +++ b/Tests/Public/Get-ZertoEvent.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoLicense.Tests.ps1 b/Tests/Public/Get-ZertoLicense.Tests.ps1 index 8ac00f2..e3e16ee 100644 --- a/Tests/Public/Get-ZertoLicense.Tests.ps1 +++ b/Tests/Public/Get-ZertoLicense.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoLocalSite.Tests.ps1 b/Tests/Public/Get-ZertoLocalSite.Tests.ps1 index fe3af42..b82e8a6 100644 --- a/Tests/Public/Get-ZertoLocalSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoLocalSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoPeerSite.Tests.ps1 b/Tests/Public/Get-ZertoPeerSite.Tests.ps1 index 9456bd7..16ab624 100644 --- a/Tests/Public/Get-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoPeerSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoProtectedVm.Tests.ps1 b/Tests/Public/Get-ZertoProtectedVm.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoProtectedVm.Tests.ps1 +++ b/Tests/Public/Get-ZertoProtectedVm.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoRecoveryReport.Tests.ps1 b/Tests/Public/Get-ZertoRecoveryReport.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoRecoveryReport.Tests.ps1 +++ b/Tests/Public/Get-ZertoRecoveryReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoResourcesReport.Tests.ps1 b/Tests/Public/Get-ZertoResourcesReport.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoResourcesReport.Tests.ps1 +++ b/Tests/Public/Get-ZertoResourcesReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoServiceProfile.Tests.ps1 b/Tests/Public/Get-ZertoServiceProfile.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoServiceProfile.Tests.ps1 +++ b/Tests/Public/Get-ZertoServiceProfile.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoTask.Tests.ps1 b/Tests/Public/Get-ZertoTask.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoTask.Tests.ps1 +++ b/Tests/Public/Get-ZertoTask.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 b/Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 +++ b/Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 b/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 index b5f0f7e..100a482 100644 --- a/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { @@ -59,7 +59,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } Context "$global:function::Parameter Functional Tests" { - Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { $uri -eq 'virtualizationsites' } { return (Get-Content "$global:here\Mocks\VirtualSite-NoParams.json" -Raw) | ConvertFrom-Json diff --git a/Tests/Public/Get-ZertoVolume.Tests.ps1 b/Tests/Public/Get-ZertoVolume.Tests.ps1 index 4b86f54..a46cda1 100644 --- a/Tests/Public/Get-ZertoVolume.Tests.ps1 +++ b/Tests/Public/Get-ZertoVolume.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoVpg.Tests.ps1 b/Tests/Public/Get-ZertoVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Get-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoVpgSetting.Tests.ps1 b/Tests/Public/Get-ZertoVpgSetting.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoVpgSetting.Tests.ps1 +++ b/Tests/Public/Get-ZertoVpgSetting.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoVra.Tests.ps1 b/Tests/Public/Get-ZertoVra.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoVra.Tests.ps1 +++ b/Tests/Public/Get-ZertoVra.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoZorg.Tests.ps1 b/Tests/Public/Get-ZertoZorg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoZorg.Tests.ps1 +++ b/Tests/Public/Get-ZertoZorg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoZsspSession.Tests.ps1 b/Tests/Public/Get-ZertoZsspSession.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoZsspSession.Tests.ps1 +++ b/Tests/Public/Get-ZertoZsspSession.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 b/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 index ce84a86..20db68c 100644 --- a/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 +++ b/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 11 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 11 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } It "Has a mandatory string array parameter for the settings file to import" { diff --git a/Tests/Public/Import-ZertoVpg.Tests.ps1 b/Tests/Public/Import-ZertoVpg.Tests.ps1 index f0f8969..6b48c30 100644 --- a/Tests/Public/Import-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Import-ZertoVpg.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 12 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 12 + It "$global:function should have exactly 12 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 12 } It "Has a mandatory string array parameter for the settings file to import" { diff --git a/Tests/Public/Install-ZertoVra.Tests.ps1 b/Tests/Public/Install-ZertoVra.Tests.ps1 index 7105db6..a5005d3 100644 --- a/Tests/Public/Install-ZertoVra.Tests.ps1 +++ b/Tests/Public/Install-ZertoVra.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Invoke-ZARestRequest.Tests.ps1 b/Tests/Public/Invoke-ZARestRequest.Tests.ps1 index 7a6eade..983c373 100644 --- a/Tests/Public/Invoke-ZARestRequest.Tests.ps1 +++ b/Tests/Public/Invoke-ZARestRequest.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 b/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 index 47629c7..cfd3c2e 100644 --- a/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Invoke-ZertoFailover.Tests.ps1 b/Tests/Public/Invoke-ZertoFailover.Tests.ps1 index efe2cc7..88e38bd 100644 --- a/Tests/Public/Invoke-ZertoFailover.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailover.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 b/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 index b5d1cd6..5c59b8b 100644 --- a/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 b/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 index 84109bd..248b8f1 100644 --- a/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 @@ -1,16 +1,16 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 12 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 12 + It "$global:function should have exactly 12 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 12 } - it "has a mandatory string parameter for the vpgName" { + It "has a mandatory string parameter for the vpgName" { Get-Command $global:function | Should -HaveParameter vpgName Get-Command $global:function | Should -HaveParameter vpgName -Type string[] Get-Command $global:function | Should -HaveParameter vpgName -Mandatory diff --git a/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 b/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 index 159e825..e35259a 100644 --- a/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 @@ -1,16 +1,16 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 12 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 12 + It "$global:function should have exactly 12 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 12 } - it "has a mandatory string parameter for the vpgName" { + It "has a mandatory string parameter for the vpgName" { Get-Command $global:function | Should -HaveParameter vpgName Get-Command $global:function | Should -HaveParameter vpgName -Type string[] Get-Command $global:function | Should -HaveParameter vpgName -Mandatory diff --git a/Tests/Public/Invoke-ZertoMove.Tests.ps1 b/Tests/Public/Invoke-ZertoMove.Tests.ps1 index 393d66b..aaca87b 100644 --- a/Tests/Public/Invoke-ZertoMove.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMove.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 b/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 index 81f585a..06b7449 100644 --- a/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 b/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 index 53c3383..8e0b4fd 100644 --- a/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 @@ -1,16 +1,16 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } - it "has a mandatory string parameter for the vpgName" { + It "has a mandatory string parameter for the vpgName" { Get-Command $global:function | Should -HaveParameter vpgName Get-Command $global:function | Should -HaveParameter vpgName -Type string[] Get-Command $global:function | Should -HaveParameter vpgName -Mandatory diff --git a/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 b/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 index f0c7315..16ed79e 100644 --- a/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/New-ZertoPairingToken.Tests.ps1 b/Tests/Public/New-ZertoPairingToken.Tests.ps1 index 51ccce7..8d69a2c 100644 --- a/Tests/Public/New-ZertoPairingToken.Tests.ps1 +++ b/Tests/Public/New-ZertoPairingToken.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { diff --git a/Tests/Public/New-ZertoVpg.Tests.ps1 b/Tests/Public/New-ZertoVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/New-ZertoVpg.Tests.ps1 +++ b/Tests/Public/New-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/New-ZertoVpgSettingsIdentifier.Tests.ps1 b/Tests/Public/New-ZertoVpgSettingsIdentifier.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/New-ZertoVpgSettingsIdentifier.Tests.ps1 +++ b/Tests/Public/New-ZertoVpgSettingsIdentifier.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Remove-ZertoPeerSite.Tests.ps1 b/Tests/Public/Remove-ZertoPeerSite.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Remove-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Remove-ZertoPeerSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Remove-ZertoVpg.Tests.ps1 b/Tests/Public/Remove-ZertoVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Remove-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Remove-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 b/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 +++ b/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Resume-ZertoVpg.Tests.ps1 b/Tests/Public/Resume-ZertoVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Resume-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Resume-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Save-ZertoVpgSetting.Tests.ps1 b/Tests/Public/Save-ZertoVpgSetting.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Save-ZertoVpgSetting.Tests.ps1 +++ b/Tests/Public/Save-ZertoVpgSetting.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Set-ZertoAlert.Tests.ps1 b/Tests/Public/Set-ZertoAlert.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Set-ZertoAlert.Tests.ps1 +++ b/Tests/Public/Set-ZertoAlert.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Set-ZertoLicense.Tests.ps1 b/Tests/Public/Set-ZertoLicense.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Set-ZertoLicense.Tests.ps1 +++ b/Tests/Public/Set-ZertoLicense.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Set-ZertoUserCredential.Tests.ps1 b/Tests/Public/Set-ZertoUserCredential.Tests.ps1 index 4cca845..74cc8ac 100644 --- a/Tests/Public/Set-ZertoUserCredential.Tests.ps1 +++ b/Tests/Public/Set-ZertoUserCredential.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { InModuleScope -ModuleName ZertoApiWrapper { diff --git a/Tests/Public/Start-ZertoCloneVpg.Tests.ps1 b/Tests/Public/Start-ZertoCloneVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Start-ZertoCloneVpg.Tests.ps1 +++ b/Tests/Public/Start-ZertoCloneVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Start-ZertoFailoverTest.Tests.ps1 b/Tests/Public/Start-ZertoFailoverTest.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Start-ZertoFailoverTest.Tests.ps1 +++ b/Tests/Public/Start-ZertoFailoverTest.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 b/Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 +++ b/Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 b/Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 +++ b/Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Suspend-ZertoVpg.Tests.ps1 b/Tests/Public/Suspend-ZertoVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Suspend-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Suspend-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Uninstall-ZertoVra.Tests.ps1 b/Tests/Public/Uninstall-ZertoVra.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Uninstall-ZertoVra.Tests.ps1 +++ b/Tests/Public/Uninstall-ZertoVra.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/ZertoApiWrapper.Tests.ps1 b/Tests/ZertoApiWrapper.Tests.ps1 index bcbb9ca..0f398ae 100644 --- a/Tests/ZertoApiWrapper.Tests.ps1 +++ b/Tests/ZertoApiWrapper.Tests.ps1 @@ -1,5 +1,5 @@ #Requires -Modules Pester -$testPath = Split-Path -Parent $MyInvocation.MyCommand.Path +$testPath = Split-Path -Parent $PSCommandPath $docsPath = $testPath -replace 'Tests', 'docs' $modulePath = $testPath -replace 'Tests', 'ZertoApiWrapper' $module = Split-Path -Leaf $modulePath @@ -9,7 +9,7 @@ Describe "Module: $module" -Tags 'Unit' { Context "Module Configuration" { It "Has a root module file ($module.psm1)" { - "$modulePath\$module.psm1" | should -Exist + "$modulePath\$module.psm1" | Should -Exist } It "Is valid Powershell (Has no script errors)" { @@ -75,20 +75,20 @@ Describe "Module: $module" -Tags 'Unit' { $externalHelpFile | Should -Exist } - it "External Help file does not contain place holder values" { - $stubExist = Get-Content -Path $externalHelpFile | Where-Object {$_.Trim() -like '*{{*}}*'} + It "External Help file does not contain place holder values" { + $stubExist = Get-Content -Path $externalHelpFile | Where-Object { $_.Trim() -like '*{{*}}*' } if ($stubExist) { Write-Warning "Found a stub in the Markdown File $externalHelpFile" Write-Warning "$stubExist" } - $stubExist | should benullorempty + $stubExist | Should benullorempty } } It "Is an advanced function" { - $Function.FullName | should -FileContentMatch 'function' - $Function.FullName | should -FileContentMatch 'cmdletbinding' - $Function.FullName | should -FileContentMatch 'param' + $Function.FullName | Should -FileContentMatch 'function' + $Function.FullName | Should -FileContentMatch 'cmdletbinding' + $Function.FullName | Should -FileContentMatch 'param' } It "Is valid Powershell (Has no script errors)" { @@ -97,15 +97,15 @@ Describe "Module: $module" -Tags 'Unit' { $errors | Should -HaveCount 0 } - it "Has openbraces on the same line as the statement" { - $openingBracesExist = $contents | Where-Object {$_.Trim() -eq '{'} + It "Has openbraces on the same line as the statement" { + $openingBracesExist = $contents | Where-Object { $_.Trim() -eq '{' } if ($openingBracesExist) { Write-Warning "Found the following opening brances on their own line:" foreach ($openingBrace in $openingBracesExist) { Write-Warning "Opening Brace on it's own line - $openingBrace" } } - $openingBracesExist | should -BeNullOrEmpty + $openingBracesExist | Should -BeNullOrEmpty } } } From ed6024fe63c0a18c86163dfd67e0b34baa427a5e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 14 Apr 2020 16:24:45 -0400 Subject: [PATCH 366/479] Add Tests for Password Update # Conflicts: # Tests/Public/Edit-ZertoVra.Tests.ps1 --- Tests/Public/Edit-ZertoVra.Tests.ps1 | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Tests/Public/Edit-ZertoVra.Tests.ps1 b/Tests/Public/Edit-ZertoVra.Tests.ps1 index 3767301..6e8de1e 100644 --- a/Tests/Public/Edit-ZertoVra.Tests.ps1 +++ b/Tests/Public/Edit-ZertoVra.Tests.ps1 @@ -8,7 +8,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Get-Content $global:here\Mocks\TaskId.txt } - Mock -ModuleName ZertoApiWrapper Get-ZertoVra -ParameterFilter { $vraIdentifier -eq "MyVraIdentifier" } { + Mock -ModuleName ZertoApiWrapper Get-ZertoVra -ParameterFilter { $vraIdentifier -in @("MyVraIdentifier", "PasswordVraIdentifier") } { Get-Content $global:here\Mocks\GetSingleVra.json -Raw | ConvertFrom-Json } @@ -59,6 +59,13 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $attrs.Where{ $_ -is [ValidateScript] }.Count | Should -Be 1 $attrs.Where{ $_ -is [ValidateScript] }.ScriptBlock | Should -Match '\$_ \-match \[IPAddress\]\$_' } + + It "Supports 'SupportsShouldProcess'" { + Get-Command $global:function | Should -HaveParameter WhatIf + Get-Command $global:function | Should -HaveParameter Confirm + (Get-Command $global:function).ScriptBlock | Should -Match 'SupportsShouldProcess' + (Get-Command $global:function).ScriptBlock | Should -Match '\$PSCmdlet\.ShouldProcess\(.+\)' + } } Context "$($global:function)::Function Unit Tests" { @@ -82,16 +89,14 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Edit-ZertoVra -vraIdentifier "DhcpVraIdentifier" -groupName "MyNewGroup" | Should -BeExactly "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a" } - It "Supports 'SupportsShouldProcess'" { - Get-Command $global:function | Should -HaveParameter WhatIf - Get-Command $global:function | Should -HaveParameter Confirm - (Get-Command $global:function).ScriptBlock | Should -Match 'SupportsShouldProcess' - (Get-Command $global:function).ScriptBlock | Should -Match '\$PSCmdlet\.ShouldProcess\(.+\)' + It "Runs with root password provided" { + $SecurePassword = 'NotARealPassword' | ConvertTo-SecureString -AsPlainText -Force + Edit-ZertoVra -vraIdentifier "PasswordVraIdentifier" -HostRootPassword $SecurePassword | Should -BeExactly "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a" } } - Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -Exactly 3 - Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Get-ZertoVra -Exactly 4 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -Exactly 4 + Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Get-ZertoVra -Exactly 5 } Remove-Variable -Name function -Scope Global From d38f20682497e02c8b1c8fd556fe9ed541a6c57e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 30 Apr 2020 11:11:29 -0400 Subject: [PATCH 367/479] Update ZVM Headers --- Tests/Public/Connect-ZertoServer.Tests.ps1 | 4 ++-- ZertoApiWrapper/Public/Connect-ZertoServer.ps1 | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Tests/Public/Connect-ZertoServer.Tests.ps1 b/Tests/Public/Connect-ZertoServer.Tests.ps1 index da0ab18..6d6e185 100644 --- a/Tests/Public/Connect-ZertoServer.Tests.ps1 +++ b/Tests/Public/Connect-ZertoServer.Tests.ps1 @@ -89,7 +89,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { It "Module Scope zvmHeaders variable tests" { $script:zvmHeaders | Should -Not -BeNullOrEmpty $script:zvmHeaders | Should -BeOfType PSCustomObject - $script:zvmHeaders.keys.count | Should -BeExactly 2 + $script:zvmHeaders.keys.count | Should -BeExactly 3 $script:zvmHeaders.ContainsKey('x-zerto-session') | Should -BeTrue $script:zvmHeaders.ContainsKey('Accept') | Should -BeTrue $script:zvmHeaders['x-zerto-session'] | Should -BeOfType String @@ -105,7 +105,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $headers = Connect-ZertoServer -zertoServer $Server -credential $credential -returnHeaders It "returns a Hashtable with 2 keys" { $headers | Should -BeOfType Hashtable - $headers.keys.count | Should -Be 2 + $headers.keys.count | Should -Be 3 } It "return value has a key called 'x-zerto-session'" { diff --git a/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 b/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 index 5c7b3b0..177374c 100644 --- a/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 +++ b/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 @@ -32,9 +32,12 @@ function Connect-ZertoServer { Set-Variable -Name zvmServer -Scope Script -Value $zertoServer Set-Variable -Name zvmPort -Scope Script -Value $zertoPort # Set zvmLastAction Variable to keep track when the API token expires - Set-Variable -Name zvmLastAction -Scope Script -Value $(get-date).Ticks + Set-Variable -Name zvmLastAction -Scope Script -Value $(Get-Date).Ticks # Set / Clear the zvmHeaders to clear any existing token - Set-Variable -Name zvmHeaders -Scope Script -Value $null + Set-Variable -Name zvmHeaders -Scope Script -Value @{ + "Accept" = "application/json" + "zerto-triggered-by" = "PowershellWes" + } } process { @@ -44,14 +47,14 @@ function Connect-ZertoServer { end { # Build Headers Hashtable with Authorization Token - $zertoAuthorizationHeaders = @{"x-zerto-session" = $results.Headers['x-zerto-session'][0].ToString(); "Accept" = "application/json"} + $Script:zvmHeaders['x-zerto-session'] = $results.Headers['x-zerto-session'][0].ToString() # Set common Script Scope Variables to be used other functions (Headers and Local Site Info) - Set-Variable -Name zvmHeaders -Scope Script -Value $zertoAuthorizationHeaders + # Set-Variable -Name zvmHeaders -Scope Script -Value $zertoAuthorizationHeaders Set-Variable -Name zvmLocalInfo -Scope Script -Value (Get-ZertoLocalSite) # Have the option to return the headers to a variable if ($returnHeaders) { - return $zertoAuthorizationHeaders + return $Script:zvmHeaders } } } From e47458b2df402114f610b1a01ae966e25cd57aa4 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 30 Apr 2020 11:53:55 -0400 Subject: [PATCH 368/479] Update ReleaseNotes to maintain history --- RELEASENOTES.md | 70 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index a0d9dc1..df00d80 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -3,3 +3,73 @@ ### Zerto Virtual Manager * Refactored `Copy-ZertoVpg` functionality to leverage identifier and name maps and eliminate `where-object` searches. + +## 1.4.0.20200410 + +### Zerto Virtual Manager + +* Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/60) in the `Get-ZertoRecoveryReport` function where the `-VpgIdentifier` parameter was not working. This parameter is not accepted by the API as a valid filter and is ignored. This parameter has been removed from the function. +* Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/61) where the `Export-ZertoVpgNicSetting` function would not properly execute when run against a VM with no NICs attached. +* In reviewing the `Export-ZertoVpgNicSetting`, a review of the `Import-ZertoVpgNicSetting` was completed and it was determined to update the import logic based on various test cases. Along with this, it is now possible to reset the NIC settings to the default state with the `Import-ZertoVpgNicSetting` command. Please review the [Import-ZertoVpgNicSetting help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVmNicSetting.md) to review the updated options and import logic. +* Refactored the `Checkpoint-ZertoVpg` command to allow pipeline input (ByValue and ByProperty) for the VpgName parameter. +* Corrected a parameter typo in the `Get-ZertoVpgSetting` function. The misspelt parameter was added as an alias to ensure any existing scripts using the parameter continue to function. +* Refactored the `Get-ZertoVpg` command to remove repetitive commands and variables that are no longer required. +* Moved `Invoke-ZertoRestRequest` and `Invoke-ZARestRequest` to be public functions. As there become more and more scenarios where there are not prebuilt functions to accomplish complex specialized tasks, it became apparent that these functions could be leveraged to make the experience and workflow easier. +* Updated the `Install-ZertoVra` logic to ensure that the target datastore is available on the target host. There isn't currently any method to validate the target network, but if that becomes available in a later version of the API, the function will be updated. +* Updated the `Install-ZertoVra` function to allow for installation of the VRA using the host password method. Please review the [Install-ZertoVra](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Install-ZertoVra.md) documentation for syntax and examples. +* Updated the `Edit-ZertoVra` function to allow for modification of the associated ESX host password if the need arises. Please review the [Edit-ZertoVra](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Edit-ZertoVra.md) documentation for syntax and examples. +* Added a new function, `Set-ZertoUserCredential`, to allow the updating of the username and password used to connect the Zerto Virtual Manager to the paired hypervisor. Please see the [Set-ZertoUserCredential](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Set-ZertoUserCredential.md) help for additional information. +* With the release of [Zerto 8.0](https://www.zerto.com/zerto-8-0-general-availability/) some additional API endpoints have become available. + * Updated `Get-ZertoVirtualizationSite` to add the `-repository` parameter to enable returning information for LTR repositories. + * Updated `Get-ZertoVpgSetting` to add the `-ltr` parameter to enable returning information for current LTR settings for the selected VPG. + +### Zerto Analytics + +* Added several functions for the newly added [Zerto Analytics](https://analytics.zerto.com) Planner. + * `Get-ZAPlannerSite` Help can be found here: [Get-ZAPlannerSite](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerSite.md) + * `Get-ZAPlannerStatsReport` Help can be found here: [Get-ZAPlannerStatsReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerStatsReport.md) + * `Get-ZAPlannerJournalSizeReport` Help can be found here: [Get-ZAPlannerJournalSizeReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerJournalSizeReport.md) + * `Get-ZAPlannerNetworkPerformanceReport` Help can be found here: [Get-ZAPlannerNetworkPerformanceReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerNetworkPerformanceReport.md) + * `Get-ZAPlannerWanReport` Help can be found here: [Get-ZAPlannerWanReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerWanReport.md) + * `Get-ZAPlannerZcasReport` Help can be found here: [Get-ZAPlannerZcasReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerZcasReport.md) +* Created `Get-ZAProtectedVm` and `Get-ZAProtectedVmReport` functions to leverage the newly released Zerto Analytics APIs for this data. Help files can be found here: [Get-ZAProtectedVm](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVm.md) and [Get-ZAProtectedVmReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVmReport.md) + +## 1.3.0.20191201 + +### Zerto Virtual Manager + +* [Zerto version 7.5 has been released.](https://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Release%20Notes.pdf) As part of this release Zerto has added API functionality that requires the following updates. + * A token is now required to pair two sites together. The need is discussed in [Issue 46](https://github.com/ZertoPublic/ZertoApiWrapper/issues/46). To implement this change a `-token` parameter has been added to the `Add-ZertoPeerSite` function. + * A new function has been added; `New-ZertoPairingToken`. This function will allow users to generate a pairing authentication token from the target ZVM to be used in the pairing process. [Issue 47](https://github.com/ZertoPublic/ZertoApiWrapper/issues/47) covers additional details. +* A new function has been added; `Invoke-ZertoEvacuateVra`. This function will allow users to evacuate a target VRA by specifying a Host Name, VRA Name, or VRA Identifier. All VMs currently replicating to the specified location will be migrated to different targets. [Issue 51](https://github.com/ZertoPublic/ZertoApiWrapper/issues/51) +* A function has been added; `Copy-ZertoVpg`. This function will allow users to copy the settings of a single VPG and add new VMs to it. There is currently no customization beyond specifying the VMs to be placed in the newly created VPG. Should additional edits \ updates be required, they should be done post creation. [Issue 54](https://github.com/ZertoPublic/ZertoApiWrapper/issues/54) +* Fixed [issue 57](https://github.com/ZertoPublic/ZertoApiWrapper/issues/57) where a `Start-ZertoFailoverTest` would throw an error complaining about validating the body parameter. This has been fixed and tested against Zerto Virtual Manager 7.5 Update 1 with Windows PowerShell 5.1 and PowerShell Core 6.2. + +## 1.2.0.20190801 + +### Zerto Virtual Manager + +* Added two functions to aid in bulk updating of NIC information for protected VMs. ([Issue 38](https://github.com/ZertoPublic/ZertoApiWrapper/issues/38)) + * [Export-ZertoVmNicSetting](https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Export-ZertoVmNicSettings.md) + * [Import-ZertoVmNicSetting](https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Import-ZertoVmNicSettings.md) +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/43) where a VPG being created with a single VM member would not be parsed by the API correctly using PowerShell 5.1 + +### Zerto Analytics + +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/36) where the Zerto Analytics Rest Request function was not checking for the token before attempting a connection. +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/40) where the `Get-ZAVpg` method would return a 404 error when a `-vpgIdentifier` parameter was specified. + +### General Updates + +* Updated the way that tests are invoked and parsed to ensure that both source and built module files are tested. This will ensure that what is being shipped passes all tests along with testing of the source files. +* Added additional parameter validation tests to several of the functions. On-going effort to complete stand alone unit testing of each function. + +## Initial Release - 1.1.0.34 + +### Zerto Virtual Manager + +* Updated `Invoke-ZertoRestRequest` to work in Powershell 5.1 as well as Powershell core + +### Zerto Analytics + +* Implemented Zerto Analytics Functionality. Please see From 6c2b029014de54b9baa6cfadd459e10cdeb30b45 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 5 May 2020 13:47:19 -0400 Subject: [PATCH 369/479] Update Parameter Name to work with filter --- Tests/Public/Get-ZertoEvent.Tests.ps1 | 4 ++-- ZertoApiWrapper/Public/Get-ZertoEvent.ps1 | 6 +++--- docs/Get-ZertoEvent.md | 14 +++++++------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Tests/Public/Get-ZertoEvent.Tests.ps1 b/Tests/Public/Get-ZertoEvent.Tests.ps1 index 5a418e8..b35a69f 100644 --- a/Tests/Public/Get-ZertoEvent.Tests.ps1 +++ b/Tests/Public/Get-ZertoEvent.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester $global:here = (Split-Path -Parent $PSCommandPath) -$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] +$global:function = ((Split-Path -Leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -12,7 +12,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $ParameterTestCases = @( @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } - @{ParameterName = 'vpg'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'vpgName'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } @{ParameterName = 'eventType'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } @{ParameterName = 'siteName'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } diff --git a/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 b/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 index 76584f6..1dbec44 100644 --- a/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 @@ -19,8 +19,8 @@ function Get-ZertoEvent { HelpMessage = "The name of the VPG for which you want to return events." )] [ValidateNotNullOrEmpty()] - [Alias("vpgName")] - [string]$vpg, + [Alias("vpg")] + [string]$vpgName, [Parameter( ParameterSetName = "filter", HelpMessage = "The identifier of the VPG for which you want to return events." @@ -69,7 +69,7 @@ function Get-ZertoEvent { ParameterSetName = "filter", HelpMessage = "The type of event to return. This filter behaves in the same way as the eventCategory filter. Possible Values are: Possible Values are: 'All', 'Events', 'Alerts'" )] - [ValidateSet('All','Events','Alerts')] + [ValidateSet('All', 'Events', 'Alerts')] [string]$category, [Parameter( ParameterSetName = "filter", diff --git a/docs/Get-ZertoEvent.md b/docs/Get-ZertoEvent.md index 79b37d7..53d4589 100644 --- a/docs/Get-ZertoEvent.md +++ b/docs/Get-ZertoEvent.md @@ -19,7 +19,7 @@ Get-ZertoEvent [] ### filter ``` -Get-ZertoEvent [-startDate ] [-endDate ] [-vpg ] [-vpgIdentifier ] +Get-ZertoEvent [-startDate ] [-endDate ] [-vpgName ] [-vpgIdentifier ] [-eventType ] [-siteName ] [-siteIdentifier ] [-zorgIdentifier ] [-entityType ] [-userName ] [-category ] [-eventCategory ] [-alertIdentifier ] [] @@ -292,13 +292,13 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -vpg -The name of the VPG for which you want to return events. +### -vpgIdentifier +The identifier of the VPG for which you want to return events. ```yaml Type: String Parameter Sets: filter -Aliases: vpgName +Aliases: vpgId Required: False Position: Named @@ -307,13 +307,13 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -vpgIdentifier -The identifier of the VPG for which you want to return events. +### -vpgName +The name of the VPG for which you want to return events. ```yaml Type: String Parameter Sets: filter -Aliases: vpgId +Aliases: vpg Required: False Position: Named From 4271afd5b4f55f1854d95c6c6fb41ca7c644e489 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 5 May 2020 14:11:49 -0400 Subject: [PATCH 370/479] Move historical Release Notes to ChangeLog --- CHANGELOG.md | 69 +++++++++++++++++++++++++++++++++++++++++++++++ RELEASENOTES.md | 71 +------------------------------------------------ 2 files changed, 70 insertions(+), 70 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..d84f890 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,69 @@ +## 1.4.0.20200410 + +### Zerto Virtual Manager + +* Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/60) in the `Get-ZertoRecoveryReport` function where the `-VpgIdentifier` parameter was not working. This parameter is not accepted by the API as a valid filter and is ignored. This parameter has been removed from the function. +* Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/61) where the `Export-ZertoVpgNicSetting` function would not properly execute when run against a VM with no NICs attached. +* In reviewing the `Export-ZertoVpgNicSetting`, a review of the `Import-ZertoVpgNicSetting` was completed and it was determined to update the import logic based on various test cases. Along with this, it is now possible to reset the NIC settings to the default state with the `Import-ZertoVpgNicSetting` command. Please review the [Import-ZertoVpgNicSetting help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVmNicSetting.md) to review the updated options and import logic. +* Refactored the `Checkpoint-ZertoVpg` command to allow pipeline input (ByValue and ByProperty) for the VpgName parameter. +* Corrected a parameter typo in the `Get-ZertoVpgSetting` function. The misspelt parameter was added as an alias to ensure any existing scripts using the parameter continue to function. +* Refactored the `Get-ZertoVpg` command to remove repetitive commands and variables that are no longer required. +* Moved `Invoke-ZertoRestRequest` and `Invoke-ZARestRequest` to be public functions. As there become more and more scenarios where there are not prebuilt functions to accomplish complex specialized tasks, it became apparent that these functions could be leveraged to make the experience and workflow easier. +* Updated the `Install-ZertoVra` logic to ensure that the target datastore is available on the target host. There isn't currently any method to validate the target network, but if that becomes available in a later version of the API, the function will be updated. +* Updated the `Install-ZertoVra` function to allow for installation of the VRA using the host password method. Please review the [Install-ZertoVra](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Install-ZertoVra.md) documentation for syntax and examples. +* Updated the `Edit-ZertoVra` function to allow for modification of the associated ESX host password if the need arises. Please review the [Edit-ZertoVra](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Edit-ZertoVra.md) documentation for syntax and examples. +* Added a new function, `Set-ZertoUserCredential`, to allow the updating of the username and password used to connect the Zerto Virtual Manager to the paired hypervisor. Please see the [Set-ZertoUserCredential](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Set-ZertoUserCredential.md) help for additional information. +* With the release of [Zerto 8.0](https://www.zerto.com/zerto-8-0-general-availability/) some additional API endpoints have become available. + * Updated `Get-ZertoVirtualizationSite` to add the `-repository` parameter to enable returning information for LTR repositories. + * Updated `Get-ZertoVpgSetting` to add the `-ltr` parameter to enable returning information for current LTR settings for the selected VPG. + +### Zerto Analytics + +* Added several functions for the newly added [Zerto Analytics](https://analytics.zerto.com) Planner. + * `Get-ZAPlannerSite` Help can be found here: [Get-ZAPlannerSite](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerSite.md) + * `Get-ZAPlannerStatsReport` Help can be found here: [Get-ZAPlannerStatsReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerStatsReport.md) + * `Get-ZAPlannerJournalSizeReport` Help can be found here: [Get-ZAPlannerJournalSizeReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerJournalSizeReport.md) + * `Get-ZAPlannerNetworkPerformanceReport` Help can be found here: [Get-ZAPlannerNetworkPerformanceReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerNetworkPerformanceReport.md) + * `Get-ZAPlannerWanReport` Help can be found here: [Get-ZAPlannerWanReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerWanReport.md) + * `Get-ZAPlannerZcasReport` Help can be found here: [Get-ZAPlannerZcasReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerZcasReport.md) +* Created `Get-ZAProtectedVm` and `Get-ZAProtectedVmReport` functions to leverage the newly released Zerto Analytics APIs for this data. Help files can be found here: [Get-ZAProtectedVm](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVm.md) and [Get-ZAProtectedVmReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVmReport.md) + +## 1.3.0.20191201 + +### Zerto Virtual Manager + +* [Zerto version 7.5 has been released.](https://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Release%20Notes.pdf) As part of this release Zerto has added API functionality that requires the following updates. + * A token is now required to pair two sites together. The need is discussed in [Issue 46](https://github.com/ZertoPublic/ZertoApiWrapper/issues/46). To implement this change a `-token` parameter has been added to the `Add-ZertoPeerSite` function. + * A new function has been added; `New-ZertoPairingToken`. This function will allow users to generate a pairing authentication token from the target ZVM to be used in the pairing process. [Issue 47](https://github.com/ZertoPublic/ZertoApiWrapper/issues/47) covers additional details. +* A new function has been added; `Invoke-ZertoEvacuateVra`. This function will allow users to evacuate a target VRA by specifying a Host Name, VRA Name, or VRA Identifier. All VMs currently replicating to the specified location will be migrated to different targets. [Issue 51](https://github.com/ZertoPublic/ZertoApiWrapper/issues/51) +* A function has been added; `Copy-ZertoVpg`. This function will allow users to copy the settings of a single VPG and add new VMs to it. There is currently no customization beyond specifying the VMs to be placed in the newly created VPG. Should additional edits \ updates be required, they should be done post creation. [Issue 54](https://github.com/ZertoPublic/ZertoApiWrapper/issues/54) +* Fixed [issue 57](https://github.com/ZertoPublic/ZertoApiWrapper/issues/57) where a `Start-ZertoFailoverTest` would throw an error complaining about validating the body parameter. This has been fixed and tested against Zerto Virtual Manager 7.5 Update 1 with Windows PowerShell 5.1 and PowerShell Core 6.2. + +## 1.2.0.20190801 + +### Zerto Virtual Manager + +* Added two functions to aid in bulk updating of NIC information for protected VMs. ([Issue 38](https://github.com/ZertoPublic/ZertoApiWrapper/issues/38)) + * [Export-ZertoVmNicSetting](https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Export-ZertoVmNicSettings.md) + * [Import-ZertoVmNicSetting](https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Import-ZertoVmNicSettings.md) +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/43) where a VPG being created with a single VM member would not be parsed by the API correctly using PowerShell 5.1 + +### Zerto Analytics + +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/36) where the Zerto Analytics Rest Request function was not checking for the token before attempting a connection. +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/40) where the `Get-ZAVpg` method would return a 404 error when a `-vpgIdentifier` parameter was specified. + +### General Updates + +* Updated the way that tests are invoked and parsed to ensure that both source and built module files are tested. This will ensure that what is being shipped passes all tests along with testing of the source files. +* Added additional parameter validation tests to several of the functions. On-going effort to complete stand alone unit testing of each function. + +## Initial Release + +### Zerto Virtual Manager + +* Updated `Invoke-ZertoRestRequest` to work in Powershell 5.1 as well as Powershell core + +### Zerto Analytics + +* Implemented Zerto Analytics Functionality. Please see [Getting Started with Zerto Analytics](https://github.com/ZertoPublic/ZertoApiWrapper/wiki/Getting-Started-with-Zerto-Analytics) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index df00d80..3811ca3 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -3,73 +3,4 @@ ### Zerto Virtual Manager * Refactored `Copy-ZertoVpg` functionality to leverage identifier and name maps and eliminate `where-object` searches. - -## 1.4.0.20200410 - -### Zerto Virtual Manager - -* Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/60) in the `Get-ZertoRecoveryReport` function where the `-VpgIdentifier` parameter was not working. This parameter is not accepted by the API as a valid filter and is ignored. This parameter has been removed from the function. -* Addressed a reported [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/61) where the `Export-ZertoVpgNicSetting` function would not properly execute when run against a VM with no NICs attached. -* In reviewing the `Export-ZertoVpgNicSetting`, a review of the `Import-ZertoVpgNicSetting` was completed and it was determined to update the import logic based on various test cases. Along with this, it is now possible to reset the NIC settings to the default state with the `Import-ZertoVpgNicSetting` command. Please review the [Import-ZertoVpgNicSetting help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVmNicSetting.md) to review the updated options and import logic. -* Refactored the `Checkpoint-ZertoVpg` command to allow pipeline input (ByValue and ByProperty) for the VpgName parameter. -* Corrected a parameter typo in the `Get-ZertoVpgSetting` function. The misspelt parameter was added as an alias to ensure any existing scripts using the parameter continue to function. -* Refactored the `Get-ZertoVpg` command to remove repetitive commands and variables that are no longer required. -* Moved `Invoke-ZertoRestRequest` and `Invoke-ZARestRequest` to be public functions. As there become more and more scenarios where there are not prebuilt functions to accomplish complex specialized tasks, it became apparent that these functions could be leveraged to make the experience and workflow easier. -* Updated the `Install-ZertoVra` logic to ensure that the target datastore is available on the target host. There isn't currently any method to validate the target network, but if that becomes available in a later version of the API, the function will be updated. -* Updated the `Install-ZertoVra` function to allow for installation of the VRA using the host password method. Please review the [Install-ZertoVra](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Install-ZertoVra.md) documentation for syntax and examples. -* Updated the `Edit-ZertoVra` function to allow for modification of the associated ESX host password if the need arises. Please review the [Edit-ZertoVra](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Edit-ZertoVra.md) documentation for syntax and examples. -* Added a new function, `Set-ZertoUserCredential`, to allow the updating of the username and password used to connect the Zerto Virtual Manager to the paired hypervisor. Please see the [Set-ZertoUserCredential](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Set-ZertoUserCredential.md) help for additional information. -* With the release of [Zerto 8.0](https://www.zerto.com/zerto-8-0-general-availability/) some additional API endpoints have become available. - * Updated `Get-ZertoVirtualizationSite` to add the `-repository` parameter to enable returning information for LTR repositories. - * Updated `Get-ZertoVpgSetting` to add the `-ltr` parameter to enable returning information for current LTR settings for the selected VPG. - -### Zerto Analytics - -* Added several functions for the newly added [Zerto Analytics](https://analytics.zerto.com) Planner. - * `Get-ZAPlannerSite` Help can be found here: [Get-ZAPlannerSite](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerSite.md) - * `Get-ZAPlannerStatsReport` Help can be found here: [Get-ZAPlannerStatsReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerStatsReport.md) - * `Get-ZAPlannerJournalSizeReport` Help can be found here: [Get-ZAPlannerJournalSizeReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerJournalSizeReport.md) - * `Get-ZAPlannerNetworkPerformanceReport` Help can be found here: [Get-ZAPlannerNetworkPerformanceReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerNetworkPerformanceReport.md) - * `Get-ZAPlannerWanReport` Help can be found here: [Get-ZAPlannerWanReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerWanReport.md) - * `Get-ZAPlannerZcasReport` Help can be found here: [Get-ZAPlannerZcasReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerZcasReport.md) -* Created `Get-ZAProtectedVm` and `Get-ZAProtectedVmReport` functions to leverage the newly released Zerto Analytics APIs for this data. Help files can be found here: [Get-ZAProtectedVm](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVm.md) and [Get-ZAProtectedVmReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVmReport.md) - -## 1.3.0.20191201 - -### Zerto Virtual Manager - -* [Zerto version 7.5 has been released.](https://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Release%20Notes.pdf) As part of this release Zerto has added API functionality that requires the following updates. - * A token is now required to pair two sites together. The need is discussed in [Issue 46](https://github.com/ZertoPublic/ZertoApiWrapper/issues/46). To implement this change a `-token` parameter has been added to the `Add-ZertoPeerSite` function. - * A new function has been added; `New-ZertoPairingToken`. This function will allow users to generate a pairing authentication token from the target ZVM to be used in the pairing process. [Issue 47](https://github.com/ZertoPublic/ZertoApiWrapper/issues/47) covers additional details. -* A new function has been added; `Invoke-ZertoEvacuateVra`. This function will allow users to evacuate a target VRA by specifying a Host Name, VRA Name, or VRA Identifier. All VMs currently replicating to the specified location will be migrated to different targets. [Issue 51](https://github.com/ZertoPublic/ZertoApiWrapper/issues/51) -* A function has been added; `Copy-ZertoVpg`. This function will allow users to copy the settings of a single VPG and add new VMs to it. There is currently no customization beyond specifying the VMs to be placed in the newly created VPG. Should additional edits \ updates be required, they should be done post creation. [Issue 54](https://github.com/ZertoPublic/ZertoApiWrapper/issues/54) -* Fixed [issue 57](https://github.com/ZertoPublic/ZertoApiWrapper/issues/57) where a `Start-ZertoFailoverTest` would throw an error complaining about validating the body parameter. This has been fixed and tested against Zerto Virtual Manager 7.5 Update 1 with Windows PowerShell 5.1 and PowerShell Core 6.2. - -## 1.2.0.20190801 - -### Zerto Virtual Manager - -* Added two functions to aid in bulk updating of NIC information for protected VMs. ([Issue 38](https://github.com/ZertoPublic/ZertoApiWrapper/issues/38)) - * [Export-ZertoVmNicSetting](https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Export-ZertoVmNicSettings.md) - * [Import-ZertoVmNicSetting](https://github.com/ZertoPublic/ZertoApiWrapper/blob/Master/docs/Import-ZertoVmNicSettings.md) -* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/43) where a VPG being created with a single VM member would not be parsed by the API correctly using PowerShell 5.1 - -### Zerto Analytics - -* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/36) where the Zerto Analytics Rest Request function was not checking for the token before attempting a connection. -* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/40) where the `Get-ZAVpg` method would return a 404 error when a `-vpgIdentifier` parameter was specified. - -### General Updates - -* Updated the way that tests are invoked and parsed to ensure that both source and built module files are tested. This will ensure that what is being shipped passes all tests along with testing of the source files. -* Added additional parameter validation tests to several of the functions. On-going effort to complete stand alone unit testing of each function. - -## Initial Release - 1.1.0.34 - -### Zerto Virtual Manager - -* Updated `Invoke-ZertoRestRequest` to work in Powershell 5.1 as well as Powershell core - -### Zerto Analytics - -* Implemented Zerto Analytics Functionality. Please see +* Updated `Get-ZertoEvent` parameter to fall in line with the filter parameter name in the API documentation. Moved the old parameter name to an alias to ensure that existing functionality continues to work. From 781368398cd9056baebb12e5ea43d45c523e8a5c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 5 May 2020 14:26:41 -0400 Subject: [PATCH 371/479] Update release notes to point to CHANGELOG --- CHANGELOG.md | 5 +++++ ZertoApiWrapper.build.ps1 | 13 +------------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d84f890..8960b69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### Zerto Virtual Manager + +* Refactored `Copy-ZertoVpg` functionality to leverage identifier and name maps and eliminate `where-object` searches. +* Updated `Get-ZertoEvent` parameter to fall in line with the filter parameter name in the API documentation. Moved the old parameter name to an alias to ensure that existing functionality continues to work. + ## 1.4.0.20200410 ### Zerto Virtual Manager diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 1bafeee..fbf7f0e 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -135,7 +135,7 @@ task UpdateMarkdownHelp CheckPlatyPSInstalled, { #Region - Build Module Files task CreatePsd1ForRelease CleanTemp, { $functionsToExport = Get-ChildItem -Path 'ZertoApiWrapper\Public\*.ps1' | ForEach-Object { $_.BaseName } - $releaseNotes = "# {0}{1}" -f $version, $(Get-Content .\RELEASENOTES.md -Raw) + $releaseNotes = "Please review the [CHANGELOG](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/CHANGELOG.md) for the latest updates." $ManifestParams = @{ Path = "$BuildRoot\temp\ZertoApiWrapper.psd1" @@ -165,17 +165,6 @@ task CreatePsm1ForRelease CreatePsd1ForRelease, { $lines = '#------------------------------------------------------------#' $Private = @( Get-ChildItem -Path $BuildRoot\ZertoApiWrapper\Private\*.ps1 -ErrorAction Stop ) $Public = @( Get-ChildItem -Path $BuildRoot\ZertoApiWrapper\Public\*.ps1 -ErrorAction Stop ) - <# $functionCount = 0 - $exportString = "" - foreach ($file in $Public) { - if ($functionCount -eq 0) { - $functionCount++ - $exportString = "{0}" -f $file.BaseName - } else { - $functionCount++ - $exportString = "{0}, {1}" -f $exportString, $file.BaseName - } - } #> Add-Content -Path $psm1Path -Value $lines Add-Content -Path $psm1Path -Value "#---------------------Private Functions----------------------#" Add-Content -Path $psm1Path -Value $lines From 48940842925ead9b0ab7d4a05344e875a9f0b6f8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 5 May 2020 14:27:27 -0400 Subject: [PATCH 372/479] Remove RELEASENOTES for CHANGELOG --- RELEASENOTES.md | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 RELEASENOTES.md diff --git a/RELEASENOTES.md b/RELEASENOTES.md deleted file mode 100644 index 3811ca3..0000000 --- a/RELEASENOTES.md +++ /dev/null @@ -1,6 +0,0 @@ - - -### Zerto Virtual Manager - -* Refactored `Copy-ZertoVpg` functionality to leverage identifier and name maps and eliminate `where-object` searches. -* Updated `Get-ZertoEvent` parameter to fall in line with the filter parameter name in the API documentation. Moved the old parameter name to an alias to ensure that existing functionality continues to work. From fc3c08637bb002e41f6733e69e07075620397065 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 5 May 2020 14:32:13 -0400 Subject: [PATCH 373/479] Module Release Notes point to GitHub --- ZertoApiWrapper.build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index fbf7f0e..bc21e48 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -135,7 +135,7 @@ task UpdateMarkdownHelp CheckPlatyPSInstalled, { #Region - Build Module Files task CreatePsd1ForRelease CleanTemp, { $functionsToExport = Get-ChildItem -Path 'ZertoApiWrapper\Public\*.ps1' | ForEach-Object { $_.BaseName } - $releaseNotes = "Please review the [CHANGELOG](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/CHANGELOG.md) for the latest updates." + $releaseNotes = "Please review the [Release Notes](https://github.com/ZertoPublic/ZertoApiWrapper/releases/tag/{0}) on GitHub." -f $version $ManifestParams = @{ Path = "$BuildRoot\temp\ZertoApiWrapper.psd1" From 22b0da87b962cddeb85a3bcc864c5b48052a2fab Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 5 May 2020 14:35:29 -0400 Subject: [PATCH 374/479] Update to latest versions of modules --- ZertoApiWrapper.Depend.psd1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ZertoApiWrapper.Depend.psd1 b/ZertoApiWrapper.Depend.psd1 index d832d27..820e1f4 100644 --- a/ZertoApiWrapper.Depend.psd1 +++ b/ZertoApiWrapper.Depend.psd1 @@ -7,7 +7,7 @@ SkipPublisherCheck = $true } Target = 'CurrentUser' - Version = '5.5.2' + Version = '5.5.11' Tags = 'Bootstrap' } @@ -31,7 +31,7 @@ SkipPublisherCheck = $true } Target = 'CurrentUser' - Version = '1.18.1' + Version = '1.18.3' Tags = 'Bootstrap' } From b0d68ea22406982a4da9f1386eb87eddbd244aa5 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 5 May 2020 16:29:56 -0400 Subject: [PATCH 375/479] Updete to use process block for pipeline --- ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 b/ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 index 64c9127..6f06b40 100644 --- a/ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 +++ b/ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 @@ -15,8 +15,16 @@ function Save-ZertoVpgSetting { [string]$vpgSettingsIdentifier ) - $baseUri = "vpgsettings/{0}/commit" -f $vpgSettingsIdentifier - if ($PSCmdlet.ShouldProcess("Commiting VPG Settings with Settigns identifier $vpgSettingsIdentifier")) { - Invoke-ZertoRestRequest -uri $baseUri -method "POST" + Begin { + } + + Process { + $baseUri = "vpgsettings/{0}/commit" -f $vpgSettingsIdentifier + if ($PSCmdlet.ShouldProcess("Commiting VPG Settings with Settigns identifier $vpgSettingsIdentifier")) { + Invoke-ZertoRestRequest -uri $baseUri -method "POST" + } + } + + End { } } From 8dcee4068ada958754ad1fc3975870a30cfa3a3f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 5 May 2020 16:30:49 -0400 Subject: [PATCH 376/479] Update PSSA Rules for New PSSA Version --- ZertoApiWrapper.build.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index bc21e48..8e57ee9 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -1,6 +1,6 @@ #Requires -Modules 'InvokeBuild' -$version = "{0}.{1}" -f $(Get-Content .\version.txt), $(Get-Date -format 'yyyyMMdd') +$version = "{0}.{1}" -f $(Get-Content .\version.txt), $(Get-Date -Format 'yyyyMMdd') #Define the default task task . CreateArtifacts @@ -54,7 +54,7 @@ task AnalyzeSourceFiles CheckPSScriptAnalyzerInstalled, { Severity = @('Error', 'Warning') Recurse = $true Verbose = $false - ExcludeRule = @('PSUseToExportFieldsInManifest', 'PSUseBOMForUnicodeEncodedFile', 'PSUseSingularNouns') + ExcludeRule = @('PSUseToExportFieldsInManifest', 'PSUseBOMForUnicodeEncodedFile', 'PSUseSingularNouns', 'PSReviewUnusedParameter') } $saresults = Invoke-ScriptAnalyzer @scriptAnalyzerParams if ($saResults) { @@ -69,7 +69,7 @@ task AnalyzeBuiltFiles CheckPSScriptAnalyzerInstalled, CreatePsm1ForRelease, { Severity = @('Error', 'Warning') Recurse = $true Verbose = $false - ExcludeRule = @('PSUseSingularNouns', 'PSUseBOMForUnicodeEncodedFile') + ExcludeRule = @('PSUseSingularNouns', 'PSUseBOMForUnicodeEncodedFile', 'PSReviewUnusedParameter') } $saresults = Invoke-ScriptAnalyzer @scriptAnalyzerParams @@ -144,7 +144,7 @@ task CreatePsd1ForRelease CleanTemp, { GUID = '4c0b9e17-141b-4dd5-8549-fb21cccaa325' Author = 'Wes Carroll' CompanyName = 'Zerto' - Copyright = '(c) {0} Wes Carroll. All rights reserved.' -f $(Get-Date -format 'yyyy') + Copyright = '(c) {0} Wes Carroll. All rights reserved.' -f $(Get-Date -Format 'yyyy') Description = 'Windows PowerShell and PowerShell Core API Wrapper Module for Zerto Virtual Manager' PowerShellVersion = '5.1.0' ProjectUri = 'https://github.com/ZertoPublic/ZertoApiWrapper' @@ -193,9 +193,9 @@ task CreateArtifacts CleanPublish, CleanTemp, AnalyzeSourceFiles, SourceFileTest New-Item -Path $BuildRoot -Name "publish" -ItemType Directory } Compress-Archive -Path .\temp\* -DestinationPath .\publish\ZertoApiWrapper.zip - ImportBuiltModule - (Get-Module ZertoApiWrapper).ReleaseNotes | Add-Content .\publish\release-notes.txt - (Get-Module ZertoApiWrapper).Version.ToString() | Add-Content .\publish\release-version.txt + #ImportBuiltModule + #(Get-Module ZertoApiWrapper).ReleaseNotes | Add-Content .\publish\release-notes.txt + #(Get-Module ZertoApiWrapper).Version.ToString() | Add-Content .\publish\release-version.txt Copy-Item "$BuildRoot\ZertoApiWrapper.build.ps1" "$BuildRoot\publish\ZertoApiWrapper.build.ps1" Copy-Item "$BuildRoot\ZertoApiWrapper.Depend.psd1" "$BuildRoot\publish\ZertoApiWrapper.Depend.psd1" Copy-Item "$BuildRoot\build.ps1" "$BuildRoot\publish\build.ps1" From aecd4fd1d5adaa20b93395d2666b5a419d406c97 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 5 May 2020 21:25:54 -0400 Subject: [PATCH 377/479] Updated CHANGELOG with formatting information --- CHANGELOG.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8960b69..69b1acd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,20 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### General +* Removed RELEASENOTES and converted to a CHANGELOG format. + ### Zerto Virtual Manager * Refactored `Copy-ZertoVpg` functionality to leverage identifier and name maps and eliminate `where-object` searches. * Updated `Get-ZertoEvent` parameter to fall in line with the filter parameter name in the API documentation. Moved the old parameter name to an alias to ensure that existing functionality continues to work. -## 1.4.0.20200410 +## [1.4.0.20200410] ### Zerto Virtual Manager @@ -33,7 +44,7 @@ * `Get-ZAPlannerZcasReport` Help can be found here: [Get-ZAPlannerZcasReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerZcasReport.md) * Created `Get-ZAProtectedVm` and `Get-ZAProtectedVmReport` functions to leverage the newly released Zerto Analytics APIs for this data. Help files can be found here: [Get-ZAProtectedVm](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVm.md) and [Get-ZAProtectedVmReport](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAProtectedVmReport.md) -## 1.3.0.20191201 +## [1.3.0.20191201] ### Zerto Virtual Manager @@ -44,7 +55,7 @@ * A function has been added; `Copy-ZertoVpg`. This function will allow users to copy the settings of a single VPG and add new VMs to it. There is currently no customization beyond specifying the VMs to be placed in the newly created VPG. Should additional edits \ updates be required, they should be done post creation. [Issue 54](https://github.com/ZertoPublic/ZertoApiWrapper/issues/54) * Fixed [issue 57](https://github.com/ZertoPublic/ZertoApiWrapper/issues/57) where a `Start-ZertoFailoverTest` would throw an error complaining about validating the body parameter. This has been fixed and tested against Zerto Virtual Manager 7.5 Update 1 with Windows PowerShell 5.1 and PowerShell Core 6.2. -## 1.2.0.20190801 +## [1.2.0.20190801] ### Zerto Virtual Manager @@ -63,7 +74,7 @@ * Updated the way that tests are invoked and parsed to ensure that both source and built module files are tested. This will ensure that what is being shipped passes all tests along with testing of the source files. * Added additional parameter validation tests to several of the functions. On-going effort to complete stand alone unit testing of each function. -## Initial Release +## [Initial Release] ### Zerto Virtual Manager From e6ead11891e522f233b6683732edbfdc4dfe197f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 5 May 2020 21:59:14 -0400 Subject: [PATCH 378/479] Update mandatory parameter declaration --- .../Private/Get-ZertoApiFilter.ps1 | 2 +- ZertoApiWrapper/Public/Add-ZertoPeerSite.ps1 | 2 +- .../Public/Checkpoint-ZertoVpg.ps1 | 8 +- .../Public/Connect-ZertoAnalytics.ps1 | 4 +- .../Public/Connect-ZertoServer.ps1 | 4 +- ZertoApiWrapper/Public/Edit-ZertoVra.ps1 | 2 +- ZertoApiWrapper/Public/Export-ZertoVpg.ps1 | 6 +- ZertoApiWrapper/Public/Get-ZAAlert.ps1 | 2 +- ZertoApiWrapper/Public/Get-ZADatastore.ps1 | 10 +-- ZertoApiWrapper/Public/Get-ZATask.ps1 | 2 +- ZertoApiWrapper/Public/Get-ZAVpg.ps1 | 2 +- ZertoApiWrapper/Public/Get-ZertoAlert.ps1 | 8 +- ZertoApiWrapper/Public/Get-ZertoEvent.ps1 | 8 +- ZertoApiWrapper/Public/Get-ZertoPeerSite.ps1 | 4 +- .../Public/Get-ZertoProtectedVm.ps1 | 2 +- .../Public/Get-ZertoVirtualizationSite.ps1 | 42 +++++----- ZertoApiWrapper/Public/Get-ZertoVpg.ps1 | 24 +++--- .../Public/Get-ZertoVpgSetting.ps1 | 82 +++++++++---------- ZertoApiWrapper/Public/Import-ZertoVpg.ps1 | 2 +- .../Public/Invoke-ZertoFailover.ps1 | 6 +- .../Public/Invoke-ZertoFailoverCommit.ps1 | 2 +- .../Public/Invoke-ZertoFailoverRollback.ps1 | 2 +- .../Public/Invoke-ZertoForceSync.ps1 | 2 +- ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 | 6 +- .../Public/Invoke-ZertoMoveCommit.ps1 | 4 +- .../Public/Invoke-ZertoMoveRollback.ps1 | 2 +- ZertoApiWrapper/Public/New-ZertoVpg.ps1 | 36 ++++---- .../Public/New-ZertoVpgSettingsIdentifier.ps1 | 4 +- .../Public/Remove-ZertoPeerSite.ps1 | 12 +-- ZertoApiWrapper/Public/Remove-ZertoVpg.ps1 | 6 +- ZertoApiWrapper/Public/Resume-ZertoVpg.ps1 | 2 +- .../Public/Save-ZertoVpgSetting.ps1 | 2 +- ZertoApiWrapper/Public/Set-ZertoAlert.ps1 | 6 +- ZertoApiWrapper/Public/Set-ZertoLicense.ps1 | 6 +- .../Public/Start-ZertoCloneVpg.ps1 | 8 +- .../Public/Start-ZertoFailoverTest.ps1 | 2 +- ZertoApiWrapper/Public/Stop-ZertoCloneVpg.ps1 | 2 +- .../Public/Stop-ZertoFailoverTest.ps1 | 4 +- ZertoApiWrapper/Public/Suspend-ZertoVpg.ps1 | 2 +- ZertoApiWrapper/Public/Uninstall-ZertoVra.ps1 | 2 +- 40 files changed, 167 insertions(+), 167 deletions(-) diff --git a/ZertoApiWrapper/Private/Get-ZertoApiFilter.ps1 b/ZertoApiWrapper/Private/Get-ZertoApiFilter.ps1 index 25b52e9..53fbeed 100644 --- a/ZertoApiWrapper/Private/Get-ZertoApiFilter.ps1 +++ b/ZertoApiWrapper/Private/Get-ZertoApiFilter.ps1 @@ -3,7 +3,7 @@ function Get-ZertoApiFilter { [Outputtype([String])] param( [Parameter( - Mandatory = $true, + Mandatory, HelpMessage = "Hashtable that contains filter keys and values" )] [ValidateNotNullOrEmpty()] diff --git a/ZertoApiWrapper/Public/Add-ZertoPeerSite.ps1 b/ZertoApiWrapper/Public/Add-ZertoPeerSite.ps1 index 9cbd5db..e4bed27 100644 --- a/ZertoApiWrapper/Public/Add-ZertoPeerSite.ps1 +++ b/ZertoApiWrapper/Public/Add-ZertoPeerSite.ps1 @@ -3,7 +3,7 @@ function Add-ZertoPeerSite { [cmdletbinding( SupportsShouldProcess = $true )] param( [parameter( - Mandatory = $true, + Mandatory, HelpMessage = "Target Hostname or IP address to pair the localsite to." )] [ValidateScript( { $_ -match [IPAddress]$_ } )] diff --git a/ZertoApiWrapper/Public/Checkpoint-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Checkpoint-ZertoVpg.ps1 index c0dd1a4..65dfbfa 100644 --- a/ZertoApiWrapper/Public/Checkpoint-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Checkpoint-ZertoVpg.ps1 @@ -3,7 +3,7 @@ function Checkpoint-ZertoVpg { [cmdletbinding()] param( [Parameter( - Mandatory = $true, + Mandatory, HelpMessage = "Name of the VPG to tag.", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true @@ -11,7 +11,7 @@ function Checkpoint-ZertoVpg { [ValidateNotNullOrEmpty()] [string[]]$vpgName, [Parameter( - Mandatory = $true, + Mandatory, HelpMessage = "Text to tag the checkpoint with." )] [ValidateNotNullOrEmpty()] @@ -27,10 +27,10 @@ function Checkpoint-ZertoVpg { $vpgIdentifier = $(get-zertovpg -name $name).vpgIdentifier if ($vpgIdentifier) { $uri = "{0}/{1}/Checkpoints" -f $baseUri, $vpgIdentifier - $body = @{"checkpointName" = $checkpointName} + $body = @{"checkpointName" = $checkpointName } Invoke-ZertoRestRequest -uri $uri -body $($body | ConvertTo-Json) -method "POST" } else { - Write-Output "Cannot find VPG named $name. Please check the name and try again." + Write-Output "Cannot find VPG named $name. Please check the name and try again." } } } diff --git a/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 index 2c8e95f..8bbd20a 100644 --- a/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 +++ b/ZertoApiWrapper/Public/Connect-ZertoAnalytics.ps1 @@ -3,7 +3,7 @@ function Connect-ZertoAnalytics { [cmdletbinding()] param( [Parameter( - Mandatory = $true, + Mandatory, HelpMessage = "PSCredential Object containing username and password authorized for the Zerto Analytics site", Position = 0 )] @@ -17,4 +17,4 @@ function Connect-ZertoAnalytics { $result = Invoke-ZARestRequest -Uri $uri -body $($body | ConvertTo-Json) -Method POST $Script:zaHeaders["Authorization"] = "Bearer $($result.Token)" $Script:zaHeaders -} \ No newline at end of file +} diff --git a/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 b/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 index 177374c..f9f33ac 100644 --- a/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 +++ b/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 @@ -4,7 +4,7 @@ function Connect-ZertoServer { [OutputType([hashtable])] param( [Parameter( - Mandatory = $true, + Mandatory, HelpMessage = "IP address or FQDN of your Zerto Management Server" )] [ValidateNotNullOrEmpty()] @@ -18,7 +18,7 @@ function Connect-ZertoServer { [Alias("port")] [string]$zertoPort = "9669", [Parameter( - Mandatory = $true, + Mandatory, HelpMessage = "Valid credentials to connect to the Zerto Management Server" )] [System.Management.Automation.PSCredential]$credential, diff --git a/ZertoApiWrapper/Public/Edit-ZertoVra.ps1 b/ZertoApiWrapper/Public/Edit-ZertoVra.ps1 index 0b1b9fc..855f0d4 100644 --- a/ZertoApiWrapper/Public/Edit-ZertoVra.ps1 +++ b/ZertoApiWrapper/Public/Edit-ZertoVra.ps1 @@ -3,7 +3,7 @@ function Edit-ZertoVra { [cmdletbinding( SupportsShouldProcess = $true )] param( [Parameter( - Mandatory = $true, + Mandatory, HelpMessage = "Identifier of the VRA to be updated." )] [ValidateNotNullOrEmpty()] diff --git a/ZertoApiWrapper/Public/Export-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Export-ZertoVpg.ps1 index 3f5efb8..2d00a83 100644 --- a/ZertoApiWrapper/Public/Export-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Export-ZertoVpg.ps1 @@ -4,7 +4,7 @@ function Export-ZertoVpg { param( [Parameter( HelpMessage = "Location where to dump the resulting JSON files containing the VPG Settings", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [Alias("outputFolder")] @@ -12,7 +12,7 @@ function Export-ZertoVpg { [parameter( HelpMessage = "Name(s) of the VPG(s) to be exported", ParameterSetName = "namedVpgs", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string[]]$vpgName, @@ -21,7 +21,7 @@ function Export-ZertoVpg { ParameterSetName = "allVpgs", valuefrompipeline = $true, ValueFromPipelineByPropertyName = $true, - Mandatory = $true + Mandatory )] [switch]$allVpgs ) diff --git a/ZertoApiWrapper/Public/Get-ZAAlert.ps1 b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 index 1026895..e173b34 100644 --- a/ZertoApiWrapper/Public/Get-ZAAlert.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAAlert.ps1 @@ -17,7 +17,7 @@ function Get-ZAAlert { [Parameter( HelpMessage = "The alert Idnetifier", ParameterSetName = "alertId", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$alertIdentifier diff --git a/ZertoApiWrapper/Public/Get-ZADatastore.ps1 b/ZertoApiWrapper/Public/Get-ZADatastore.ps1 index 14f074a..315e26c 100644 --- a/ZertoApiWrapper/Public/Get-ZADatastore.ps1 +++ b/ZertoApiWrapper/Public/Get-ZADatastore.ps1 @@ -4,15 +4,15 @@ function Get-ZADatastore { param ( [Parameter( HelpMessage = "The site identifier. The site identifier is mandatory. Omit the datastore and datastore cluster identifiers to view site level storage information.", - Mandatory = $true, + Mandatory, ParameterSetName = "AllInfo" )] [Parameter( - Mandatory = $true, + Mandatory, ParameterSetName = "cluster" )] [Parameter( - Mandatory = $true, + Mandatory, ParameterSetName = "datastore" )] [ValidateNotNullOrEmpty()] @@ -20,14 +20,14 @@ function Get-ZADatastore { [Parameter( HelpMessage = "The datastore cluster identifier. Gets a list of datastores in the cluster.", ParameterSetName = "cluster", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$clusterIdentifier, [Parameter( HelpMessage = "The datastore identifer. Gets the datastore info.", ParameterSetName = "datastore", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$datastoreIdentifier diff --git a/ZertoApiWrapper/Public/Get-ZATask.ps1 b/ZertoApiWrapper/Public/Get-ZATask.ps1 index 2f1bce5..d13ebb3 100644 --- a/ZertoApiWrapper/Public/Get-ZATask.ps1 +++ b/ZertoApiWrapper/Public/Get-ZATask.ps1 @@ -17,7 +17,7 @@ function Get-ZATask { [Parameter( HelpMessage = "The task Idnetifier", ParameterSetName = "taskId", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$taskIdentifier diff --git a/ZertoApiWrapper/Public/Get-ZAVpg.ps1 b/ZertoApiWrapper/Public/Get-ZAVpg.ps1 index a105390..bb50cb8 100644 --- a/ZertoApiWrapper/Public/Get-ZAVpg.ps1 +++ b/ZertoApiWrapper/Public/Get-ZAVpg.ps1 @@ -11,7 +11,7 @@ function Get-ZAVpg { [Parameter( HelpMessage = "The VPG Identifier", ParameterSetName = "vpg", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$vpgIdentifier diff --git a/ZertoApiWrapper/Public/Get-ZertoAlert.ps1 b/ZertoApiWrapper/Public/Get-ZertoAlert.ps1 index abd4571..d9d9181 100644 --- a/ZertoApiWrapper/Public/Get-ZertoAlert.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoAlert.ps1 @@ -4,7 +4,7 @@ function Get-ZertoAlert { param( [Parameter( ParameterSetName = "alertId", - Mandatory = $true, + Mandatory, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true , HelpMessage = "AlertId or array of AlertIds to be queried" @@ -13,19 +13,19 @@ function Get-ZertoAlert { [string[]]$alertId, [Parameter( ParameterSetName = "entities", - Mandatory = $true, + Mandatory, HelpMessage = "Switch to return the entities information from the API" )] [switch]$entities, [Parameter( ParameterSetName = "helpIdentifiers", - Mandatory = $true, + Mandatory, HelpMessage = "Switch to get the Help Identifiers information from the API" )] [switch]$helpIdentifiers, [Parameter( ParameterSetName = "levels", - Mandatory = $true, + Mandatory, HelpMessage = "Switch to return Alert Levels information from the API" )] [switch]$levels, diff --git a/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 b/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 index 1dbec44..8094ac2 100644 --- a/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 @@ -86,7 +86,7 @@ function Get-ZertoEvent { [string]$alertIdentifier, [Parameter( ParameterSetName = "eventId", - Mandatory = $true, + Mandatory, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = "The identifier or identifiers of the event for which information is returned." @@ -95,19 +95,19 @@ function Get-ZertoEvent { [string[]]$eventId, [Parameter( ParameterSetName = "categories", - Mandatory = $true, + Mandatory, HelpMessage = "Returns possible Event Categories." )] [switch]$categories, [Parameter( ParameterSetName = "entities", - Mandatory = $true, + Mandatory, HelpMessage = "Returns possible entity types." )] [switch]$entities, [Parameter( ParameterSetName = "types", - Mandatory = $true, + Mandatory, HelpMessage = "Returns possible event types.")] [switch]$types ) diff --git a/ZertoApiWrapper/Public/Get-ZertoPeerSite.ps1 b/ZertoApiWrapper/Public/Get-ZertoPeerSite.ps1 index cb86c53..d5c42e3 100644 --- a/ZertoApiWrapper/Public/Get-ZertoPeerSite.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoPeerSite.ps1 @@ -5,12 +5,12 @@ function Get-ZertoPeerSite { [Parameter( ParameterSetName = "pairingStatuses", HelpMessage = "Switch to return possible paiting statuses.", - Mandatory = $true + Mandatory )] [switch]$pairingStatuses, [Parameter( ParameterSetName = "siteIdentifier", - Mandatory = $true, + Mandatory, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = "The identifier(s) of the peer site(s) for which information is to be returned." diff --git a/ZertoApiWrapper/Public/Get-ZertoProtectedVm.ps1 b/ZertoApiWrapper/Public/Get-ZertoProtectedVm.ps1 index 36dc2aa..e559926 100644 --- a/ZertoApiWrapper/Public/Get-ZertoProtectedVm.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoProtectedVm.ps1 @@ -4,7 +4,7 @@ function Get-ZertoProtectedVm { param ( [Parameter( ParameterSetName = "vmIdentifier", - Mandatory = $true, + Mandatory, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = "vmIdentifier(s) for which to return information" diff --git a/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 b/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 index 2dd1b23..ddaaf20 100644 --- a/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoVirtualizationSite.ps1 @@ -4,57 +4,57 @@ function Get-ZertoVirtualizationSite { param( [Parameter( ParameterSetName = "siteIdentifier", - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the Zerto Virtual Manager site." )] [Parameter( ParameterSetName = "datastoreClusters", - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the Zerto Virtual Manager site." )] [Parameter( ParameterSetName = "datastores", - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the Zerto Virtual Manager site." )] [Parameter( ParameterSetName = "hostClusters", - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the Zerto Virtual Manager site." )] [Parameter( ParameterSetName = "hosts", - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the Zerto Virtual Manager site." )] [Parameter( ParameterSetName = "networks", - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the Zerto Virtual Manager site." )] [Parameter( ParameterSetName = "resourcePools", - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the Zerto Virtual Manager site." )] [Parameter( ParameterSetName = "vms", - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the Zerto Virtual Manager site." )] [Parameter( ParameterSetName = "devices", - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the Zerto Virtual Manager site." )] [Parameter( ParameterSetName = "folders", - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the Zerto Virtual Manager site." )] [Parameter( ParameterSetName = "repositories", - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the Zerto Virtual Manager site." )] [ValidateNotNullOrEmpty()] @@ -62,19 +62,19 @@ function Get-ZertoVirtualizationSite { [string]$siteIdentifier, [Parameter( ParameterSetName = "datastoreClusters", - Mandatory = $true, + Mandatory, HelpMessage = "When selected, will return all datastore clusters at the specified site." )] [switch]$datastoreClusters, [Parameter( ParameterSetName = "datastores", - Mandatory = $true, + Mandatory, HelpMessage = "When selected, will return all datastores at the specified site." )] [switch]$datastores, [Parameter( ParameterSetName = "devices", - Mandatory = $true, + Mandatory, HelpMessage = "When selected, will return all devices at the specified site." )] [switch]$devices, @@ -93,43 +93,43 @@ function Get-ZertoVirtualizationSite { [string]$hostIdentifier, [Parameter( ParameterSetName = "folders", - Mandatory = $true, + Mandatory, HelpMessage = "Return all folders at the selected site." )] [switch]$folders, [Parameter( ParameterSetName = "hostClusters", - Mandatory = $true, + Mandatory, HelpMessage = "Return all host clusters at the selected site." )] [switch]$hostClusters, [Parameter( ParameterSetName = "hosts", - Mandatory = $true, + Mandatory, HelpMessage = "Return all hosts at the selected site. If a host identifier is provided, return only that host." )] [switch]$hosts, [Parameter( ParameterSetName = "networks", - Mandatory = $true, + Mandatory, HelpMessage = "Return all networks at the selected site." )] [switch]$networks, [Parameter( ParameterSetName = "resourcePools", - Mandatory = $true, + Mandatory, HelpMessage = "Return all resource pools at the selected site." )] [switch]$resourcePools, [Parameter( ParameterSetName = "vms", - Mandatory = $true, + Mandatory, HelpMessage = "Return all VMs at the selected site." )] [switch]$vms, [Parameter( ParameterSetName = "repositories", - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the Zerto Virtual Manager site." )] [switch]$repositories diff --git a/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 index 6990526..c26a968 100644 --- a/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoVpg.ps1 @@ -4,17 +4,17 @@ function Get-ZertoVpg { param( [Parameter( ParameterSetName = "protectionGroupIdentifier", - Mandatory = $true, + Mandatory, HelpMessage = "The identifier(s) of the Virtual Protection Group to return" )] [Parameter( ParameterSetName = "checkpoints", - Mandatory = $true, + Mandatory, HelpMessage = "The identifier(s) of the Virtual Protection Group to return" )] [Parameter( ParameterSetName = "stats", - Mandatory = $true, + Mandatory, HelpMessage = "The identifier(s) of the Virtual Protection Group to return" )] [ValidateNotNullOrEmpty()] @@ -22,7 +22,7 @@ function Get-ZertoVpg { [string[]]$protectionGroupIdentifier, [Parameter( ParameterSetName = "checkpoints", - Mandatory = $true, + Mandatory, HelpMessage = "Return checkpoints for the selected Virtual Protection Group." )] [switch]$checkpoints, @@ -39,49 +39,49 @@ function Get-ZertoVpg { [ValidateNotNullOrEmpty()] [string]$endDate, [Parameter( - ParameterSetName = "stats", Mandatory = $true, + ParameterSetName = "stats", Mandatory, HelpMessage = "Return earliest and latest checkpoints for the selected Virtual Protection Group" )] [switch]$checkpointsStats, [Parameter( ParameterSetName = "entityTypes", - Mandatory = $true, + Mandatory, HelpMessage = "Return Valid VPG entityTypes" )] [switch]$entityTypes, [Parameter( ParameterSetName = "failoverCommitPolicies", - Mandatory = $true, + Mandatory, HelpMessage = "Valid Failover Commit Policies" )] [switch]$failoverCommitPolicies, [Parameter( ParameterSetName = "failoverShutdownPolicies", - Mandatory = $true, + Mandatory, HelpMessage = "Valid Failover Shutdown Policies" )] [switch]$failoverShutdownPolicies, [Parameter( ParameterSetName = "priorities", - Mandatory = $true, + Mandatory, HelpMessage = "Valid VPG priorities" )] [switch]$priorities, [Parameter( ParameterSetName = "retentionPolicies", - Mandatory = $true, + Mandatory, HelpMessage = "Valid retention policies" )] [switch]$retentionPolicies, [Parameter( ParameterSetName = "statuses", - Mandatory = $true, + Mandatory, HelpMessage = "Valid VPG statuses" )] [switch]$statuses, [Parameter( ParameterSetName = "subStatuses", - Mandatory = $true, + Mandatory, HelpMessage = "Valid VPG sub statuses" )] [switch]$subStatuses, diff --git a/ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 b/ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 index 533430b..13164a1 100644 --- a/ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoVpgSetting.ps1 @@ -10,7 +10,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -18,7 +18,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error." )] [Parameter( @@ -26,7 +26,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -34,7 +34,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -42,7 +42,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -50,7 +50,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -58,7 +58,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -66,7 +66,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -74,7 +74,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -82,7 +82,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -90,7 +90,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -98,7 +98,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -106,7 +106,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -114,7 +114,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -122,7 +122,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -130,7 +130,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -138,7 +138,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -146,7 +146,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [Parameter( @@ -154,7 +154,7 @@ function Get-ZertoVpgSetting { ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, ValueFromRemainingArguments = $true, - Mandatory = $true, + Mandatory, HelpMessage = "The identifier of the VPG settings object for which information is retrieved." )] [ValidateNotNullOrEmpty()] @@ -162,100 +162,100 @@ function Get-ZertoVpgSetting { [string[]]$vpgSettingsIdentifier, [Parameter( ParameterSetName = "backup", - Mandatory = $true, + Mandatory, HelpMessage = "Return backup information for VPG identifier specified. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error." )] [switch]$backup, [Parameter( ParameterSetName = "dayOfWeek", - Mandatory = $true, + Mandatory, HelpMessage = "Get the day of week a backup is scheduled. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error." )] [switch]$dayOfWeek, [Parameter( ParameterSetName = "retentionPeriod", - Mandatory = $true, + Mandatory, HelpMessage = "Get the retention period for a backup. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error." )] [switch]$retentionPeriod, [Parameter( ParameterSetName = "schedulerPeriod", - Mandatory = $true, + Mandatory, HelpMessage = "Get the backup schedule. Please note, this parameter is ONLY available in Zerto version 7.5 and earlier. Attempting to run this switch against a Zerto Virtual Manager version 8.0 or higher result in an error." )] [switch]$schedulerPeriod, [Parameter( ParameterSetName = "basic", - Mandatory = $true, + Mandatory, HelpMessage = "Get VPG Basic Settings" )] [switch]$basic, [Parameter( ParameterSetName = "bootGroup", - Mandatory = $true, + Mandatory, HelpMessage = "Get VPG Boot Settings" )] [switch]$bootgroup, [Parameter( ParameterSetName = "journal", - Mandatory = $true, + Mandatory, HelpMessage = "Get VPG Journal Settings" )] [switch]$journal, [Parameter( ParameterSetName = "networks", - Mandatory = $true, + Mandatory, HelpMessage = "Get VPG Network Settings" )] [switch]$networks, [Parameter( ParameterSetName = "priority", - Mandatory = $true, + Mandatory, HelpMessage = "Get VPG Priority Settings" )] [switch]$priority, [Parameter( ParameterSetName = "recovery", - Mandatory = $true, + Mandatory, HelpMessage = "Get VPG Recovery Settings" )] [Alias("rcovery")] [switch]$recovery, [Parameter( ParameterSetName = "scripting", - Mandatory = $true, + Mandatory, HelpMessage = "Get VPG Recovery Settings" )] [switch]$scripting, [Parameter( ParameterSetName = "vms", - Mandatory = $true, + Mandatory, HelpMessage = "Get all settings for all VMs in a VPG." )] [switch]$vms, [Parameter( ParameterSetName = "vmIdentifier", - Mandatory = $true, + Mandatory, HelpMessage = "Get all settings for selected VM" )] [Parameter( ParameterSetName = "nics", - Mandatory = $true, + Mandatory, HelpMessage = "VM Identifier" )] [Parameter( ParameterSetName = "volumes", - Mandatory = $true, + Mandatory, HelpMessage = "VM Identifier" )] [Parameter( ParameterSetName = "nicIdentifier", - Mandatory = $true, + Mandatory, HelpMessage = "VM Identifier" )] [Parameter( ParameterSetName = "volumeIdentifier", - Mandatory = $true, + Mandatory, HelpMessage = "VM Identifier" )] [ValidateNotNullOrEmpty()] @@ -263,13 +263,13 @@ function Get-ZertoVpgSetting { [string]$vmIdentifier, [Parameter( ParameterSetName = "nics", - Mandatory = $true, + Mandatory, HelpMessage = "Return NIC information for all NICs of the specified VM" )] [switch]$nics, [Parameter( ParameterSetName = "nicIdentifier", - Mandatory = $true, + Mandatory, HelpMessage = "Return NIC information for specified NIC of the specified VM" )] [ValidateNotNullOrEmpty()] @@ -277,13 +277,13 @@ function Get-ZertoVpgSetting { [string]$nicIdentifier, [Parameter( ParameterSetName = "volumes", - Mandatory = $true, + Mandatory, HelpMessage = "Return Volume information for all volumes of the specified VM" )] [switch]$volumes, [Parameter( ParameterSetName = "volumeIdentifier", - Mandatory = $true, + Mandatory, HelpMessage = "Return volume information for the specified volume of the specified VM" )] [ValidateNotNullOrEmpty()] @@ -291,7 +291,7 @@ function Get-ZertoVpgSetting { [string]$volumeIdentifier, [Parameter( ParameterSetName = "ltr", - Mandatory = $true, + Mandatory, HelpMessage = "Return LTR information for the specified VPG. Please note, this parameter is ONLY available in Zerto version 8.0 and later. Attempting to run this switch against a Zerto Virtual Manager version 7.5 or lower will result in an error." )] [switch]$ltr diff --git a/ZertoApiWrapper/Public/Import-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Import-ZertoVpg.ps1 index 48a72cc..30675b9 100644 --- a/ZertoApiWrapper/Public/Import-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Import-ZertoVpg.ps1 @@ -4,7 +4,7 @@ function Import-ZertoVpg { param( [Parameter( HelpMessage = "VPG settings JSON file(s) to import.", - Mandatory = $true, + Mandatory, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true )] diff --git a/ZertoApiWrapper/Public/Invoke-ZertoFailover.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoFailover.ps1 index 5eb5500..013a50c 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoFailover.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoFailover.ps1 @@ -4,7 +4,7 @@ function Invoke-ZertoFailover { param( #TODO - Refactor? [Parameter( - Mandatory = $true, + Mandatory, HelpMessage = "Name of the VPG to Failover" )] [ValidateNotNullOrEmpty()] @@ -54,7 +54,7 @@ function Invoke-ZertoFailover { Write-Error "VPG: $vpgName Not Found. Please check the name and try again!" -ErrorAction Stop } $baseUri = "vpgs/{0}/failover" -f $vpgId - $body = @{} + $body = @{ } # Setup Required Defaults $body['commitpolicy'] = $commitPolicy $body['TimeToWaitBeforeShutdownInSec'] = $timeToWaitBeforeShutdownInSec @@ -76,7 +76,7 @@ function Invoke-ZertoFailover { $vpgVmInformation = Get-ZertoProtectedVm -vpgName $vpgName [System.Collections.ArrayList]$vmIdentifiers = @() foreach ( $name in $vmName ) { - $selectedVm = $vpgVmInformation | Where-Object {$_.VmName.toLower() -eq $name.toLower()} + $selectedVm = $vpgVmInformation | Where-Object { $_.VmName.toLower() -eq $name.toLower() } if ($null -eq $selectedVm) { Write-Error "VM: $name NOT found in VPG $vpgName. Check the name and try again." -ErrorAction Stop } elseif ($vmIdentifiers.Contains($selectedVm.vmIdentifier.toString())) { diff --git a/ZertoApiWrapper/Public/Invoke-ZertoFailoverCommit.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoFailoverCommit.ps1 index cbd5250..cf91f81 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoFailoverCommit.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoFailoverCommit.ps1 @@ -4,7 +4,7 @@ function Invoke-ZertoFailoverCommit { param( [Parameter( HelpMessage = "Name(s) of the VPG(s) to commit.", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string[]]$vpgName, diff --git a/ZertoApiWrapper/Public/Invoke-ZertoFailoverRollback.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoFailoverRollback.ps1 index fc6b92f..4391d65 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoFailoverRollback.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoFailoverRollback.ps1 @@ -4,7 +4,7 @@ function Invoke-ZertoFailoverRollback { param( [Parameter( HelpMessage = "Name(s) of VPG(s) to roll back from failing over", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string[]]$vpgName diff --git a/ZertoApiWrapper/Public/Invoke-ZertoForceSync.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoForceSync.ps1 index 81ee866..8e5c351 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoForceSync.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoForceSync.ps1 @@ -4,7 +4,7 @@ function Invoke-ZertoForceSync { param( [Parameter( HelpMessage = "Name(s) of VPG(s) to force sync", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string[]]$vpgName diff --git a/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 index 2f82592..476f7d3 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 @@ -4,7 +4,7 @@ function Invoke-ZertoMove { param( [Parameter( HelpMessage = "Name(s) of the VPG(s) you want to move.", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string[]]$vpgName, @@ -29,13 +29,13 @@ function Invoke-ZertoMove { [Parameter( ParameterSetName = "disableReverseProtection", HelpMessage = "Do not enable reverse protection. The VPG definition is kept with the status Needs Configuration and the reverse settings in the VPG definition are not set.", - Mandatory = $true + Mandatory )] [switch]$disableReverseProtection, [Parameter( ParameterSetName = "keepSourceVms", HelpMessage = "Prevent the protected virtual machines from being deleted in the protected site. Using this setting disables reverse protection.", - Mandatory = $true + Mandatory )] [switch]$keepSourceVms, [Parameter( diff --git a/ZertoApiWrapper/Public/Invoke-ZertoMoveCommit.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoMoveCommit.ps1 index f524af1..39327c8 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoMoveCommit.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoMoveCommit.ps1 @@ -4,7 +4,7 @@ function Invoke-ZertoMoveCommit { param( [Parameter( HelpMessage = "Name(s) of the VPG(s) to commit.", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string[]]$vpgName, @@ -20,7 +20,7 @@ function Invoke-ZertoMoveCommit { begin { $baseUri = "vpgs" - $body = @{} + $body = @{ } if ($reverseProtection) { $body["ReverseProtection"] = $true } elseif ($keepSourceVms) { diff --git a/ZertoApiWrapper/Public/Invoke-ZertoMoveRollback.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoMoveRollback.ps1 index b1d7e24..36728dd 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoMoveRollback.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoMoveRollback.ps1 @@ -4,7 +4,7 @@ function Invoke-ZertoMoveRollback { param( [Parameter( HelpMessage = "Name(s) of VPG(s) to roll back from failing over", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string[]]$vpgName diff --git a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 index bdbc18b..4ae6f60 100644 --- a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 @@ -4,7 +4,7 @@ function New-ZertoVpg { param( [Parameter( HelpMessage = "Name of the VPG", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$vpgName, @@ -20,89 +20,89 @@ function New-ZertoVpg { [int]$journalHistoryInHours = 24, [Parameter( HelpMessage = "Name(s) of the VM(s) to be protected.", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string[]]$protectedVm, [Parameter( HelpMessage = "Name of the site where the VM(s) will be recovered", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$recoverySite, [Parameter( HelpMessage = "Name of the cluster where the VM(s) will be recovered.", ParameterSetName = "recoveryClusterDatastore", - Mandatory = $true + Mandatory )] [Parameter( HelpMessage = "Name of the cluster where the VM(s) will be recovered.", ParameterSetName = "recoveryClusterDatastoreCluster", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$recoveryCluster, [Parameter( HelpMessage = "Name of the host where the VM(s) will be recovered.", ParameterSetName = "recoveryHostDatastore", - Mandatory = $true + Mandatory )] [Parameter( HelpMessage = "Name of the host where the VM(s) will be recovered.", ParameterSetName = "recoveryHostDatastoreCluster", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$recoveryHost, [Parameter( HelpMessage = "Name of the resource pool where the VM(s) will be recovered.", ParameterSetName = "recoveryResourcePoolDatastore", - Mandatory = $true + Mandatory )] [Parameter( HelpMessage = "Name of the resource pool where the VM(s) will be recovered.", ParameterSetName = "recoveryResourcePoolDatastoreCluster", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$recoveryResourcePool, [Parameter( HelpMessage = "Name of the datastore where the VM(s), Volume(s), and Journal(s) will reside.", ParameterSetName = "recoveryClusterDatastore", - Mandatory = $true + Mandatory )] [Parameter( HelpMessage = "Name of the datastore where the VM(s), Volume(s), and Journal(s) will reside.", ParameterSetName = "recoveryHostDatastore", - Mandatory = $true + Mandatory )] [Parameter( HelpMessage = "Name of the datastore where the VM(s), Volume(s), and Journal(s) will reside.", ParameterSetName = "recoveryResourcePoolDatastore", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$datastore, [Parameter( HelpMessage = "Name of the datastore cluster where the VM(s), Volume(s), and Journal(s) will reside.", ParameterSetName = "recoveryClusterDatastoreCluster", - Mandatory = $true + Mandatory )] [Parameter( HelpMessage = "Name of the datastore cluster where the VM(s), Volume(s), and Journal(s) will reside.", ParameterSetName = "recoveryHostDatastoreCluster", - Mandatory = $true + Mandatory )] [Parameter( HelpMessage = "Name of the datastore cluster where the VM(s), Volume(s), and Journal(s) will reside.", ParameterSetName = "recoveryResourcePoolDatastoreCluster", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$datastoreCluster, [Parameter( HelpMessage = "Name of folder at recovery location where the recovered virtual machine(s) will be created.", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$recoveryFolder, @@ -132,13 +132,13 @@ function New-ZertoVpg { [String]$zorg, [Parameter( HelpMessage = "Name of the network to use during a Failover Live \ Move VPG operation.", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [String]$recoveryNetwork, [Parameter( HelpMessage = "Name of the network to use during a Failover Test operation", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$testNetwork, diff --git a/ZertoApiWrapper/Public/New-ZertoVpgSettingsIdentifier.ps1 b/ZertoApiWrapper/Public/New-ZertoVpgSettingsIdentifier.ps1 index 06150d2..53efea7 100644 --- a/ZertoApiWrapper/Public/New-ZertoVpgSettingsIdentifier.ps1 +++ b/ZertoApiWrapper/Public/New-ZertoVpgSettingsIdentifier.ps1 @@ -5,7 +5,7 @@ function New-ZertoVpgSettingsIdentifier { [Parameter( HelpMessage = "Identifier of the VPG to create a VPG settings identifier. If a vpgIdentifier is not provided, a new VPG settings object is created without any configured settings. This would be used for creating a new VPG from scratch.", ParameterSetName = "existingVpg", - Mandatory = $true, + Mandatory, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true )] @@ -15,7 +15,7 @@ function New-ZertoVpgSettingsIdentifier { [Parameter( HelpMessage = "Use this switch when creating a vpgSettingsIdentifier for a new VPG", ParameterSetName = "newVpg", - Mandatory = $true + Mandatory )] [switch]$newVpg ) diff --git a/ZertoApiWrapper/Public/Remove-ZertoPeerSite.ps1 b/ZertoApiWrapper/Public/Remove-ZertoPeerSite.ps1 index 0d818e9..64e4289 100644 --- a/ZertoApiWrapper/Public/Remove-ZertoPeerSite.ps1 +++ b/ZertoApiWrapper/Public/Remove-ZertoPeerSite.ps1 @@ -10,7 +10,7 @@ function Remove-ZertoPeerSite { ParameterSetName = "siteIdentifier", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [Alias("siteId")] @@ -20,7 +20,7 @@ function Remove-ZertoPeerSite { ParameterSetName = "peerSiteName", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string[]]$peerSiteName, @@ -29,9 +29,9 @@ function Remove-ZertoPeerSite { ParameterSetName = "hostName", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, - Mandatory = $true + Mandatory )] - [ValidateScript( {$_ -match [IPAddress]$_ })] + [ValidateScript( { $_ -match [IPAddress]$_ })] [string[]]$hostName, [Parameter( HelpMessage = "Specify this switch to Keep the target replica disks for any VPGs replicating between the sites as the VPGs will be deleted by unpairing the sites. If this switch is not used, the target replica disks will be deleted" @@ -41,7 +41,7 @@ function Remove-ZertoPeerSite { begin { $baseUri = "peersites" - $body = @{} + $body = @{ } if ( $keepTargetDisks ) { $body['IsKeepTargetDisks'] = $true } else { @@ -78,4 +78,4 @@ function Remove-ZertoPeerSite { end { # Nothing to do } -} \ No newline at end of file +} diff --git a/ZertoApiWrapper/Public/Remove-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Remove-ZertoVpg.ps1 index 5e453fb..e389705 100644 --- a/ZertoApiWrapper/Public/Remove-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Remove-ZertoVpg.ps1 @@ -3,7 +3,7 @@ function Remove-ZertoVpg { [cmdletbinding( SupportsShouldProcess = $true, DefaultParameterSetName = "vpgIdentifier" )] param( [Parameter( - Mandatory = $true, + Mandatory, ParameterSetName = "vpgName", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, @@ -12,7 +12,7 @@ function Remove-ZertoVpg { [ValidateNotNullOrEmpty()] [string[]]$vpgName, [Parameter( - Mandatory = $true, + Mandatory, ParameterSetName = "vpgIdentifier", ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, @@ -33,7 +33,7 @@ function Remove-ZertoVpg { begin { $baseUri = "vpgs" - $body = @{} + $body = @{ } if ($keepRecoveryVolumes) { $body['KeepRecoveryVolumes'] = $True } else { diff --git a/ZertoApiWrapper/Public/Resume-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Resume-ZertoVpg.ps1 index 24e1c8f..a1b10d7 100644 --- a/ZertoApiWrapper/Public/Resume-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Resume-ZertoVpg.ps1 @@ -4,7 +4,7 @@ function Resume-ZertoVpg { param( [Parameter( HelpMessage = "Name(s) of VPG(s) to resume replication", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string[]]$vpgName diff --git a/ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 b/ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 index 6f06b40..055febc 100644 --- a/ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 +++ b/ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 @@ -6,7 +6,7 @@ function Save-ZertoVpgSetting { param( [Parameter( HelpMessage = "VpgSettings Identifier to save", - Mandatory = $true, + Mandatory, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true )] diff --git a/ZertoApiWrapper/Public/Set-ZertoAlert.ps1 b/ZertoApiWrapper/Public/Set-ZertoAlert.ps1 index 1969177..725dd5b 100644 --- a/ZertoApiWrapper/Public/Set-ZertoAlert.ps1 +++ b/ZertoApiWrapper/Public/Set-ZertoAlert.ps1 @@ -5,7 +5,7 @@ function Set-ZertoAlert { [Parameter( ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true, - Mandatory = $true, + Mandatory, HelpMessage = "Alert identifier(s) to be dismissed or undismissed." )] [ValidateNotNullOrEmpty()] @@ -13,13 +13,13 @@ function Set-ZertoAlert { [string[]]$alertId, [Parameter( ParameterSetName = "dismiss", - Mandatory = $true, + Mandatory, HelpMessage = "Will dismiss the selected alert." )] [switch]$dismiss, [Parameter( ParameterSetName = "undismiss", - Mandatory = $true, + Mandatory, HelpMessage = "Will undismiss the selected alert." )] [switch]$undismiss diff --git a/ZertoApiWrapper/Public/Set-ZertoLicense.ps1 b/ZertoApiWrapper/Public/Set-ZertoLicense.ps1 index 6ce7e32..aa95042 100644 --- a/ZertoApiWrapper/Public/Set-ZertoLicense.ps1 +++ b/ZertoApiWrapper/Public/Set-ZertoLicense.ps1 @@ -3,7 +3,7 @@ function Set-ZertoLicense { [cmdletbinding( SupportsShouldProcess = $true )] param ( [Parameter( - Mandatory = $true, + Mandatory, HelpMessage = "License Key to apply to the Zerto Virtual Manager" )] [ValidateNotNullOrEmpty()] @@ -12,7 +12,7 @@ function Set-ZertoLicense { begin { $baseUri = "license" - $body = @{"LicenseKey" = $licenseKey} + $body = @{"LicenseKey" = $licenseKey } } process { @@ -24,4 +24,4 @@ function Set-ZertoLicense { end { # Nothing to do } -} \ No newline at end of file +} diff --git a/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 b/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 index 1678c8b..ae95a22 100644 --- a/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 +++ b/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 @@ -4,7 +4,7 @@ function Start-ZertoCloneVpg { param( [Parameter( HelpMessage = "Name of the VPG you wish to clone.", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$vpgName, @@ -36,7 +36,7 @@ function Start-ZertoCloneVpg { if ( $PSBoundParameters.ContainsKey('datastoreName') ) { $recoverysiteIdentifier = $vpgInfo.recoverysite.identifier $recoverySiteDatastores = Get-ZertoVirtualizationSite -siteIdentifier $recoverysiteIdentifier -datastores - $datastoreIdentifier = $($recoverySiteDatastores | Where-Object {$_.datastoreName -like $datastoreName}).DatastoreIdentifier + $datastoreIdentifier = $($recoverySiteDatastores | Where-Object { $_.datastoreName -like $datastoreName }).DatastoreIdentifier if ( -not $datastoreIdentifier ) { Write-Error "Datastore: $datastoreName is not a valid datastore. Please check the name and try again." -ErrorAction Stop } @@ -45,7 +45,7 @@ function Start-ZertoCloneVpg { $vpgVmInformation = Get-ZertoProtectedVm -vpgName $vpgName [System.Collections.ArrayList]$vmIdentifiers = @() foreach ( $name in $vmName ) { - $selectedVm = $vpgVmInformation | Where-Object {$_.VmName.toLower() -eq $name.toLower()} + $selectedVm = $vpgVmInformation | Where-Object { $_.VmName.toLower() -eq $name.toLower() } if ($null -eq $selectedVm) { Write-Error "VM: $name NOT found in VPG $vpgName. Check the name and try again." -ErrorAction Stop } elseif ($vmIdentifiers.Contains($selectedVm.vmIdentifier.toString())) { @@ -63,7 +63,7 @@ function Start-ZertoCloneVpg { process { $uri = "{0}/{1}/CloneStart" -f $baseUri, $vpgIdentifier - $body = [ordered]@{} + $body = [ordered]@{ } if ( $PSBoundParameters.ContainsKey('checkpointIdentifier') ) { $body['checkpointId'] = $checkpointIdentifier } diff --git a/ZertoApiWrapper/Public/Start-ZertoFailoverTest.ps1 b/ZertoApiWrapper/Public/Start-ZertoFailoverTest.ps1 index c889e0c..9c3512d 100644 --- a/ZertoApiWrapper/Public/Start-ZertoFailoverTest.ps1 +++ b/ZertoApiWrapper/Public/Start-ZertoFailoverTest.ps1 @@ -4,7 +4,7 @@ function Start-ZertoFailoverTest { param( [Parameter( HelpMessage = "Name of VPG to failover test", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$vpgName, diff --git a/ZertoApiWrapper/Public/Stop-ZertoCloneVpg.ps1 b/ZertoApiWrapper/Public/Stop-ZertoCloneVpg.ps1 index 6e78ade..f0d4bb5 100644 --- a/ZertoApiWrapper/Public/Stop-ZertoCloneVpg.ps1 +++ b/ZertoApiWrapper/Public/Stop-ZertoCloneVpg.ps1 @@ -4,7 +4,7 @@ function Stop-ZertoCloneVpg { param( [Parameter( HelpMessage = "Name of the VPG to stop cloning", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string]$vpgName diff --git a/ZertoApiWrapper/Public/Stop-ZertoFailoverTest.ps1 b/ZertoApiWrapper/Public/Stop-ZertoFailoverTest.ps1 index babb190..9b5774e 100644 --- a/ZertoApiWrapper/Public/Stop-ZertoFailoverTest.ps1 +++ b/ZertoApiWrapper/Public/Stop-ZertoFailoverTest.ps1 @@ -4,7 +4,7 @@ function Stop-ZertoFailoverTest { param( [Parameter( HelpMessage = "Name(s) of VPG(s) to stop testing.", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string[]]$vpgName, @@ -21,7 +21,7 @@ function Stop-ZertoFailoverTest { begin { $baseUri = "vpgs" - $body = @{"FailoverTestSuccess" = $failoverTestSuccess; "FailoverTestSummary" = $failoverTestSummary} + $body = @{"FailoverTestSuccess" = $failoverTestSuccess; "FailoverTestSummary" = $failoverTestSummary } } process { diff --git a/ZertoApiWrapper/Public/Suspend-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Suspend-ZertoVpg.ps1 index c590859..09278e2 100644 --- a/ZertoApiWrapper/Public/Suspend-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Suspend-ZertoVpg.ps1 @@ -4,7 +4,7 @@ function Suspend-ZertoVpg { param( [Parameter( HelpMessage = "Name(s) of VPG(s) to pause replication", - Mandatory = $true + Mandatory )] [ValidateNotNullOrEmpty()] [string[]]$vpgName diff --git a/ZertoApiWrapper/Public/Uninstall-ZertoVra.ps1 b/ZertoApiWrapper/Public/Uninstall-ZertoVra.ps1 index b62f332..bd5c701 100644 --- a/ZertoApiWrapper/Public/Uninstall-ZertoVra.ps1 +++ b/ZertoApiWrapper/Public/Uninstall-ZertoVra.ps1 @@ -3,7 +3,7 @@ function Uninstall-ZertoVra { [cmdletbinding()] param( [Parameter( - Mandatory = $true, + Mandatory, HelpMessage = "Host Name attached to the VRA to be removed." )] [ValidateNotNullOrEmpty()] From 63a1ab928ecd2554d5796f42230af272a9062a39 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 5 May 2020 22:13:54 -0400 Subject: [PATCH 379/479] Update builtfiletests to ensure module is built --- ZertoApiWrapper.build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 8e57ee9..ac91a0b 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -104,7 +104,7 @@ task SourceFileTests CheckPesterInstalled, { Assert ($results.FailedCount -eq 0) $FailureMessage } -task BuiltFileTests CheckPesterInstalled, { +task BuiltFileTests CreatePsm1ForRelease, CheckPesterInstalled, { ImportBuiltModule $testResultsFile = "$BuildRoot\Tests\BuiltTestResults.xml" $script:results = Invoke-Pester -Script "$BuildRoot" -Tag Unit -OutputFile $testResultsFile -PassThru -Show Fails From 83f00e00ee382fc8723a44f53c70d97fda88dc84 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 6 May 2020 08:17:26 -0400 Subject: [PATCH 380/479] Update the Version Pattern --- ZertoApiWrapper.build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index ac91a0b..853d110 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -1,6 +1,6 @@ #Requires -Modules 'InvokeBuild' -$version = "{0}.{1}" -f $(Get-Content .\version.txt), $(Get-Date -Format 'yyyyMMdd') +$version = "{0}" -f $(Get-Content .\version.txt) #Define the default task task . CreateArtifacts From 5ec0ddce62ca58036ce8e1cb19abbe6bd5bf0a81 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 6 May 2020 08:24:28 -0400 Subject: [PATCH 381/479] Add general Changes to Changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69b1acd..08443ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ and this project is transitioning to [Semantic Versioning](https://semver.org/sp ### General * Removed RELEASENOTES and converted to a CHANGELOG format. +* Updated the build process to follow Semantic Versioning. +* Updated the build process to use the latest Pester Version (4.10.1) +* Updated the build process to use the latest PS Script Analyzer Version (1.19.0) ### Zerto Virtual Manager From c2a0ac9fa08d52c7c61593b633965cf06ad6dee2 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 6 May 2020 12:44:32 -0400 Subject: [PATCH 382/479] Update CHANGELOG for Release --- CHANGELOG.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08443ad..4f4d7d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,19 @@ # Changelog + All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [1.4.1] ### General + * Removed RELEASENOTES and converted to a CHANGELOG format. * Updated the build process to follow Semantic Versioning. * Updated the build process to use the latest Pester Version (4.10.1) * Updated the build process to use the latest PS Script Analyzer Version (1.19.0) +* Updated the Tests Files to use a more modern method of grabbing the PSScriptPath ### Zerto Virtual Manager @@ -36,7 +39,7 @@ and this project is transitioning to [Semantic Versioning](https://semver.org/sp * Updated `Get-ZertoVirtualizationSite` to add the `-repository` parameter to enable returning information for LTR repositories. * Updated `Get-ZertoVpgSetting` to add the `-ltr` parameter to enable returning information for current LTR settings for the selected VPG. -### Zerto Analytics +### Zerto Analytics * Added several functions for the newly added [Zerto Analytics](https://analytics.zerto.com) Planner. * `Get-ZAPlannerSite` Help can be found here: [Get-ZAPlannerSite](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Get-ZAPlannerSite.md) From 380ac5c84184423e7d19bccfbbc3c0a641b93069 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 6 May 2020 12:44:58 -0400 Subject: [PATCH 383/479] Move Recent Updates to ChangeLog --- README.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/README.md b/README.md index 23216ba..afc04f9 100644 --- a/README.md +++ b/README.md @@ -32,13 +32,7 @@ PS> Install-Module -name ZertoApiWrapper ## Recent Updates -* April 10th, 2020: April Release. See [Release Notes](https://github.com/ZertoPublic/ZertoApiWrapper/releases/tag/1.4.0.20200410). -* December 1st, 2019: November Release. See [Release Notes](https://github.com/ZertoPublic/ZertoApiWrapper/releases/tag/1.3.0.20191201). -* August 1st, 2019: August Release. See [Release Notes](https://github.com/ZertoPublic/ZertoApiWrapper/releases/tag/1.2.0.20190801). -* June 16th, 2019: Added functionality for Zerto Analytics. -* May 31st, 2019: Implement logic to allow use of this module in both Windows PowerShell 5.1 and PowerShell Core. -* March 15th, 2019: Implement Export and Import Functionality. Please See [Export-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Export-ZertoVpg.md) and [Import-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Import-ZertoVpg.md) for assistance. No current pre-seed support. -* March 11th, 2019: Create basic VPG completed. Please see [New-ZertoVpg Help](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md) +All recent updates can now be tracked via the [Change Log](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/CHANGELOG.md). ## TODO From 3a2e8f4ee7c0da87aaf29cb68a361c8998771d5c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 6 May 2020 12:45:09 -0400 Subject: [PATCH 384/479] Bump Version --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 88c5fb8..347f583 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.4.0 +1.4.1 From 2887f6d4500b4b12f4c12e8ee0a51bbf9812ca4b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 7 May 2020 13:54:14 -0400 Subject: [PATCH 385/479] Update README.md Fix link to updated WIKI page --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index afc04f9..65b5674 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ PS> Install-Module -name ZertoApiWrapper ## Getting Started -* [Getting Started with Zerto Virtual Manager and the ZertoApiWrapper](https://github.com/ZertoPublic/ZertoApiWrapper/wiki/Getting-Stated-with-Zerto-Virtual-Manager) +* [Getting Started with Zerto Virtual Manager and the ZertoApiWrapper](https://github.com/ZertoPublic/ZertoApiWrapper/wiki/Getting-Started-with-Zerto-Virtual-Manager) * [Getting Started with Zerto Analytics and the ZertoApiWrapper](https://github.com/ZertoPublic/ZertoApiWrapper/wiki/Getting-Started-with-Zerto-Analytics) ## Recent Updates From 865ca1dd3923797fc7b7e3c2e7d7e4e9aec37c10 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 7 May 2020 20:21:39 -0400 Subject: [PATCH 386/479] Update Logic to Convert VpgName to VpgIdentifier --- Tests/Public/Get-ZertoEvent.Tests.ps1 | 2 +- ZertoApiWrapper/Public/Get-ZertoEvent.ps1 | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Tests/Public/Get-ZertoEvent.Tests.ps1 b/Tests/Public/Get-ZertoEvent.Tests.ps1 index b35a69f..5e94a0e 100644 --- a/Tests/Public/Get-ZertoEvent.Tests.ps1 +++ b/Tests/Public/Get-ZertoEvent.Tests.ps1 @@ -12,7 +12,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $ParameterTestCases = @( @{ParameterName = 'startDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } @{ParameterName = 'endDate'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } - @{ParameterName = 'vpgName'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'vpg'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } @{ParameterName = 'vpgIdentifier'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } @{ParameterName = 'eventType'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } @{ParameterName = 'siteName'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } diff --git a/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 b/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 index 8094ac2..3f49004 100644 --- a/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoEvent.ps1 @@ -19,8 +19,8 @@ function Get-ZertoEvent { HelpMessage = "The name of the VPG for which you want to return events." )] [ValidateNotNullOrEmpty()] - [Alias("vpg")] - [string]$vpgName, + [Alias("vpgName")] + [string]$vpg, [Parameter( ParameterSetName = "filter", HelpMessage = "The identifier of the VPG for which you want to return events." @@ -137,6 +137,10 @@ function Get-ZertoEvent { # If a filter is applied, create the filter and return the events that fall in that filter "filter" { $filter = Get-ZertoApiFilter -filterTable $PSBoundParameters + if ($PSBoundParameters.Keys -contains 'vpg') { + $vpgIdentifier = (Get-ZertoVpg -name $vpg).vpgIdentifier + $filter = $filter.replace("vpg=$vpg", "vpg=$vpgIdentifier") + } $uri = "{0}{1}" -f $baseUri, $filter $returnObject = Invoke-ZertoRestRequest -uri $uri } From 26cfb832a4c6119770821286a1d9bc869ea3bb68 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 7 May 2020 20:49:16 -0400 Subject: [PATCH 387/479] Update CHANGELOG.md --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f4d7d3..472e294 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Zerto Virtual Manager + +#### Fixed + +* Updated `Get-ZertoEvent` to translate a vpg name parameter to a vpgIdentifier string per the API documentation + ## [1.4.1] ### General From fbe3f4d031dfbc40ac75fe643db623cb29a5a00b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 9 May 2020 10:36:37 -0400 Subject: [PATCH 388/479] Add Get-ZertoEvent Fix --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 472e294..35dc3ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project is transitioning to [Semantic Versioning](https://semver.org/sp #### Fixed -* Updated `Get-ZertoEvent` to translate a vpg name parameter to a vpgIdentifier string per the API documentation +* Updated `Get-ZertoEvent` to translate a vpg name parameter to a vpgIdentifier per the API documentation ## [1.4.1] From b33b07b524068741fedcfe876ea6db4dbd4aba00 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 9 May 2020 12:19:13 -0400 Subject: [PATCH 389/479] Set Explicit Reverse\Keep Options --- ZertoApiWrapper/Public/Invoke-ZertoMoveCommit.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ZertoApiWrapper/Public/Invoke-ZertoMoveCommit.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoMoveCommit.ps1 index 39327c8..8841394 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoMoveCommit.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoMoveCommit.ps1 @@ -23,8 +23,10 @@ function Invoke-ZertoMoveCommit { $body = @{ } if ($reverseProtection) { $body["ReverseProtection"] = $true + $body["KeepSourceVms"] = $false } elseif ($keepSourceVms) { $body["KeepSourceVms"] = $true + $body["ReverseProtection"] = $false } } From ba0b12e83c84fc2008e1bb224b8f85e5fc09e869 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 9 May 2020 16:04:27 -0400 Subject: [PATCH 390/479] Add accepted values --- docs/Get-ZertoEvent.md | 3 +++ docs/Get-ZertoProtectedVm.md | 1 + docs/Get-ZertoRecoveryReport.md | 1 + docs/Get-ZertoTask.md | 1 + docs/Get-ZertoVpg.md | 1 + 5 files changed, 7 insertions(+) diff --git a/docs/Get-ZertoEvent.md b/docs/Get-ZertoEvent.md index 53d4589..d9e842e 100644 --- a/docs/Get-ZertoEvent.md +++ b/docs/Get-ZertoEvent.md @@ -112,6 +112,7 @@ The type of event to return. This filter behaves in the same way as the eventCat Type: String Parameter Sets: filter Aliases: +Accepted values: All, Events, Alerts Required: False Position: Named @@ -159,6 +160,7 @@ The type of entity for which you wish to return results. Possible Values are: 'V Type: String Parameter Sets: filter Aliases: +Accepted values: VPG, VRA, Unknown, Site Required: False Position: Named @@ -174,6 +176,7 @@ This filter behaves in the same way as the category filter. If both category and Type: String Parameter Sets: filter Aliases: +Accepted values: All, Events, Alerts Required: False Position: Named diff --git a/docs/Get-ZertoProtectedVm.md b/docs/Get-ZertoProtectedVm.md index ec1172a..728b118 100644 --- a/docs/Get-ZertoProtectedVm.md +++ b/docs/Get-ZertoProtectedVm.md @@ -88,6 +88,7 @@ The priority specified for the VPG. Possible values are: 'Low', 'Medium', or 'Hi Type: String Parameter Sets: filter Aliases: +Accepted values: Low, Medium, High Required: False Position: Named diff --git a/docs/Get-ZertoRecoveryReport.md b/docs/Get-ZertoRecoveryReport.md index d316621..2c6785c 100644 --- a/docs/Get-ZertoRecoveryReport.md +++ b/docs/Get-ZertoRecoveryReport.md @@ -102,6 +102,7 @@ Possible values are: 'Failover', 'Failover Test', or 'Move' Type: String Parameter Sets: filter Aliases: +Accepted values: Failover, Failover Test, Move Required: False Position: Named diff --git a/docs/Get-ZertoTask.md b/docs/Get-ZertoTask.md index e8e1410..a37e4f7 100644 --- a/docs/Get-ZertoTask.md +++ b/docs/Get-ZertoTask.md @@ -129,6 +129,7 @@ The status of the task. Possible values are: 'InProgress', 'Paused', 'Failed', ' Type: String Parameter Sets: filter Aliases: +Accepted values: InProgress, Paused, Failed, Completed, Cancelling Required: False Position: Named diff --git a/docs/Get-ZertoVpg.md b/docs/Get-ZertoVpg.md index f453476..08a0e85 100644 --- a/docs/Get-ZertoVpg.md +++ b/docs/Get-ZertoVpg.md @@ -271,6 +271,7 @@ The VPG priority. Possible values are: 'Low', 'Medium', 'High' Type: String Parameter Sets: filter Aliases: +Accepted values: Low, Medium, High Required: False Position: Named From 1e678214b152d6ce7be4df019cc268c1619cc550 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 9 May 2020 16:05:32 -0400 Subject: [PATCH 391/479] Update for explicit reverse and keep params --- .../Public/Invoke-ZertoMoveCommit.ps1 | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/ZertoApiWrapper/Public/Invoke-ZertoMoveCommit.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoMoveCommit.ps1 index 8841394..81f5f79 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoMoveCommit.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoMoveCommit.ps1 @@ -1,6 +1,6 @@ <# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Invoke-ZertoMoveCommit { - [cmdletbinding(SupportsShouldProcess = $true)] + [cmdletbinding(SupportsShouldProcess = $true, DefaultParameterSetName = "Main")] param( [Parameter( HelpMessage = "Name(s) of the VPG(s) to commit.", @@ -9,11 +9,16 @@ function Invoke-ZertoMoveCommit { [ValidateNotNullOrEmpty()] [string[]]$vpgName, [Parameter( - HelpMessage = "Set this to True to reverse protect the VPG(s) to the source site. If not set, will use selection made during move initiation. True or False" + HelpMessage = "Use this switch to reverse protect the VPG(s) to the source site. If neither 'ReverseProtction' nor 'KeepSourceVms' switch is specified, the commit process will use selection made during move initiation.", + ParameterSetName = 'ReverseProtect', + Mandatory + )] [switch]$reverseProtection, [Parameter( - HelpMessage = "Use this switch to keep the source VMs. If not set, they will be destroyed." + HelpMessage = "Use this switch to keep the source VMs at the source site. If neither 'ReverseProtction' nor 'KeepSourceVms' switch is specified, the commit process will use selection made during move initiation.", + ParameterSetName = 'KeepSource', + Mandatory )] [switch]$keepSourceVms ) @@ -21,12 +26,16 @@ function Invoke-ZertoMoveCommit { begin { $baseUri = "vpgs" $body = @{ } - if ($reverseProtection) { - $body["ReverseProtection"] = $true - $body["KeepSourceVms"] = $false - } elseif ($keepSourceVms) { - $body["KeepSourceVms"] = $true - $body["ReverseProtection"] = $false + Switch ($PSCmdlet.ParameterSetName){ + 'KeepSource' { + $body["KeepSourceVms"] = $true + $body["ReverseProtection"] = $false + } + + 'ReverseProtect' { + $body["ReverseProtection"] = $true + $body["KeepSourceVms"] = $false + } } } From 804a60be774f82f72ade38b1e6bf9fb75e7b595e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 9 May 2020 16:05:54 -0400 Subject: [PATCH 392/479] Update for explicit switches --- docs/Invoke-ZertoMoveCommit.md | 45 +++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/docs/Invoke-ZertoMoveCommit.md b/docs/Invoke-ZertoMoveCommit.md index 08c6e92..c298a0f 100644 --- a/docs/Invoke-ZertoMoveCommit.md +++ b/docs/Invoke-ZertoMoveCommit.md @@ -12,9 +12,19 @@ Commit a VPG currently undergoing a move operation. ## SYNTAX +### Main (Default) ``` -Invoke-ZertoMoveCommit [-vpgName] [-reverseProtection] [-keepSourceVms] [-WhatIf] [-Confirm] - [] +Invoke-ZertoMoveCommit -vpgName [-WhatIf] [-Confirm] [] +``` + +### ReverseProtect +``` +Invoke-ZertoMoveCommit -vpgName [-reverseProtection] [-WhatIf] [-Confirm] [] +``` + +### KeepSource +``` +Invoke-ZertoMoveCommit -vpgName [-keepSourceVms] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -27,20 +37,33 @@ Commit a VPG currently undergoing a move operation. PS C:\> Invoke-ZertoMoveCommit -vpgName "MyVpg" ``` -Commit VPG "MyVpg" after a move has been started. +Commit VPG "MyVpg" after a move operation has been completed. This commit process with use the `-KeepSourceVms` or `-ReverseProtection` selection made during the move initation. + +### Example 2 +```powershell +PS C:\> Invoke-ZertoMoveCommit -vpgName "MyVpg" -keepSourceVms +``` + +Commit VPG "MyVpg" after a move operation has been completed specifying to keep the vms at the source location and NOT reverse protection. This commit process will overrule any reverse protection or keep source vms selection made during the move initiation. + +### Example 3 +```powershell +PS C:\> Invoke-ZertoMoveCommit -vpgName "MyVpg" -reverseProtection +``` + +Commit VPG "MyVpg" after a move operation has been completed specifying to reverse protection of the VMs back to the source location. The VMs at the source location will be removed from inventory at the source location and the disks will be used as pre-seed volumes. This commit process will overrule any reverse protection or keep source vms selection made during the move initiation. ## PARAMETERS ### -keepSourceVms -Use this switch to keep the source VMs. -If not set, they will be destroyed. +"Use this switch to keep the source VMs at the source site. If neither 'ReverseProtction' nor 'KeepSourceVms' switch is specified, the commit process will use selection made during move initiation." ```yaml Type: SwitchParameter -Parameter Sets: (All) +Parameter Sets: KeepSource Aliases: -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False @@ -48,14 +71,14 @@ Accept wildcard characters: False ``` ### -reverseProtection -Set this to True to reverse protect the VPG(s) to the source site. If not set, will use selection made during move initiation. True or False +"Use this switch to reverse protect the VPG(s) to the source site. If neither 'ReverseProtction' nor 'KeepSourceVms' switch is specified, the commit process will use selection made during move initiation." ```yaml Type: SwitchParameter -Parameter Sets: (All) +Parameter Sets: ReverseProtect Aliases: -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False @@ -71,7 +94,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False From bc570e9005ffeffdb11d8b9664c6aaf25a7bc940 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sat, 9 May 2020 20:52:55 -0400 Subject: [PATCH 393/479] Update Changlog with MoveCommit Changes --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35dc3ca..0abe48e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,8 @@ and this project is transitioning to [Semantic Versioning](https://semver.org/sp #### Fixed -* Updated `Get-ZertoEvent` to translate a vpg name parameter to a vpgIdentifier per the API documentation +* Updated `Get-ZertoEvent` to translate a vpg name parameter to a vpgIdentifier per the API documentation +* Updated `Invoke-ZertoMoveCommit` to ensure that when one of the parameter switches is defined, all required parameters are sent to avoid conflicts with parameters passed with the `Invoke-ZertoMove` command. ## [1.4.1] From 8f735bee6249550b639c5bcb28bda7737406eb82 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 17 May 2020 11:04:41 -0400 Subject: [PATCH 394/479] Correct body creation method --- ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 b/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 index ae95a22..be8f999 100644 --- a/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 +++ b/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 @@ -27,18 +27,25 @@ function Start-ZertoCloneVpg { ) begin { + + } + + process { $baseUri = "vpgs" $vpgInfo = Get-ZertoVpg -name $vpgName if ( -not $vpgInfo ) { Write-Error "VPG: $vpgName could not be found. Please check the name and try again." } $vpgIdentifier = $vpgInfo.vpgIdentifier + $body = @{ } if ( $PSBoundParameters.ContainsKey('datastoreName') ) { $recoverysiteIdentifier = $vpgInfo.recoverysite.identifier $recoverySiteDatastores = Get-ZertoVirtualizationSite -siteIdentifier $recoverysiteIdentifier -datastores $datastoreIdentifier = $($recoverySiteDatastores | Where-Object { $_.datastoreName -like $datastoreName }).DatastoreIdentifier if ( -not $datastoreIdentifier ) { Write-Error "Datastore: $datastoreName is not a valid datastore. Please check the name and try again." -ErrorAction Stop + } else { + $body['DatastoreIdentifier'] = $datastoreIdentifier } } if ( $PSBoundParameters.ContainsKey('vmName') ) { From 77b7e1c376c36726e4c8195becc499adfc667be8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 17 May 2020 11:05:15 -0400 Subject: [PATCH 395/479] Fix Body Creation Method --- .../Public/Start-ZertoCloneVpg.ps1 | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 b/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 index be8f999..17f4919 100644 --- a/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 +++ b/ZertoApiWrapper/Public/Start-ZertoCloneVpg.ps1 @@ -62,32 +62,20 @@ function Start-ZertoCloneVpg { } } $body['VmIdentifiers'] = $vmIdentifiers - if ($checkpointIdentifier) { - $body['CheckpointIdentifier'] = $checkpointIdentifier - } } - } - - process { - $uri = "{0}/{1}/CloneStart" -f $baseUri, $vpgIdentifier - $body = [ordered]@{ } if ( $PSBoundParameters.ContainsKey('checkpointIdentifier') ) { $body['checkpointId'] = $checkpointIdentifier } - if ( $datastoreIdentifier ) { - $body['DatastoreIdentifier'] = $datastoreIdentifier - } - if ( $vmIdentifiers ) { - $body['VmIdentifiers'] = $vmIdentifiers - } Write-Verbose $body + $uri = "{0}/{1}/CloneStart" -f $baseUri, $vpgIdentifier if ($PSCmdlet.ShouldProcess("Clone Vpg")) { Invoke-ZertoRestRequest -uri $uri -body $($body | ConvertTo-Json) -method "POST" + Write-Verbose "Call Submitted to $uri" + Write-Verbose "With the following information: $($body | ConvertTo-Json)" } } end { - Write-Verbose "Call Submitted to $uri" - Write-Verbose "With the following information: $($body | ConvertTo-Json)" + } } From cccd45b7fddfc2d26798945094770c73fee40566 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 17 May 2020 11:07:31 -0400 Subject: [PATCH 396/479] Update ChangeLog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0abe48e..06498e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project is transitioning to [Semantic Versioning](https://semver.org/sp * Updated `Get-ZertoEvent` to translate a vpg name parameter to a vpgIdentifier per the API documentation * Updated `Invoke-ZertoMoveCommit` to ensure that when one of the parameter switches is defined, all required parameters are sent to avoid conflicts with parameters passed with the `Invoke-ZertoMove` command. +* Updated `Start-ZertoCloneVpg` to fix an issue where an error would be thrown if an operation specified a subset of VMs to be cloned. ## [1.4.1] From b72099559c45c0c833c63cbdc7b14b31e401596b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 17 May 2020 11:21:56 -0400 Subject: [PATCH 397/479] Bump Version --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 347f583..9df886c 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.4.1 +1.4.2 From f8f0d980d0c9a12288634602af3e62168e097af8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Sun, 17 May 2020 11:22:12 -0400 Subject: [PATCH 398/479] Update Unreleased to Release Number --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06498e1..3b4a119 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [1.4.2] ### Zerto Virtual Manager From cdad0c5e795a0a697a0889bb895327b48033ec38 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 5 Jun 2020 09:43:48 -0400 Subject: [PATCH 399/479] Correct example numbering issue --- docs/Get-ZertoEvent.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Get-ZertoEvent.md b/docs/Get-ZertoEvent.md index d9e842e..50d9273 100644 --- a/docs/Get-ZertoEvent.md +++ b/docs/Get-ZertoEvent.md @@ -66,7 +66,7 @@ PS C:\> Get-ZertoEvent -eventId "Need an eventID" Returns information for each -eventID specified. -### Example 1 +### Example 3 ```powershell PS C:\> Get-ZertoEvent -startDate "2019-01-01" -endDate "2019-01-07" -vpg "My Vpg" ``` From 1e84f5aea0a7b28045776dad8d64483d94aee0ae Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 9 Jun 2020 15:21:11 -0400 Subject: [PATCH 400/479] Add Username Example added example with username filter --- docs/Get-ZertoEvent.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/Get-ZertoEvent.md b/docs/Get-ZertoEvent.md index 50d9273..cf6683b 100644 --- a/docs/Get-ZertoEvent.md +++ b/docs/Get-ZertoEvent.md @@ -73,6 +73,13 @@ PS C:\> Get-ZertoEvent -startDate "2019-01-01" -endDate "2019-01-07" -vpg "My Vp Returns all events between Jan. 01, 2019 and Jan. 07, 2019 (inclusive) for the vpg "My Vpg" +### Example 4 +```powershell +PS C:\> Get-ZertoEvent -userName "Domain.tld\MyUser +``` + +Returns all events associated with the username passed into the command. + ## PARAMETERS ### -alertIdentifier From 73540faeb90e1461f3e4d489b1e415f2bbf890f0 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 9 Jun 2020 22:33:48 -0400 Subject: [PATCH 401/479] Update Build Paths --- ZertoApiWrapper.build.ps1 | 60 +++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 853d110..cc0b33f 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -1,23 +1,24 @@ #Requires -Modules 'InvokeBuild' $version = "{0}" -f $(Get-Content .\version.txt) +$moduleOutPath = "{0}\temp\{1}\ZertoApiWrapper" -f $BuildRoot, $version #Define the default task task . CreateArtifacts #Region - Helper Functions -function ImportSourceModule() { +function ImportSourceModule { If (Get-Module -Name ZertoApiWrapper) { Remove-Module -Name ZertoApiWrapper -Force -ErrorAction Stop } Import-Module "$BuildRoot\ZertoApiWrapper\ZertoApiWrapper.psd1" -ErrorAction Stop } -function ImportBuiltModule() { +function ImportBuiltModule { If (Get-Module -Name ZertoApiWrapper) { Remove-Module -Name ZertoApiWrapper -Force -ErrorAction Stop } - Import-Module "$BuildRoot\temp\ZertoApiWrapper.psd1" -ErrorAction Stop + Import-Module ("{0}\ZertoApiWrapper.psd1" -f $moduleOutPath) -ErrorAction Stop } #EndRegion @@ -65,7 +66,7 @@ task AnalyzeSourceFiles CheckPSScriptAnalyzerInstalled, { task AnalyzeBuiltFiles CheckPSScriptAnalyzerInstalled, CreatePsm1ForRelease, { $scriptAnalyzerParams = @{ - Path = "$BuildRoot\temp\" + Path = $moduleOutPath Severity = @('Error', 'Warning') Recurse = $true Verbose = $false @@ -82,10 +83,10 @@ task AnalyzeBuiltFiles CheckPSScriptAnalyzerInstalled, CreatePsm1ForRelease, { #Region - Clean Operations task CleanTemp { - if (-not $(Test-Path "$BuildRoot\temp")) { - New-Item -Path $BuildRoot -Name "temp" -ItemType "Directory" + if (-not $(Test-Path $moduleOutPath)) { + New-Item -Path $moduleOutPath -ItemType "Directory" } - Remove-Item -Recurse -Path "$BuildRoot\temp\*" + Remove-Item -Recurse -Path ("{0}\*" -f $moduleOutPath) } task CleanPublish { @@ -116,7 +117,7 @@ task BuiltFileTests CreatePsm1ForRelease, CheckPesterInstalled, { #Region - Build Help System $buildMamlParams = @{ Inputs = { Get-ChildItem docs\*.md } - Outputs = "$BuildRoot\temp\en-us\ZertoApiWrapper-help.xml" + Outputs = "{0}\en-us\ZertoApiWrapper-help.xml" -f $moduleOutPath } task BuildMamlHelp CheckPlatyPSInstalled, { @@ -126,8 +127,8 @@ task BuildMamlHelp CheckPlatyPSInstalled, { platyPS\New-ExternalHelp .\docs -Force -OutputPath $buildMamlParams.Outputs } -task UpdateMarkdownHelp CheckPlatyPSInstalled, { - ImportSourceModule +task UpdateMarkdownHelp quickBuild, CheckPlatyPSInstalled, { + ImportBuiltModule Update-MarkdownHelpModule -Path docs -AlphabeticParamsOrder } #EndRegion @@ -138,7 +139,7 @@ task CreatePsd1ForRelease CleanTemp, { $releaseNotes = "Please review the [Release Notes](https://github.com/ZertoPublic/ZertoApiWrapper/releases/tag/{0}) on GitHub." -f $version $ManifestParams = @{ - Path = "$BuildRoot\temp\ZertoApiWrapper.psd1" + Path = "{0}\ZertoApiWrapper.psd1" -f $moduleOutPath RootModule = 'ZertoApiWrapper.psm1' ModuleVersion = $version GUID = '4c0b9e17-141b-4dd5-8549-fb21cccaa325' @@ -161,25 +162,25 @@ task CreatePsd1ForRelease CleanTemp, { task CreatePsm1ForRelease CreatePsd1ForRelease, { $emptyLine = "" - $psm1Path = "$BuildRoot\temp\ZertoApiWrapper.psm1" + $psm1Path = "{0}\ZertoApiWrapper.psm1" -f $moduleOutPath $lines = '#------------------------------------------------------------#' $Private = @( Get-ChildItem -Path $BuildRoot\ZertoApiWrapper\Private\*.ps1 -ErrorAction Stop ) $Public = @( Get-ChildItem -Path $BuildRoot\ZertoApiWrapper\Public\*.ps1 -ErrorAction Stop ) - Add-Content -Path $psm1Path -Value $lines - Add-Content -Path $psm1Path -Value "#---------------------Private Functions----------------------#" - Add-Content -Path $psm1Path -Value $lines - Add-Content -Path $psm1Path -Value $emptyLine + Add-Content -Path $psm1Path -Value $lines -Encoding 'utf8' + Add-Content -Path $psm1Path -Value "#---------------------Private Functions----------------------#" -Encoding 'utf8' + Add-Content -Path $psm1Path -Value $lines -Encoding 'utf8' + Add-Content -Path $psm1Path -Value $emptyLine -Encoding 'utf8' foreach ($file in $private) { - Add-Content -Path $psm1Path -Value $(Get-Content -Path $file.Fullname -Raw) - Add-Content -Path $psm1Path -Value $emptyLine + Add-Content -Path $psm1Path -Value $(Get-Content -Path $file.Fullname -Raw) -Encoding 'utf8' + Add-Content -Path $psm1Path -Value $emptyLine -Encoding 'utf8' } - Add-Content -Path $psm1Path -Value $lines - Add-Content -Path $psm1Path -Value "#----------------------Public Functions----------------------#" - Add-Content -Path $psm1Path -Value $lines - Add-Content -Path $psm1Path -Value $emptyLine + Add-Content -Path $psm1Path -Value $lines -Encoding 'utf8' + Add-Content -Path $psm1Path -Value "#----------------------Public Functions----------------------#" -Encoding 'utf8' + Add-Content -Path $psm1Path -Value $lines -Encoding 'utf8' + Add-Content -Path $psm1Path -Value $emptyLine -Encoding 'utf8' foreach ($file in $public) { - Add-Content -Path $psm1Path -Value $(Get-Content -Path $file.Fullname -Raw) - Add-Content -Path $psm1Path -Value $emptyLine + Add-Content -Path $psm1Path -Value $(Get-Content -Path $file.Fullname -Raw) -Encoding 'utf8' + Add-Content -Path $psm1Path -Value $emptyLine -Encoding 'utf8' } # Add-Content -Path $psm1Path -Value $emptyLine # Add-Content -Path $psm1Path -Value "Export-ModuleMember -Function $exportString" @@ -188,7 +189,7 @@ task CreatePsm1ForRelease CreatePsd1ForRelease, { #Region - Artifacts \ Publish # Full Build Process - No Publishing -task CreateArtifacts CleanPublish, CleanTemp, AnalyzeSourceFiles, SourceFileTests, AnalyzeBuiltFiles, BuiltFileTests, BuildMamlHelp, { +task CreateArtifacts CleanPublish, CleanTemp, AnalyzeBuiltFiles, BuiltFileTests, BuildMamlHelp, { if (-not $(Test-Path "$BuildRoot\publish")) { New-Item -Path $BuildRoot -Name "publish" -ItemType Directory } @@ -201,3 +202,12 @@ task CreateArtifacts CleanPublish, CleanTemp, AnalyzeSourceFiles, SourceFileTest Copy-Item "$BuildRoot\build.ps1" "$BuildRoot\publish\build.ps1" } #EndRegion + +task build CleanPublish, CleanTemp, CreatePsm1ForRelease, AnalyzeBuiltFiles, BuiltFileTests, CreateArtifacts +task quickBuild CleanPublish, CleanTemp, CreatePsm1ForRelease, AnalyzeBuiltFiles, { + Get-Module -Name ZertoApiWrapper | Remove-Module -Force + ImportBuiltModule +} +task release quickBuild, { + Publish-Module -Path $moduleOutPath -NuGetApiKey "1234" -WhatIf +} From 32403ec3e3abe29204327d9d8cf5068df5394c72 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 10 Jun 2020 09:41:37 -0400 Subject: [PATCH 402/479] Update build script with params --- build.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build.ps1 b/build.ps1 index 9ce90cf..2f2c873 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,3 +1,5 @@ +param([validateSet("build", "release")]$operation = "build") + # Bootstrap the environment $null = Get-PackageProvider -Name NuGet -ForceBootstrap @@ -11,6 +13,7 @@ Invoke-PSDepend ` -Force ` -Import ` -Install ` - -Tags 'Bootstrap' + -Tags 'Bootstrap' ` + -ErrorAction Continue -Invoke-Build . +Invoke-Build $operation From 925ecaf2247a049e85f52bf514be486c0ed9de1c Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 10 Jun 2020 09:42:17 -0400 Subject: [PATCH 403/479] Update default build operation --- ZertoApiWrapper.build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index cc0b33f..9e2d883 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -4,7 +4,7 @@ $version = "{0}" -f $(Get-Content .\version.txt) $moduleOutPath = "{0}\temp\{1}\ZertoApiWrapper" -f $BuildRoot, $version #Define the default task -task . CreateArtifacts +task . build #Region - Helper Functions function ImportSourceModule { From e90d2a23cc52f6ccdd0e978c5c91697aaeb2f9d7 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 10 Jun 2020 09:42:41 -0400 Subject: [PATCH 404/479] Update tests to only show failed --- ZertoApiWrapper.build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 9e2d883..788ed57 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -108,7 +108,7 @@ task SourceFileTests CheckPesterInstalled, { task BuiltFileTests CreatePsm1ForRelease, CheckPesterInstalled, { ImportBuiltModule $testResultsFile = "$BuildRoot\Tests\BuiltTestResults.xml" - $script:results = Invoke-Pester -Script "$BuildRoot" -Tag Unit -OutputFile $testResultsFile -PassThru -Show Fails + $script:results = Invoke-Pester -Script "$BuildRoot" -Tag Unit -OutputFile $testResultsFile -PassThru -Show Failed $FailureMessage = '{0} Unit test(s) failed. Aborting build' -f $results.FailedCount Assert ($results.FailedCount -eq 0) $FailureMessage } From c7c3428dd5cb0b48ccbe70e045d48e9cd465aa20 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 10 Jun 2020 09:43:03 -0400 Subject: [PATCH 405/479] Update release task to use full build process --- ZertoApiWrapper.build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 788ed57..8069b4c 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -208,6 +208,6 @@ task quickBuild CleanPublish, CleanTemp, CreatePsm1ForRelease, AnalyzeBuiltFiles Get-Module -Name ZertoApiWrapper | Remove-Module -Force ImportBuiltModule } -task release quickBuild, { +task release build, { Publish-Module -Path $moduleOutPath -NuGetApiKey "1234" -WhatIf } From 906d35186fd6569920bc1d7dd560f953305ae995 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 10 Jun 2020 09:43:32 -0400 Subject: [PATCH 406/479] Update Required Module Versions --- ZertoApiWrapper.Depend.psd1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ZertoApiWrapper.Depend.psd1 b/ZertoApiWrapper.Depend.psd1 index 820e1f4..e3f8356 100644 --- a/ZertoApiWrapper.Depend.psd1 +++ b/ZertoApiWrapper.Depend.psd1 @@ -7,7 +7,7 @@ SkipPublisherCheck = $true } Target = 'CurrentUser' - Version = '5.5.11' + Version = '5.6.0' Tags = 'Bootstrap' } @@ -31,7 +31,7 @@ SkipPublisherCheck = $true } Target = 'CurrentUser' - Version = '1.18.3' + Version = '1.19.0' Tags = 'Bootstrap' } From aab22cf266e576168e60ccaea1ab155962061c29 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 10 Jun 2020 09:53:01 -0400 Subject: [PATCH 407/479] Add Branch to Auto-Build --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e5c7180..6cb32e3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -11,6 +11,7 @@ trigger: include: - master - PowerShellBackPort + - Refactor-Build # Trigger CI on pull requests to master and develop branches pr: From a55b0cd46734e4f220a7ec62bd0ac9abe9f27221 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 10 Jun 2020 09:58:32 -0400 Subject: [PATCH 408/479] Remove SourceFileTests publish --- azure-pipelines.yml | 149 ++++++++++++++++++-------------------------- 1 file changed, 60 insertions(+), 89 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6cb32e3..3a21d03 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -25,26 +25,18 @@ jobs: pool: vmImage: windows-latest steps: - # Run build.ps1 script in PowerShell Core - - powershell: | - .\build.ps1 -Verbose - displayName: 'Build and Test' - # Upload test results to Azure Pipeline - - task: PublishTestResults@2 - inputs: - testRunner: 'NUnit' - testResultsFiles: '**/SourceTestResults.xml' - testRunTitle: 'PS_Win2016_Source' - displayName: 'Publish Test Results' - condition: always() - - task: PublishTestResults@2 - inputs: - testRunner: 'NUnit' - testResultsFiles: '**/BuiltTestResults.xml' - testRunTitle: 'PS_Win2016_Built' - displayName: 'Publish Test Results' - condition: always() - + # Run build.ps1 script in PowerShell Core + - powershell: | + .\build.ps1 -Verbose + displayName: "Build and Test" + # Upload test results to Azure Pipeline + - task: PublishTestResults@2 + inputs: + testRunner: "NUnit" + testResultsFiles: "**/BuiltTestResults.xml" + testRunTitle: "PS_Win2016_Built" + displayName: "Publish Test Results" + condition: always() # Windows PowerShell Core Build Job - job: Build_PSCore_Windows @@ -53,25 +45,18 @@ jobs: pool: vmImage: windows-latest steps: - # Run build.ps1 script in PowerShell Core - - pwsh: | - .\build.ps1 -Verbose - displayName: 'Build and Test' - # Upload test results to Azure Pipeline - - task: PublishTestResults@2 - inputs: - testRunner: 'NUnit' - testResultsFiles: '**/SourceTestResults.xml' - testRunTitle: 'PSCore_Win2016_Source' - displayName: 'Publish Test Results' - condition: always() - - task: PublishTestResults@2 - inputs: - testRunner: 'NUnit' - testResultsFiles: '**/BuiltTestResults.xml' - testRunTitle: 'PSCore_Win2016_Built' - displayName: 'Publish Test Results' - condition: always() + # Run build.ps1 script in PowerShell Core + - pwsh: | + .\build.ps1 -Verbose + displayName: "Build and Test" + # Upload test results to Azure Pipeline + - task: PublishTestResults@2 + inputs: + testRunner: "NUnit" + testResultsFiles: "**/BuiltTestResults.xml" + testRunTitle: "PSCore_Win2016_Built" + displayName: "Publish Test Results" + condition: always() # Linux Build Job - job: Build_PSCore_Ubuntu @@ -80,37 +65,30 @@ jobs: pool: vmImage: ubuntu-latest steps: - # Run build.ps1 script in PowerShell Core - - pwsh: | - .\build.ps1 -verbose - displayName: 'Build and Test' - # Upload test results to Azure Pipeline - - task: PublishTestResults@2 - inputs: - testRunner: 'NUnit' - testResultsFiles: '**/SourceTestResults.xml' - testRunTitle: 'PSCore_Ubuntu_Source' - displayName: 'Publish Test Results' - condition: always() - - task: PublishTestResults@2 - inputs: - testRunner: 'NUnit' - testResultsFiles: '**/BuiltTestResults.xml' - testRunTitle: 'PSCore_Ubuntu_Built' - displayName: 'Publish Test Results' - condition: always() - - task: PublishPipelineArtifact@0 - displayName: 'Publish compiled module Artifact' - inputs: - artifactName: 'ZertoApiWrapper' - targetPath: ./temp - condition: always() - - task: PublishPipelineArtifact@0 - displayName: 'Publish Data' - inputs: - artifactName: 'ReleaseData' - targetPath: ./publish - condition: always() + # Run build.ps1 script in PowerShell Core + - pwsh: | + .\build.ps1 -verbose + displayName: "Build and Test" + # Upload test results to Azure Pipeline + - task: PublishTestResults@2 + inputs: + testRunner: "NUnit" + testResultsFiles: "**/BuiltTestResults.xml" + testRunTitle: "PSCore_Ubuntu_Built" + displayName: "Publish Test Results" + condition: always() + - task: PublishPipelineArtifact@0 + displayName: "Publish compiled module Artifact" + inputs: + artifactName: "ZertoApiWrapper" + targetPath: ./temp + condition: always() + - task: PublishPipelineArtifact@0 + displayName: "Publish Data" + inputs: + artifactName: "ReleaseData" + targetPath: ./publish + condition: always() # MacOS Build Job - job: Build_PSCore_MacOS @@ -119,22 +97,15 @@ jobs: pool: vmImage: macOS-latest steps: - # Run build.ps1 script in PowerShell Core - - pwsh: | - .\build.ps1 -verbose - displayName: 'Build and Test' - # Upload test results to Azure Pipeline - - task: PublishTestResults@2 - inputs: - testRunner: 'NUnit' - testResultsFiles: '**/SourceTestResults.xml' - testRunTitle: 'PSCore_MacOS1013_Source' - displayName: 'Publish Test Results' - condition: always() - - task: PublishTestResults@2 - inputs: - testRunner: 'NUnit' - testResultsFiles: '**/BuiltTestResults.xml' - testRunTitle: 'PSCore_MacOS1013_Built' - displayName: 'Publish Test Results' - condition: always() + # Run build.ps1 script in PowerShell Core + - pwsh: | + .\build.ps1 -verbose + displayName: "Build and Test" + # Upload test results to Azure Pipeline + - task: PublishTestResults@2 + inputs: + testRunner: "NUnit" + testResultsFiles: "**/BuiltTestResults.xml" + testRunTitle: "PSCore_MacOS1013_Built" + displayName: "Publish Test Results" + condition: always() From 9ad9cb7f1e4624ec98b6efeded65f032a8820875 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 10 Jun 2020 12:20:00 -0400 Subject: [PATCH 409/479] Update Build Path for Artifact Utilization --- ZertoApiWrapper.build.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 8069b4c..f41483f 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -1,7 +1,7 @@ #Requires -Modules 'InvokeBuild' $version = "{0}" -f $(Get-Content .\version.txt) -$moduleOutPath = "{0}\temp\{1}\ZertoApiWrapper" -f $BuildRoot, $version +$moduleOutPath = "{0}\temp\ZertoApiWrapper\{1}" -f $BuildRoot, $version #Define the default task task . build @@ -193,7 +193,8 @@ task CreateArtifacts CleanPublish, CleanTemp, AnalyzeBuiltFiles, BuiltFileTests, if (-not $(Test-Path "$BuildRoot\publish")) { New-Item -Path $BuildRoot -Name "publish" -ItemType Directory } - Compress-Archive -Path .\temp\* -DestinationPath .\publish\ZertoApiWrapper.zip + $CompressionPath = Split-Path -Path $moduleOutPath -Parent + Compress-Archive -Path $CompressionPath -DestinationPath .\publish\ZertoApiWrapper.zip #ImportBuiltModule #(Get-Module ZertoApiWrapper).ReleaseNotes | Add-Content .\publish\release-notes.txt #(Get-Module ZertoApiWrapper).Version.ToString() | Add-Content .\publish\release-version.txt From 512d5bbd749bb7fcf1ff623f79c6d87f4d8b87ee Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 10 Jun 2020 15:52:59 -0400 Subject: [PATCH 410/479] Update Publish Location --- ZertoApiWrapper.build.ps1 | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index f41483f..593e376 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -1,7 +1,7 @@ #Requires -Modules 'InvokeBuild' $version = "{0}" -f $(Get-Content .\version.txt) -$moduleOutPath = "{0}\temp\ZertoApiWrapper\{1}" -f $BuildRoot, $version +$moduleOutPath = "{0}\publish\ZertoApiWrapper" -f $BuildRoot #Define the default task task . build @@ -82,17 +82,13 @@ task AnalyzeBuiltFiles CheckPSScriptAnalyzerInstalled, CreatePsm1ForRelease, { #EndRegion #Region - Clean Operations -task CleanTemp { - if (-not $(Test-Path $moduleOutPath)) { - New-Item -Path $moduleOutPath -ItemType "Directory" - } - Remove-Item -Recurse -Path ("{0}\*" -f $moduleOutPath) -} - task CleanPublish { if ($(Test-Path "$BuildRoot\publish")) { Remove-Item -Recurse -Path "$BuildRoot\publish\*" + } else { + New-Item -Path $BuildRoot -Name "publish" -ItemType Directory } + New-Item -Path $moduleOutPath -ItemType "Directory" } #EndRegion @@ -134,7 +130,7 @@ task UpdateMarkdownHelp quickBuild, CheckPlatyPSInstalled, { #EndRegion #Region - Build Module Files -task CreatePsd1ForRelease CleanTemp, { +task CreatePsd1ForRelease CleanPublish, { $functionsToExport = Get-ChildItem -Path 'ZertoApiWrapper\Public\*.ps1' | ForEach-Object { $_.BaseName } $releaseNotes = "Please review the [Release Notes](https://github.com/ZertoPublic/ZertoApiWrapper/releases/tag/{0}) on GitHub." -f $version @@ -182,30 +178,18 @@ task CreatePsm1ForRelease CreatePsd1ForRelease, { Add-Content -Path $psm1Path -Value $(Get-Content -Path $file.Fullname -Raw) -Encoding 'utf8' Add-Content -Path $psm1Path -Value $emptyLine -Encoding 'utf8' } - # Add-Content -Path $psm1Path -Value $emptyLine - # Add-Content -Path $psm1Path -Value "Export-ModuleMember -Function $exportString" } #EndRegion #Region - Artifacts \ Publish # Full Build Process - No Publishing -task CreateArtifacts CleanPublish, CleanTemp, AnalyzeBuiltFiles, BuiltFileTests, BuildMamlHelp, { - if (-not $(Test-Path "$BuildRoot\publish")) { - New-Item -Path $BuildRoot -Name "publish" -ItemType Directory - } - $CompressionPath = Split-Path -Path $moduleOutPath -Parent - Compress-Archive -Path $CompressionPath -DestinationPath .\publish\ZertoApiWrapper.zip - #ImportBuiltModule - #(Get-Module ZertoApiWrapper).ReleaseNotes | Add-Content .\publish\release-notes.txt - #(Get-Module ZertoApiWrapper).Version.ToString() | Add-Content .\publish\release-version.txt - Copy-Item "$BuildRoot\ZertoApiWrapper.build.ps1" "$BuildRoot\publish\ZertoApiWrapper.build.ps1" - Copy-Item "$BuildRoot\ZertoApiWrapper.Depend.psd1" "$BuildRoot\publish\ZertoApiWrapper.Depend.psd1" - Copy-Item "$BuildRoot\build.ps1" "$BuildRoot\publish\build.ps1" +task CreateArtifacts CleanPublish, AnalyzeBuiltFiles, BuiltFileTests, BuildMamlHelp, { + Compress-Archive -Path $moduleOutPath -DestinationPath .\publish\ZertoApiWrapper.zip } #EndRegion -task build CleanPublish, CleanTemp, CreatePsm1ForRelease, AnalyzeBuiltFiles, BuiltFileTests, CreateArtifacts -task quickBuild CleanPublish, CleanTemp, CreatePsm1ForRelease, AnalyzeBuiltFiles, { +task build CleanPublish, CreatePsm1ForRelease, AnalyzeBuiltFiles, BuiltFileTests, CreateArtifacts +task quickBuild CleanPublish, CreatePsm1ForRelease, AnalyzeBuiltFiles, { Get-Module -Name ZertoApiWrapper | Remove-Module -Force ImportBuiltModule } From d3acba3967fd0476ddcbf7e4853beae709a25ee5 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 10 Jun 2020 15:54:59 -0400 Subject: [PATCH 411/479] Remove Unused Publish Task --- azure-pipelines.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3a21d03..ceb0914 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -77,12 +77,6 @@ jobs: testRunTitle: "PSCore_Ubuntu_Built" displayName: "Publish Test Results" condition: always() - - task: PublishPipelineArtifact@0 - displayName: "Publish compiled module Artifact" - inputs: - artifactName: "ZertoApiWrapper" - targetPath: ./temp - condition: always() - task: PublishPipelineArtifact@0 displayName: "Publish Data" inputs: From de1a85cecd63777da453350df3a86e5de7eba6e6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 10 Jun 2020 19:30:50 -0400 Subject: [PATCH 412/479] Add ReleaseNotes.md File Creation --- ZertoApiWrapper.build.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ZertoApiWrapper.build.ps1 b/ZertoApiWrapper.build.ps1 index 593e376..08efbac 100644 --- a/ZertoApiWrapper.build.ps1 +++ b/ZertoApiWrapper.build.ps1 @@ -185,6 +185,12 @@ task CreatePsm1ForRelease CreatePsd1ForRelease, { # Full Build Process - No Publishing task CreateArtifacts CleanPublish, AnalyzeBuiltFiles, BuiltFileTests, BuildMamlHelp, { Compress-Archive -Path $moduleOutPath -DestinationPath .\publish\ZertoApiWrapper.zip + $MyMatches = Select-String -Path "$BuildRoot\CHANGELOG.md" "^##\s\[" + $data = Get-Content "$BuildRoot\CHANGELOG.md" + $range = ($MyMatches[0].LineNumber - 1)..($MyMatches[1].LineNumber - 3) + foreach ($i in $range) { + Add-Content -Path "$BuildRoot\publish\ReleaseNotes.md" -Value ($data[$i]).replace("## ", "# ") -Encoding utf8 + } } #EndRegion From f81a22ca80ab094094f0dfef0682b1aaeb477e94 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 11 Jun 2020 09:24:02 -0400 Subject: [PATCH 413/479] Update Artifact Publish task to latest --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ceb0914..b20a9a2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -77,7 +77,7 @@ jobs: testRunTitle: "PSCore_Ubuntu_Built" displayName: "Publish Test Results" condition: always() - - task: PublishPipelineArtifact@0 + - task: PublishPipelineArtifact@1 displayName: "Publish Data" inputs: artifactName: "ReleaseData" From e021a7bab0f745dc6af0c2e86758618e23bfb902 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 18 Jun 2020 13:20:10 -0400 Subject: [PATCH 414/479] Added Time Example Struggled to find a time example. Added one for future use. --- docs/Get-ZertoEvent.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/Get-ZertoEvent.md b/docs/Get-ZertoEvent.md index cf6683b..25532cb 100644 --- a/docs/Get-ZertoEvent.md +++ b/docs/Get-ZertoEvent.md @@ -80,6 +80,13 @@ PS C:\> Get-ZertoEvent -userName "Domain.tld\MyUser Returns all events associated with the username passed into the command. +### Example 5 +```powershell +PS C:\> Get-ZertoEvent -startDate "2019-01-01T12:30:00" -endDate "2019-01-01T13:30:00" -vpg "My Vpg" +``` + +Returns all events between Jan. 01, 2019 12:30 PM and Jan. 01, 2019 1:30 PM (inclusive) for the vpg "My Vpg" + ## PARAMETERS ### -alertIdentifier From 3000a2b0139dd8d08cf48e07606ebba259f44404 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 8 Jun 2020 12:50:29 -0400 Subject: [PATCH 415/479] Initial auto reconnect --- .../Public/Connect-ZertoServer.ps1 | 10 +- .../Public/Invoke-ZertoRestRequest.ps1 | 100 +++++++++--------- 2 files changed, 60 insertions(+), 50 deletions(-) diff --git a/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 b/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 index f9f33ac..9a8c649 100644 --- a/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 +++ b/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 @@ -22,7 +22,11 @@ function Connect-ZertoServer { HelpMessage = "Valid credentials to connect to the Zerto Management Server" )] [System.Management.Automation.PSCredential]$credential, - [switch]$returnHeaders + [switch]$returnHeaders, + [Parameter( + HelpMessage = "Use this switch to indicate that you would like the module to take care of auto re-authorization and reconnection to the ZVM should the token expire. This option will cache your PSCredential object to be reused" + )] + [switch]$AutoReconnect ) begin { @@ -38,6 +42,10 @@ function Connect-ZertoServer { "Accept" = "application/json" "zerto-triggered-by" = "PowershellWes" } + Set-Variable -Name Reconnect -Scope Script -Value $AutoReconnect.IsPresent + if ($Script:Reconnect) { + Set-Variable -Name CachedCredential -Scope Script -Value $credential + } } process { diff --git a/ZertoApiWrapper/Public/Invoke-ZertoRestRequest.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoRestRequest.ps1 index 97430ab..93d77e4 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoRestRequest.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoRestRequest.ps1 @@ -41,24 +41,26 @@ function Invoke-ZertoRestRequest { } # If the Headers exist and the Last action was more than 30 minutes ago, Session is Expired - if ( (Test-Path variable:script:zvmHeaders) -and $([datetime]$script:zvmLastAction).addMinutes(30) -lt $(Get-Date) ) { + if ( (Test-Path variable:script:zvmHeaders) -and $([datetime]$script:zvmLastAction).addMinutes(30) -lt $(Get-Date) -and $Script:Reconnect -eq $False ) { Throw "Authorization Token has Expired. Please re-authorize to the Zerto Virtual Manager" - } else { - - # Build the URI to be submitted - $submittedURI = "https://{0}:{1}/{2}/{3}" -f $script:zvmServer, $script:zvmPort, $apiVersion, $uri - try { - # Set the zvmLastAction time and try to submit the REST Request - $script:zvmLastAction = (Get-Date).Ticks - # If running PwSh - Use this Invoke-RestMethod with passed Variables - if ($PSVersionTable.PSVersion.Major -ge 6) { - $apiRequestResults = Invoke-RestMethod -Uri $submittedURI -Headers $script:zvmHeaders -Method $method -Body $body -ContentType $contentType -Credential $credential -SkipCertificateCheck -ResponseHeadersVariable responseHeaders -TimeoutSec 100 - } else { - # If running PowerShell 5.1 --> Do the Following - # Check to see if All Certs are Trusted. If not, Create the Policy to Trust All Certificates - if ([System.Net.ServicePointManager]::CertificatePolicy.GetType().Name -ne "TrustAllCertsPolicy") { - Try { - $type = @' + } elseif (( (Test-Path variable:script:zvmHeaders) -and $([datetime]$script:zvmLastAction).addMinutes(30) -lt $(Get-Date) -and $Script:Reconnect -eq $True )) { + Write-Verbose "Authorization had expired. Attempting Reauthorization." + Connect-ZertoServer -zertoServer $Script:zvmServer -zertoPort $script:zvmPort -credential $Script:CachedCredential + }# else { + # Build the URI to be submitted + $submittedURI = "https://{0}:{1}/{2}/{3}" -f $script:zvmServer, $script:zvmPort, $apiVersion, $uri + try { + # Set the zvmLastAction time and try to submit the REST Request + $script:zvmLastAction = (Get-Date).Ticks + # If running PwSh - Use this Invoke-RestMethod with passed Variables + if ($PSVersionTable.PSVersion.Major -ge 6) { + $apiRequestResults = Invoke-RestMethod -Uri $submittedURI -Headers $script:zvmHeaders -Method $method -Body $body -ContentType $contentType -Credential $credential -SkipCertificateCheck -ResponseHeadersVariable responseHeaders -TimeoutSec 100 + } else { + # If running PowerShell 5.1 --> Do the Following + # Check to see if All Certs are Trusted. If not, Create the Policy to Trust All Certificates + if ([System.Net.ServicePointManager]::CertificatePolicy.GetType().Name -ne "TrustAllCertsPolicy") { + Try { + $type = @' using System.Net; using System.Security.Cryptography.X509Certificates; public class TrustAllCertsPolicy : ICertificatePolicy { @@ -67,42 +69,42 @@ public class TrustAllCertsPolicy : ICertificatePolicy { } } '@ - Add-Type -TypeDefinition $type -ErrorAction SilentlyContinue - } Catch { - if ($error[0].Exception -ne "Cannot add type. The type name 'TrustAllCertsPolicy already exists.") { - Write-Debug $error[0] - } + Add-Type -TypeDefinition $type -ErrorAction SilentlyContinue + } Catch { + if ($error[0].Exception -ne "Cannot add type. The type name 'TrustAllCertsPolicy already exists.") { + Write-Debug $error[0] } - [System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy + } + [System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy - } - # If we are authenticating to the ZVM, Use this block to use Invoke-WebRequest and format the Headers as expected. - if ($uri -eq "session/add" -and $method -eq "POST") { - $apiRequestResults = Invoke-WebRequest -Uri $submittedURI -Headers $script:zvmHeaders -Method $method -Body $body -ContentType $contentType -Credential $credential -TimeoutSec 100 - $responseHeaders = @{ } - $responseHeaders['x-zerto-session'] = @($apiRequestResults.Headers['x-zerto-session']) - } elseif ($method -ne "GET") { - # If the Method is something other than 'GET' use this call with a body parameter - $apiRequestResults = Invoke-RestMethod -Uri $submittedURI -Headers $script:zvmHeaders -Method $method -Body $body -ContentType $contentType -Credential $credential -TimeoutSec 100 - } else { - # If the Method we are calling is 'GET' use this call without a body parameter - $apiRequestResults = Invoke-RestMethod -Uri $submittedURI -Headers $script:zvmHeaders -Method $method -ContentType $contentType -Credential $credential -TimeoutSec 100 - } } - } catch { - # If an error is encountered, Catch - Write-Error -ErrorRecord $_ -ErrorAction $callerErrorActionPreference + # If we are authenticating to the ZVM, Use this block to use Invoke-WebRequest and format the Headers as expected. + if ($uri -eq "session/add" -and $method -eq "POST") { + $apiRequestResults = Invoke-WebRequest -Uri $submittedURI -Headers $script:zvmHeaders -Method $method -Body $body -ContentType $contentType -Credential $credential -TimeoutSec 100 + $responseHeaders = @{ } + $responseHeaders['x-zerto-session'] = @($apiRequestResults.Headers['x-zerto-session']) + } elseif ($method -ne "GET") { + # If the Method is something other than 'GET' use this call with a body parameter + $apiRequestResults = Invoke-RestMethod -Uri $submittedURI -Headers $script:zvmHeaders -Method $method -Body $body -ContentType $contentType -Credential $credential -TimeoutSec 100 + } else { + # If the Method we are calling is 'GET' use this call without a body parameter + $apiRequestResults = Invoke-RestMethod -Uri $submittedURI -Headers $script:zvmHeaders -Method $method -ContentType $contentType -Credential $credential -TimeoutSec 100 + } } + } catch { + # If an error is encountered, Catch + Write-Error -ErrorRecord $_ -ErrorAction $callerErrorActionPreference + } - # If the calling function does not need the headers (Default Action) return the results of the API Call - if (-not $returnHeaders) { - return $apiRequestResults - } else { - #If Headers are required, build a PS Custom Object with the Results and the Headers - $apiRequestAndHeaderResults = New-Object -TypeName psobject - $apiRequestAndHeaderResults | Add-Member -MemberType NoteProperty -Name "apiRequestResults" -Value $apiRequestResults - $apiRequestAndHeaderResults | Add-Member -MemberType NoteProperty -Name "Headers" -Value $responseHeaders - return $apiRequestAndHeaderResults - } + # If the calling function does not need the headers (Default Action) return the results of the API Call + if (-not $returnHeaders) { + return $apiRequestResults + } else { + #If Headers are required, build a PS Custom Object with the Results and the Headers + $apiRequestAndHeaderResults = New-Object -TypeName psobject + $apiRequestAndHeaderResults | Add-Member -MemberType NoteProperty -Name "apiRequestResults" -Value $apiRequestResults + $apiRequestAndHeaderResults | Add-Member -MemberType NoteProperty -Name "Headers" -Value $responseHeaders + return $apiRequestAndHeaderResults + #} } } From 348fcbd28c7d8e16be8ada599e54652bcc1c8949 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 11 Jun 2020 14:19:20 -0400 Subject: [PATCH 416/479] Update Help for AutoReconnect switch --- docs/Connect-ZertoServer.md | 247 ++++++++++++++++++++---------------- 1 file changed, 135 insertions(+), 112 deletions(-) diff --git a/docs/Connect-ZertoServer.md b/docs/Connect-ZertoServer.md index 160ac31..ad36a82 100644 --- a/docs/Connect-ZertoServer.md +++ b/docs/Connect-ZertoServer.md @@ -1,112 +1,135 @@ ---- -external help file: ZertoApiWrapper-help.xml -Module Name: ZertoApiWrapper -online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Connect-ZertoServer.md -schema: 2.0.0 ---- - -# Connect-ZertoServer - -## SYNOPSIS -Establishes a connection to a ZVM. - -## SYNTAX - -``` -Connect-ZertoServer [-zertoServer] [[-zertoPort] ] [-credential] - [-returnHeaders] [] -``` - -## DESCRIPTION -Establishes a connection to a ZVM using credentials provided via a PSCredential Object leveraging the Zerto Session API end point. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Connect-ZertoServer -zertoServer "192.168.1.100" -zertoPort "9669" -credential $credential -``` - -Establishes a connection to ZVM 192.168.1.100 on port 9669 with supplied PSCredential object. - -## PARAMETERS - -### -credential -Valid credentials to connect to the Zerto Management Server - -```yaml -Type: PSCredential -Parameter Sets: (All) -Aliases: - -Required: True -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -returnHeaders -Use this switch to return the headers to a specified variable or to the default output. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -zertoPort -Zerto Virtual Manager management port. -Default value is 9669. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: port - -Required: False -Position: 1 -Default value: "9669" -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -zertoServer -IP address or FQDN of your Zerto Management Server - -```yaml -Type: String -Parameter Sets: (All) -Aliases: server, zvm - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### None -## OUTPUTS - -### System.Object -## NOTES - -## RELATED LINKS - -[Zerto REST API Session End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.068.html%23) - -[PSCredential Documentation](https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.pscredential?view=pscore-6.0.0) - -[Get-Credential Documentation](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/get-credential?view=powershell-6) +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Connect-ZertoServer.md +schema: 2.0.0 +--- + +# Connect-ZertoServer + +## SYNOPSIS +Establishes a connection to a ZVM. + +## SYNTAX + +``` +Connect-ZertoServer [-zertoServer] [[-zertoPort] ] [-credential] + [-returnHeaders] [-AutoReconnect] [] +``` + +## DESCRIPTION +Establishes a connection to a ZVM using credentials provided via a PSCredential Object leveraging the Zerto Session API end point. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Connect-ZertoServer -zertoServer "192.168.1.100" -zertoPort "9669" -credential $credential +``` + +Establishes a connection to ZVM 192.168.1.100 on port 9669 with supplied PSCredential object. + +### Example 2 +```powershell +PS C:\> Connect-ZertoServer -zertoServer "192.168.1.100" -zertoPort "9669" -credential $credential -AutoReconnect +``` + +Establishes a connection to ZVM 192.168.1.100 on port 9669 with supplied PSCredential object. Adding the `-AutoReconnect` switch +will cache the PSCredential object should the session need to be reauthorized due to an expired token. + +## PARAMETERS + +### -AutoReconnect +Use this switch to indicate that you would like the module to take care of auto re-authorization and reconnection to the ZVM should the token expire. This option will cache your PSCredential object to be reused + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -credential +Valid credentials to connect to the Zerto Management Server + +```yaml +Type: PSCredential +Parameter Sets: (All) +Aliases: + +Required: True +Position: 2 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -returnHeaders +Use this switch to return the headers to a specified variable or to the default output. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zertoPort +Zerto Virtual Manager management port. +Default value is 9669. + +```yaml +Type: String +Parameter Sets: (All) +Aliases: port + +Required: False +Position: 1 +Default value: "9669" +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -zertoServer +IP address or FQDN of your Zerto Management Server + +```yaml +Type: String +Parameter Sets: (All) +Aliases: server, zvm + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS + +[Zerto REST API Session End Point Documentation](http://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20%28ZVM%29%20-%20vSphere%20Online%20Help/index.html#page/RestfulAPIs%2FStatusAPIs.5.068.html%23) + +[PSCredential Documentation](https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.pscredential?view=pscore-6.0.0) + +[Get-Credential Documentation](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/get-credential?view=powershell-6) From f4c1cf630ab33728418f6680cc7eccf4d454c6a3 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 11 Jun 2020 15:53:53 -0400 Subject: [PATCH 417/479] Moved Credential to Second Position --- ZertoApiWrapper/Public/Connect-ZertoServer.ps1 | 6 ++++-- docs/Connect-ZertoServer.md | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 b/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 index 9a8c649..20c0a7b 100644 --- a/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 +++ b/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 @@ -5,7 +5,8 @@ function Connect-ZertoServer { param( [Parameter( Mandatory, - HelpMessage = "IP address or FQDN of your Zerto Management Server" + HelpMessage = "IP address or FQDN of your Zerto Management Server", + Position = 0 )] [ValidateNotNullOrEmpty()] [Alias("server", "zvm")] @@ -19,7 +20,8 @@ function Connect-ZertoServer { [string]$zertoPort = "9669", [Parameter( Mandatory, - HelpMessage = "Valid credentials to connect to the Zerto Management Server" + HelpMessage = "Valid credentials to connect to the Zerto Management Server", + Position = 1 )] [System.Management.Automation.PSCredential]$credential, [switch]$returnHeaders, diff --git a/docs/Connect-ZertoServer.md b/docs/Connect-ZertoServer.md index ad36a82..9110133 100644 --- a/docs/Connect-ZertoServer.md +++ b/docs/Connect-ZertoServer.md @@ -13,8 +13,8 @@ Establishes a connection to a ZVM. ## SYNTAX ``` -Connect-ZertoServer [-zertoServer] [[-zertoPort] ] [-credential] - [-returnHeaders] [-AutoReconnect] [] +Connect-ZertoServer [-zertoServer] [-zertoPort ] [-credential] [-returnHeaders] + [-AutoReconnect] [] ``` ## DESCRIPTION @@ -63,7 +63,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 2 +Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -94,7 +94,7 @@ Parameter Sets: (All) Aliases: port Required: False -Position: 1 +Position: Named Default value: "9669" Accept pipeline input: False Accept wildcard characters: False From 363b6e727c5e1632909a8981d0998015dd98d2e6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 11 Jun 2020 16:16:38 -0400 Subject: [PATCH 418/479] Update Param Order Syntax in Help File --- docs/Connect-ZertoServer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Connect-ZertoServer.md b/docs/Connect-ZertoServer.md index 9110133..e1bb8fd 100644 --- a/docs/Connect-ZertoServer.md +++ b/docs/Connect-ZertoServer.md @@ -13,8 +13,8 @@ Establishes a connection to a ZVM. ## SYNTAX ``` -Connect-ZertoServer [-zertoServer] [-zertoPort ] [-credential] [-returnHeaders] - [-AutoReconnect] [] +Connect-ZertoServer [-zertoServer] [-credential] [-zertoPort ] [-returnHeaders] +[] ``` ## DESCRIPTION From 2d453ef608816288d4489c572fef367fbf8a6102 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 11 Jun 2020 16:34:04 -0400 Subject: [PATCH 419/479] Put params in correct order --- .../Public/Connect-ZertoServer.ps1 | 20 +++++++++++-------- docs/Connect-ZertoServer.md | 4 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 b/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 index 20c0a7b..49ec0f6 100644 --- a/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 +++ b/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 @@ -11,6 +11,12 @@ function Connect-ZertoServer { [ValidateNotNullOrEmpty()] [Alias("server", "zvm")] [string]$zertoServer, + [Parameter( + Mandatory, + HelpMessage = "Valid credentials to connect to the Zerto Management Server", + Position = 1 + )] + [System.Management.Automation.PSCredential]$credential, [Parameter( HelpMessage = "Zerto Virtual Manager management port. Default value is 9669." )] @@ -18,17 +24,15 @@ function Connect-ZertoServer { [ValidateRange(1024, 65535)] [Alias("port")] [string]$zertoPort = "9669", - [Parameter( - Mandatory, - HelpMessage = "Valid credentials to connect to the Zerto Management Server", - Position = 1 - )] - [System.Management.Automation.PSCredential]$credential, - [switch]$returnHeaders, [Parameter( HelpMessage = "Use this switch to indicate that you would like the module to take care of auto re-authorization and reconnection to the ZVM should the token expire. This option will cache your PSCredential object to be reused" )] - [switch]$AutoReconnect + [switch]$AutoReconnect, + [Parameter( + HelpMessage = "Use this switch to return the headers to a specified variable or to the default output." + )] + [switch]$returnHeaders + ) begin { diff --git a/docs/Connect-ZertoServer.md b/docs/Connect-ZertoServer.md index e1bb8fd..9a08e8d 100644 --- a/docs/Connect-ZertoServer.md +++ b/docs/Connect-ZertoServer.md @@ -13,8 +13,8 @@ Establishes a connection to a ZVM. ## SYNTAX ``` -Connect-ZertoServer [-zertoServer] [-credential] [-zertoPort ] [-returnHeaders] -[] +Connect-ZertoServer [-zertoServer] [-credential] [-zertoPort ] [-AutoReconnect] + [-returnHeaders] [] ``` ## DESCRIPTION From 7ce6369ad7063220fd5e6bea9974be59c7e82130 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 12 Jun 2020 12:39:38 -0400 Subject: [PATCH 420/479] Add tests for switches --- Tests/Public/Connect-ZertoServer.Tests.ps1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Tests/Public/Connect-ZertoServer.Tests.ps1 b/Tests/Public/Connect-ZertoServer.Tests.ps1 index 6d6e185..f417346 100644 --- a/Tests/Public/Connect-ZertoServer.Tests.ps1 +++ b/Tests/Public/Connect-ZertoServer.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester $global:here = (Split-Path -Parent $PSCommandPath) -$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] +$global:function = ((Split-Path -Leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { @@ -45,6 +45,16 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { { Connect-ZertoServer -zertoServer -credential 1234 } | Should -Throw { Connect-ZertoServer -zertoServer -credential $(@{Username = "zerto\build"; Password = 'SecureString' }) } | Should -Throw } + + It "has a switch parameter to return the headers" { + Get-Command $global:function | Should -HaveParameter returnHeaders + Get-Command $global:function | Should -HaveParameter returnHeaders -Type Switch + } + + It "has a switch parameter to auto reauthorize the session" { + Get-Command $global:function | Should -HaveParameter autoReconnect + Get-Command $global:function | Should -HaveParameter autoReconnect -Type Switch + } } InModuleScope -ModuleName ZertoApiWrapper { From 6903ccc99b3fb8c9f711bb5b66e1fd33a543f484 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jun 2020 17:03:32 -0400 Subject: [PATCH 421/479] Update CHANGELOG --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b4a119..fb39f98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Zerto Virtual Manager + +#### Updated + +* Updated `Connect-ZertoServer` with a `-AutoReconnect` switch to allow the auto reconnection of a session that has timed-out. + ## [1.4.2] ### Zerto Virtual Manager From ddae22fb9fd55c8aa93c61df00100a711bb9488a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jun 2020 17:18:16 -0400 Subject: [PATCH 422/479] Specify defaultParameterSetName --- ZertoApiWrapper/Public/New-ZertoVpg.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 index 4ae6f60..f62ff30 100644 --- a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 @@ -1,6 +1,6 @@ <# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function New-ZertoVpg { - [cmdletbinding(SupportsShouldProcess = $true)] + [cmdletbinding(SupportsShouldProcess = $true, DefaultParameterSetName = "recoveryHostDatastore")] param( [Parameter( HelpMessage = "Name of the VPG", From ea8d6f096da7e0bb95824e331735a341e795facd Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jun 2020 17:18:40 -0400 Subject: [PATCH 423/479] Update Parameter with Proper Names --- ZertoApiWrapper/Public/New-ZertoVpg.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 index f62ff30..d9d5d56 100644 --- a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 @@ -182,18 +182,18 @@ function New-ZertoVpg { # Get identifiers based on parameter set name switch ($PSCmdlet.ParameterSetName) { "recoveryClusterDatastoreCluster" { - $identifiersTable['clusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -hostclusters | Where-Object { $_.VirtualizationClusterName -like $recoveryCluster }).ClusterIdentifier - $identifiersTable['datastoreClusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastoreclusters | Where-Object { $_.DatastoreClusterName -like $datastoreCluster }).DatastoreClusterIdentifier + $identifiersTable['clusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -hostClusters | Where-Object { $_.VirtualizationClusterName -like $recoveryCluster }).ClusterIdentifier + $identifiersTable['datastoreClusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastoreClusters | Where-Object { $_.DatastoreClusterName -like $datastoreCluster }).DatastoreClusterIdentifier } "recoveryClusterDatastore" { - $identifiersTable['clusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -hostclusters | Where-Object { $_.VirtualizationClusterName -like $recoveryCluster }).ClusterIdentifier + $identifiersTable['clusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -hostClusters | Where-Object { $_.VirtualizationClusterName -like $recoveryCluster }).ClusterIdentifier $identifiersTable['datastoreIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastores | Where-Object { $_.DatastoreName -like $datastore }).DatastoreIdentifier } "recoveryHostDatastoreCluster" { $identifiersTable['recoveryHostIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -hosts | Where-Object { $_.VirtualizationHostName -like $recoveryHost }).HostIdentifier - $identifiersTable['datastoreClusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastoreclusters | Where-Object { $_.DatastoreClusterName -like $datastoreCluster }).DatastoreClusterIdentifier + $identifiersTable['datastoreClusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastoreClusters | Where-Object { $_.DatastoreClusterName -like $datastoreCluster }).DatastoreClusterIdentifier } "recoveryHostDatastore" { @@ -202,12 +202,12 @@ function New-ZertoVpg { } "recoveryResourcePoolDatastoreCluster" { - $identifiersTable['recoveryResourcePoolIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -resourcepools | Where-Object { $_.ResourcePoolName -like $recoveryResourcePool }).ResourcePoolIdentifier - $identifiersTable['datastoreClusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastoreclusters | Where-Object { $_.DatastoreClusterName -like $datastoreCluster }).DatastoreClusterIdentifier + $identifiersTable['recoveryResourcePoolIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -resourcePools | Where-Object { $_.ResourcePoolName -like $recoveryResourcePool }).ResourcePoolIdentifier + $identifiersTable['datastoreClusterIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastoreClusters | Where-Object { $_.DatastoreClusterName -like $datastoreCluster }).DatastoreClusterIdentifier } "recoveryResourcePoolDatastore" { - $identifiersTable['recoveryResourcePoolIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -resourcepools | Where-Object { $_.ResourcePoolName -like $recoveryResourcePool }).ResourcePoolIdentifier + $identifiersTable['recoveryResourcePoolIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -resourcePools | Where-Object { $_.ResourcePoolName -like $recoveryResourcePool }).ResourcePoolIdentifier $identifiersTable['datastoreIdentifier'] = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -datastores | Where-Object { $_.DatastoreName -like $datastore }).DatastoreIdentifier } } From 0f1b4302bb51745f07c65d8d64d959072ee33045 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 22 Jun 2020 17:18:55 -0400 Subject: [PATCH 424/479] Update CHANGELOG with latest updates --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb39f98..e65cefb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project is transitioning to [Semantic Versioning](https://semver.org/sp #### Updated * Updated `Connect-ZertoServer` with a `-AutoReconnect` switch to allow the auto reconnection of a session that has timed-out. +* Updated `New-ZertoVpg` to have a Default Parameter Set of `recoveryHostDatastore` should no parameters be passed when calling the function. ## [1.4.2] From 7fc7edff86f225b2aee31d12d7c36e0e57ac711f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 23 Jun 2020 12:51:33 -0400 Subject: [PATCH 425/479] Update PeerSite Lookup Method --- ZertoApiWrapper/Public/New-ZertoVpg.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 index d9d5d56..710f51d 100644 --- a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 @@ -165,7 +165,7 @@ function New-ZertoVpg { begin { # Create an identifiers table, and start converting names to identifiers. $identifiersTable = @{ } - $identifiersTable['recoverySiteIdentifier'] = $(Get-ZertoPeerSite -peerName $recoverySite).siteIdentifier + $identifiersTable['recoverySiteIdentifier'] = (Get-ZertoPeerSite).Where({$_.PeerSiteName -like $recoverySite}) | Select-Object -ExpandProperty SiteIdentifier $peerSiteNetworks = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -networks) $identifiersTable['failoverNetworkIdentifier'] = $peerSiteNetworks | Where-Object { $_.VirtualizationNetworkName -like $recoveryNetwork } | Select-Object -ExpandProperty NetworkIdentifier $identifiersTable['testNetworkIdentifier'] = $peerSiteNetworks | Where-Object { $_.VirtualizationNetworkName -like $testNetwork } | Select-Object -ExpandProperty NetworkIdentifier From 5627992a047053eddb6ed8064fe1332d1936c585 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 23 Jun 2020 12:54:03 -0400 Subject: [PATCH 426/479] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e65cefb..637870c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project is transitioning to [Semantic Versioning](https://semver.org/sp * Updated `Connect-ZertoServer` with a `-AutoReconnect` switch to allow the auto reconnection of a session that has timed-out. * Updated `New-ZertoVpg` to have a Default Parameter Set of `recoveryHostDatastore` should no parameters be passed when calling the function. +* Updated `New-ZertoVpg -recoverySite` parameter to be case-insensitive ## [1.4.2] From a25bf3adfe8ab407cda09286640fec150f362225 Mon Sep 17 00:00:00 2001 From: NScuola <15016465+NScuola@users.noreply.github.com> Date: Wed, 1 Jul 2020 14:06:30 -0400 Subject: [PATCH 427/479] Adding port information for pairing v7.5+ Adding port information to example for pairing v7.5+. --- docs/Add-ZertoPeerSite.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Add-ZertoPeerSite.md b/docs/Add-ZertoPeerSite.md index 7fafff4..72d82c2 100644 --- a/docs/Add-ZertoPeerSite.md +++ b/docs/Add-ZertoPeerSite.md @@ -31,10 +31,10 @@ Pairs the current Zerto Virtual Manager to the Zerto Virtual Manager at IP addre ### Example 2 ```powershell -PS C:\> Add-ZertoPeerSite -targetHost "192.168.2.100" -token "GeneratedFromTargetZVM" +PS C:\> Add-ZertoPeerSite -targetHost "192.168.2.100" -targetPort "9071" -token "GeneratedFromTargetZVM" ``` -Pairs the current Zerto Virtual Manager to the Zerto Virtual Manager at IP address 192.168.2.100. Use this method when pairing Zerto Virtual Managers that are version 7.5 or later. +Pairs the current Zerto Virtual Manager to the Zerto Virtual Manager at IP address 192.168.2.100 over Port 9071. Use this method when pairing Zerto Virtual Managers that are version 7.5 or later. ## PARAMETERS From 41fddf5f13fde3836df623003cb49e50cca019c9 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 1 Jul 2020 17:09:38 -0400 Subject: [PATCH 428/479] Set-ZertoLicense - Fix ShouldProcess error Fixes #96 --- ZertoApiWrapper/Public/Set-ZertoLicense.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Set-ZertoLicense.ps1 b/ZertoApiWrapper/Public/Set-ZertoLicense.ps1 index aa95042..90fdd47 100644 --- a/ZertoApiWrapper/Public/Set-ZertoLicense.ps1 +++ b/ZertoApiWrapper/Public/Set-ZertoLicense.ps1 @@ -16,7 +16,7 @@ function Set-ZertoLicense { } process { - if ($PSCmdlet.ShouldProcess()) { + if ($PSCmdlet.ShouldProcess("Applying License Key: $licenseKey to server: $($script:zvmServer)")) { Invoke-ZertoRestRequest -uri $baseUri -body $($body | ConvertTo-Json) -method "PUT" } } From a072905253596e2a3a226ac5ce8b9006c39a5f51 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 1 Jul 2020 17:34:25 -0400 Subject: [PATCH 429/479] Update ChangLog with Issue 96 updates --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 637870c..36f9447 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ and this project is transitioning to [Semantic Versioning](https://semver.org/sp * Updated `New-ZertoVpg` to have a Default Parameter Set of `recoveryHostDatastore` should no parameters be passed when calling the function. * Updated `New-ZertoVpg -recoverySite` parameter to be case-insensitive +#### Fixed + +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/96) with `Set-ZertoLicense` so that ShouldProcess functions properly. + ## [1.4.2] ### Zerto Virtual Manager From 713c94461c0b4f3a72390027f0c62227072d92ff Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 6 Jul 2020 14:25:43 -0400 Subject: [PATCH 430/479] Replace Script Scope LocalSite Info Variable --- ZertoApiWrapper/Public/Get-ZertoUnprotectedVm.ps1 | 2 +- ZertoApiWrapper/Public/Install-ZertoVra.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ZertoApiWrapper/Public/Get-ZertoUnprotectedVm.ps1 b/ZertoApiWrapper/Public/Get-ZertoUnprotectedVm.ps1 index d76e96c..68a20f4 100644 --- a/ZertoApiWrapper/Public/Get-ZertoUnprotectedVm.ps1 +++ b/ZertoApiWrapper/Public/Get-ZertoUnprotectedVm.ps1 @@ -2,6 +2,6 @@ function Get-ZertoUnprotectedVm { [cmdletbinding()] param() - $uri = "virtualizationsites/{0}/vms" -f $script:zvmLocalInfo.siteidentifier + $uri = "virtualizationsites/{0}/vms" -f (Get-ZertoLocalSite).siteIdentifier Invoke-ZertoRestRequest -uri $uri } diff --git a/ZertoApiWrapper/Public/Install-ZertoVra.ps1 b/ZertoApiWrapper/Public/Install-ZertoVra.ps1 index 70f74a5..3ce61d2 100644 --- a/ZertoApiWrapper/Public/Install-ZertoVra.ps1 +++ b/ZertoApiWrapper/Public/Install-ZertoVra.ps1 @@ -111,7 +111,7 @@ function Install-ZertoVra { # If the VRA does not exist, proceed with the installation. If it does exist, bypass and if ( -not (Get-ZertoVra -vraName $vraName) ) { # Get identifiers for each item provided by name. - $siteIdentifier = $script:zvmLocalInfo.SiteIdentifier + $siteIdentifier = (Get-ZertoLocalSite).SiteIdentifier $hostIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -hosts | Where-Object { $_.VirtualizationHostName -eq $hostName } | Select-Object hostIdentifier -ExpandProperty hostIdentifier $networkIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -networks | Where-Object { $_.VirtualizationNetworkName -eq $networkName } | Select-Object NetworkIdentifier -ExpandProperty NetworkIdentifier $datastoreIdentifier = Get-ZertoVirtualizationSite -siteIdentifier $siteIdentifier -datastores | Where-Object { $_.DatastoreName -eq $datastoreName } | Select-Object DatastoreIdentifier -ExpandProperty DatastoreIdentifier From 7427ffe70709152df9bc97741d71ba37a020bd1d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 6 Jul 2020 14:26:10 -0400 Subject: [PATCH 431/479] Remove operation to set ZvmLocalInfo Variable --- ZertoApiWrapper/Public/Connect-ZertoServer.ps1 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 b/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 index 49ec0f6..237f845 100644 --- a/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 +++ b/ZertoApiWrapper/Public/Connect-ZertoServer.ps1 @@ -62,10 +62,7 @@ function Connect-ZertoServer { end { # Build Headers Hashtable with Authorization Token $Script:zvmHeaders['x-zerto-session'] = $results.Headers['x-zerto-session'][0].ToString() - # Set common Script Scope Variables to be used other functions (Headers and Local Site Info) - # Set-Variable -Name zvmHeaders -Scope Script -Value $zertoAuthorizationHeaders - Set-Variable -Name zvmLocalInfo -Scope Script -Value (Get-ZertoLocalSite) - + # Have the option to return the headers to a variable if ($returnHeaders) { return $Script:zvmHeaders From 8318229cf43bf6522470398f70de157c09b0ec9e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 6 Jul 2020 14:26:36 -0400 Subject: [PATCH 432/479] Remove Removal of Variable no longer required --- ZertoApiWrapper/Public/Disconnect-ZertoServer.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Disconnect-ZertoServer.ps1 b/ZertoApiWrapper/Public/Disconnect-ZertoServer.ps1 index b9d3032..080ec50 100644 --- a/ZertoApiWrapper/Public/Disconnect-ZertoServer.ps1 +++ b/ZertoApiWrapper/Public/Disconnect-ZertoServer.ps1 @@ -12,5 +12,4 @@ function Disconnect-ZertoServer { Remove-Variable -Name zvmPort -Scope Script Remove-Variable -Name zvmLastAction -Scope Script Remove-Variable -Name zvmHeaders -Scope Script - Remove-Variable -Name zvmLocalInfo -Scope Script } From 494c45b02c838c5cd45344cbcc42a4f6025f361a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 6 Jul 2020 14:26:56 -0400 Subject: [PATCH 433/479] Remove tests for removed variable --- Tests/Public/Connect-ZertoServer.Tests.ps1 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Tests/Public/Connect-ZertoServer.Tests.ps1 b/Tests/Public/Connect-ZertoServer.Tests.ps1 index f417346..7b0519d 100644 --- a/Tests/Public/Connect-ZertoServer.Tests.ps1 +++ b/Tests/Public/Connect-ZertoServer.Tests.ps1 @@ -106,12 +106,6 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $script:zvmHeaders['Accept'] | Should -BeOfType String } - It "Module Scope zvmLocalInfo variable tests" { - $script:zvmLocalInfo | Should -Not -BeNullOrEmpty - $script:zvmLocalInfo | Should -BeOfType PSCustomObject - $script:zvmLocalInfo.SiteIdentifier | Should -BeOfType String - } - $headers = Connect-ZertoServer -zertoServer $Server -credential $credential -returnHeaders It "returns a Hashtable with 2 keys" { $headers | Should -BeOfType Hashtable From c477d40364a591583e7f697f4eccf521151fa287 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 6 Jul 2020 14:30:07 -0400 Subject: [PATCH 434/479] Remove Mocks that are not required any longer --- Tests/Public/Connect-ZertoServer.Tests.ps1 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Tests/Public/Connect-ZertoServer.Tests.ps1 b/Tests/Public/Connect-ZertoServer.Tests.ps1 index 7b0519d..802cc9b 100644 --- a/Tests/Public/Connect-ZertoServer.Tests.ps1 +++ b/Tests/Public/Connect-ZertoServer.Tests.ps1 @@ -67,10 +67,6 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { return $results } - Mock -ModuleName ZertoApiWrapper -CommandName Get-ZertoLocalSite { - return (Get-Content -Path "$global:here\Mocks\LocalSiteInfo.json" -Raw | ConvertFrom-Json) - } - Context "$($global:function)::InModuleScope Function Unit Tests" { BeforeAll { @@ -138,7 +134,6 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -Exactly 4 - Assert-MockCalled -ModuleName ZertoApiWrapper -CommandName Get-ZertoLocalSite -Exactly 4 } } } From 5a2c01341ce3553c736a9d0c6d17f945a4f00d6e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 6 Jul 2020 14:32:32 -0400 Subject: [PATCH 435/479] Update Changlog for Issue 95 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36f9447..16d0945 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project is transitioning to [Semantic Versioning](https://semver.org/sp #### Fixed * Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/96) with `Set-ZertoLicense` so that ShouldProcess functions properly. +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/95) when attempting to connect to an unlicensed site. ## [1.4.2] From 3621ddef8dedc44fa53c26e3ac5943fed8080fa8 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 8 Jul 2020 13:08:49 -0400 Subject: [PATCH 436/479] Set Version Numbers --- CHANGELOG.md | 2 +- version.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16d0945..341c6f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [1.4.3] ### Zerto Virtual Manager diff --git a/version.txt b/version.txt index 9df886c..428b770 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.4.2 +1.4.3 From df82bc26caac86d0e8baf21daa9990c96d07573f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 31 Jul 2020 17:42:28 -0400 Subject: [PATCH 437/479] Add function Add-ZertoVpgVm --- ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 | 77 +++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 diff --git a/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 b/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 new file mode 100644 index 0000000..c65160b --- /dev/null +++ b/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 @@ -0,0 +1,77 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Add-ZertoVpgVm { + [CmdletBinding(SupportsShouldProcess)] + param ( + [Parameter( + Mandatory, + HelpMessage = "Vpg Settings Identifier", + ValueFromPipeline, + ValueFromPipelineByPropertyName, + ValueFromRemainingArguments + )] + [ValidateNotNullOrEmpty()] + [String]$vpgSettingsIdentifier, + [Parameter( + Mandatory, + HelpMessage = "Name of VM(s) to add to the VPG" + )] + [ValidateNotNullOrEmpty()] + [String[]]$Vm + ) + + begin { + + } + + process { + $baseUrl = "vpgsettings/{0}" -f $vpgSettingsIdentifier + $baseSettings = Get-ZertoVpgSetting -vpgSettingsIdentifier $vpgSettingsIdentifier + $unprotectedVms = Get-ZertoUnprotectedVm + $protectedVms = Get-ZertoProtectedVm + $vmMap = Get-Map -inputObject $unprotectedVms -key VmName -value VmIdentifier + $vmMap = $vmMap + (Get-Map -inputObject $protectedVms -key VmName -value VmIdentifier) + # Create array of VM identifiers + $vmIdentifiers = foreach ($machine in $Vm) { + if ($vmMap[$machine] -notin $baseSettings.Vms.vmIdentifier ) { + # If the VM is unprotected, get the identifier + $vmIdentifier = $unprotectedVms | Where-Object { $_.vmName -like $machine } | Select-Object -ExpandProperty vmIdentifier + # If the VM is not unprotected, check the protected VMs + if ( -not $vmIdentifier) { + # Get all identifiers to test if the VM is eligible to be a member of an additional VPG + $results = $protectedVms | Where-Object { $_.VmName -like $machine } | Select-Object -ExpandProperty vmIdentifier + $recoverySiteIdentifiers = $protectedVms | Where-Object { $_.VmName -like $machine } | Select-Object -ExpandProperty RecoverySite | Select-Object -ExpandProperty identifier + # If VM is currently a member of 3 VPGs, skip it. If it cannot be found, skip it. Otherwise, set the identifier + if ($baseSettings.basic.RecoverySiteIdentifier -in $recoverySiteIdentifiers) { + Write-Warning "$machine is already replicating to target site. It cannot be added to an additional VPG replicating to that site. Please check your configurations and try again. Skipping $machine" + continue + } elseif ($results.count -eq 3) { + Write-Warning "$machine is already a part of 3 VPGs and cannot be part of an additional VPG. Skipping $machine" + continue + } elseif ($results.count -eq 0) { + Write-Warning "$machine not found. Skipping $machine" + continue + } else { + $vmIdentifier = $results | Select-Object -First 1 + } + } + # Create a custom object to store the information to easily convert to JSON. Return to vmIdentifiers array. + $returnObject = New-Object PSObject + $returnObject | Add-Member -MemberType NoteProperty -Name "VmIdentifier" -Value $vmIdentifier + $returnObject + } else { + Write-Warning "$machine is already a member of this VPG Settings object. It will not be added again. Skipping $machine" + continue + } + } + if ($vmIdentifiers.Count -gt 0 -and $PSCmdlet.ShouldProcess($Vm, "Adding VM to Vpg")) { + $baseSettings.Vms += $vmIdentifiers + Invoke-ZertoRestRequest -uri $baseUrl -method PUT -body $($baseSettings | ConvertTo-Json -Depth 10) + } else { + Write-Warning "No VMs found to add. Please check your parameters and try again." + } + } + + end { + + } +} From d9e6c74f27b82849983d4a99c21d6435252680c4 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 31 Jul 2020 18:02:00 -0400 Subject: [PATCH 438/479] Add parameter aliases --- ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 b/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 index c65160b..7add179 100644 --- a/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 +++ b/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 @@ -10,6 +10,7 @@ function Add-ZertoVpgVm { ValueFromRemainingArguments )] [ValidateNotNullOrEmpty()] + [Alias("sid", "settingsIdentifier", "vpgSettingsId")] [String]$vpgSettingsIdentifier, [Parameter( Mandatory, From d9e1063654794ade3e56b69ee51b2ac6f893dccb Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 3 Aug 2020 21:13:38 -0400 Subject: [PATCH 439/479] update GitIgnore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ee2dd02..614cba9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ SourceTestResults.xml publish/* CodeCoverage.xml scratch +.DS_Store From a59feb2d5fba1b308055f0b7b509d9f45b65afd0 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 3 Aug 2020 21:21:05 -0400 Subject: [PATCH 440/479] Add switch for vpgName --- ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 | 38 +++++++++++++++++------ 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 b/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 index 7add179..9b7c98e 100644 --- a/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 +++ b/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 @@ -1,17 +1,25 @@ <# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Add-ZertoVpgVm { - [CmdletBinding(SupportsShouldProcess)] + [CmdletBinding(SupportsShouldProcess, DefaultParameterSetName = "VpgName")] param ( [Parameter( Mandatory, HelpMessage = "Vpg Settings Identifier", ValueFromPipeline, ValueFromPipelineByPropertyName, - ValueFromRemainingArguments + ValueFromRemainingArguments, + ParameterSetName = "VpgSettingsIdentifier" )] [ValidateNotNullOrEmpty()] [Alias("sid", "settingsIdentifier", "vpgSettingsId")] [String]$vpgSettingsIdentifier, + [Parameter( + Mandatory, + HelpMessage = "Target VPG Name to Add the VM", + ParameterSetName = "VpgName" + )] + [ValidateNotNullOrEmpty()] + [String]$VpgName, [Parameter( Mandatory, HelpMessage = "Name of VM(s) to add to the VPG" @@ -25,7 +33,11 @@ function Add-ZertoVpgVm { } process { - $baseUrl = "vpgsettings/{0}" -f $vpgSettingsIdentifier + if ($PSCmdlet.ParameterSetName -eq "VpgName"){ + $VpgIdentifier = Get-ZertoVpg -name $VpgName | Select-Object -ExpandProperty VpgIdentifier + $vpgSettingsIdentifier = New-ZertoVpgSettingsIdentifier -vpgIdentifier $VpgIdentifier + } + $baseUrl = "vpgsettings/{0}/vms" -f $vpgSettingsIdentifier $baseSettings = Get-ZertoVpgSetting -vpgSettingsIdentifier $vpgSettingsIdentifier $unprotectedVms = Get-ZertoUnprotectedVm $protectedVms = Get-ZertoProtectedVm @@ -56,19 +68,27 @@ function Add-ZertoVpgVm { } } # Create a custom object to store the information to easily convert to JSON. Return to vmIdentifiers array. - $returnObject = New-Object PSObject - $returnObject | Add-Member -MemberType NoteProperty -Name "VmIdentifier" -Value $vmIdentifier - $returnObject + $vmIdentifier } else { Write-Warning "$machine is already a member of this VPG Settings object. It will not be added again. Skipping $machine" continue } } - if ($vmIdentifiers.Count -gt 0 -and $PSCmdlet.ShouldProcess($Vm, "Adding VM to Vpg")) { - $baseSettings.Vms += $vmIdentifiers - Invoke-ZertoRestRequest -uri $baseUrl -method PUT -body $($baseSettings | ConvertTo-Json -Depth 10) + if ($vmIdentifiers.Count -gt 0 -and $PSCmdlet.ShouldProcess($VmIdentifiers, "Adding VM to Vpg")) { + foreach ($id in $VmIdentifiers) { + # Build the Body + $Body = @{VmIdentifier = $id } + # Submit the request. Out to Null to prevent line returns while running. + $null = Invoke-ZertoRestRequest -uri $baseUrl -method POST -body ($Body | ConvertTo-Json -Depth 10) + } + if ($PSCmdlet.ParameterSetName -eq "VpgName") { + $vpgSettingsIdentifier + } } else { Write-Warning "No VMs found to add. Please check your parameters and try again." + if ($PSCmdlet.ParameterSetName -eq "VpgName") { + Remove-ZertoVpgSettingsIdentifier -vpgSettingsIdentifier $vpgSettingsIdentifier + } } } From c64c82f8bcd937d7d2b10be9b7e5f6c812541a89 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 4 Aug 2020 07:53:15 -0400 Subject: [PATCH 441/479] Add parameter alias --- ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 b/ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 index 055febc..3f7fed8 100644 --- a/ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 +++ b/ZertoApiWrapper/Public/Save-ZertoVpgSetting.ps1 @@ -11,7 +11,7 @@ function Save-ZertoVpgSetting { ValueFromPipelineByPropertyName = $true )] [ValidateNotNullOrEmpty()] - [Alias("vpgSettingsId")] + [Alias("sid", "settingsIdentifier", "vpgSettingsId")] [string]$vpgSettingsIdentifier ) From d7e46bd2634ab63736f05b6d359323c950c656d6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 4 Aug 2020 10:48:58 -0400 Subject: [PATCH 442/479] Check for existence of Vpg --- ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 b/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 index 9b7c98e..c4b1ef8 100644 --- a/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 +++ b/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 @@ -33,9 +33,13 @@ function Add-ZertoVpgVm { } process { - if ($PSCmdlet.ParameterSetName -eq "VpgName"){ + if ($PSCmdlet.ParameterSetName -eq "VpgName") { $VpgIdentifier = Get-ZertoVpg -name $VpgName | Select-Object -ExpandProperty VpgIdentifier - $vpgSettingsIdentifier = New-ZertoVpgSettingsIdentifier -vpgIdentifier $VpgIdentifier + if (-not $VpgIdentifier) { + Write-Error "Unable to find Vpg with name $VpgName. Please check your parameters and try again." -ErrorAction Stop + } else { + $vpgSettingsIdentifier = New-ZertoVpgSettingsIdentifier -vpgIdentifier $VpgIdentifier + } } $baseUrl = "vpgsettings/{0}/vms" -f $vpgSettingsIdentifier $baseSettings = Get-ZertoVpgSetting -vpgSettingsIdentifier $vpgSettingsIdentifier From 14ef5048e475dcb70db7ff33505014a632f33e8a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 4 Aug 2020 11:22:45 -0400 Subject: [PATCH 443/479] Only process unique VM names --- ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 b/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 index c4b1ef8..ec5fc1c 100644 --- a/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 +++ b/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 @@ -48,7 +48,7 @@ function Add-ZertoVpgVm { $vmMap = Get-Map -inputObject $unprotectedVms -key VmName -value VmIdentifier $vmMap = $vmMap + (Get-Map -inputObject $protectedVms -key VmName -value VmIdentifier) # Create array of VM identifiers - $vmIdentifiers = foreach ($machine in $Vm) { + $vmIdentifiers = foreach ($machine in ($Vm | Select-Object -Unique)) { if ($vmMap[$machine] -notin $baseSettings.Vms.vmIdentifier ) { # If the VM is unprotected, get the identifier $vmIdentifier = $unprotectedVms | Where-Object { $_.vmName -like $machine } | Select-Object -ExpandProperty vmIdentifier From 5f786775dcadb0e2c849a5a5939bc24901753719 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 4 Aug 2020 11:23:20 -0400 Subject: [PATCH 444/479] Verbose Output - VM and VPG name --- ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 b/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 index ec5fc1c..7301083 100644 --- a/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 +++ b/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 @@ -43,6 +43,9 @@ function Add-ZertoVpgVm { } $baseUrl = "vpgsettings/{0}/vms" -f $vpgSettingsIdentifier $baseSettings = Get-ZertoVpgSetting -vpgSettingsIdentifier $vpgSettingsIdentifier + if ($PSCmdlet.ParameterSetName -eq "VpgSettingsIdentifier") { + $VpgName = $baseSettings.Basic.Name + } $unprotectedVms = Get-ZertoUnprotectedVm $protectedVms = Get-ZertoProtectedVm $vmMap = Get-Map -inputObject $unprotectedVms -key VmName -value VmIdentifier @@ -78,7 +81,7 @@ function Add-ZertoVpgVm { continue } } - if ($vmIdentifiers.Count -gt 0 -and $PSCmdlet.ShouldProcess($VmIdentifiers, "Adding VM to Vpg")) { + if ($vmIdentifiers.Count -gt 0 -and $PSCmdlet.ShouldProcess($VmIdentifiers, "Adding VM(s): $Vm to Vpg $VpgName")) { foreach ($id in $VmIdentifiers) { # Build the Body $Body = @{VmIdentifier = $id } From 56bbe59ea77ce766fed6bb8f7baed6217f92d22a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 4 Aug 2020 11:23:37 -0400 Subject: [PATCH 445/479] Always return the Vpg Settings Identifier --- ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 b/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 index 7301083..d504acf 100644 --- a/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 +++ b/ZertoApiWrapper/Public/Add-ZertoVpgVm.ps1 @@ -88,9 +88,8 @@ function Add-ZertoVpgVm { # Submit the request. Out to Null to prevent line returns while running. $null = Invoke-ZertoRestRequest -uri $baseUrl -method POST -body ($Body | ConvertTo-Json -Depth 10) } - if ($PSCmdlet.ParameterSetName -eq "VpgName") { - $vpgSettingsIdentifier - } + + $vpgSettingsIdentifier } else { Write-Warning "No VMs found to add. Please check your parameters and try again." if ($PSCmdlet.ParameterSetName -eq "VpgName") { From aa73534d7ffd55aaf6362b0666a420e4446ea3bd Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 4 Aug 2020 11:42:41 -0400 Subject: [PATCH 446/479] Create Add-ZertoVpgVm Help File --- docs/Add-ZertoVpgVm.md | 138 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 docs/Add-ZertoVpgVm.md diff --git a/docs/Add-ZertoVpgVm.md b/docs/Add-ZertoVpgVm.md new file mode 100644 index 0000000..2aaf484 --- /dev/null +++ b/docs/Add-ZertoVpgVm.md @@ -0,0 +1,138 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: +schema: 2.0.0 +--- + +# Add-ZertoVpgVm + +## SYNOPSIS +Adds one or more virtual machines to an existing VPG. A VPG Settings Identifier will be returned for use in either further customization of the VPG or passed to the `Save-ZertoVpgSetting` command to commit the changes. + +## SYNTAX + +### VpgName (Default) +``` +Add-ZertoVpgVm -VpgName -Vm [-WhatIf] [-Confirm] [] +``` + +### VpgSettingsIdentifier +``` +Add-ZertoVpgVm -vpgSettingsIdentifier -Vm [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Adds one or more virtual machines to an existing VPG. A VPG Settings Identifier will be returned for use in either further customization of the VPG or passed to the `Save-ZertoVpgSetting` command to commit the changes. + +Internal logic to the function will only process unique items and ensure that VMs meet requirements to replicate to the target site. These requirements include not currently a member of the specified VPG, not currently replicating to the target site, and not a member of 3 or more VPGs. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Add-ZertoVpgVm -VpgSettingsIdentifier $vpgSettingsIdentifier -Vm "VM 1", "Vm 2" +``` + +Adds "VM 1" and "VM 2" to the Vpg with VpgSettingsIdentifer specified in `$VpgSettingsIdentifier`. This variable was obtained via other functions that create and return a Vpg Settings Identifier. The Vpg Settings Identifier passed into the function will be returned. + +### Example 2 +```powershell +PS C:\> Add-ZertoVpgVm -VpgName "My Vpg" -Vm "VM 1", "Vm 2" +``` + +Adds "VM 1" and "VM 2" to the Vpg named "My Vpg". In this case, a new Vpg Settings Identifier will be created and returned. + +## PARAMETERS + +### -Vm +Name of VM(s) to add to the VPG + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VpgName +Target VPG Name to Add the VM + +```yaml +Type: String +Parameter Sets: VpgName +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgSettingsIdentifier +Vpg Settings Identifier + +```yaml +Type: String +Parameter Sets: VpgSettingsIdentifier +Aliases: sid, settingsIdentifier, vpgSettingsId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### System.Object + +## NOTES + +## RELATED LINKS +[Adding VMs to a VPG Settings Object](https://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20(ZVM)%20-%20vSphere%20Online%20Help/content/zvr_apis/vpg_management_api.htm?tocpath=ZVR%20RESTful%20APIs%7CZerto%20APIs%7C_____20#statusapis_4057192544_1358357) From 961eafb945d963cfdb40fd31cb45228662bddbca Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 4 Aug 2020 11:44:36 -0400 Subject: [PATCH 447/479] Update Event Documentation --- docs/Get-ZertoEvent.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Get-ZertoEvent.md b/docs/Get-ZertoEvent.md index 25532cb..f3b8c67 100644 --- a/docs/Get-ZertoEvent.md +++ b/docs/Get-ZertoEvent.md @@ -19,7 +19,7 @@ Get-ZertoEvent [] ### filter ``` -Get-ZertoEvent [-startDate ] [-endDate ] [-vpgName ] [-vpgIdentifier ] +Get-ZertoEvent [-startDate ] [-endDate ] [-vpg ] [-vpgIdentifier ] [-eventType ] [-siteName ] [-siteIdentifier ] [-zorgIdentifier ] [-entityType ] [-userName ] [-category ] [-eventCategory ] [-alertIdentifier ] [] From 9561936be7ebd02e24111028477b2732da44b910 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 4 Aug 2020 11:46:12 -0400 Subject: [PATCH 448/479] Update Help Files --- docs/Get-ZertoEvent.md | 12 ++++++------ docs/Invoke-ZertoMove.md | 26 +++++++++++++------------- docs/New-ZertoVpg.md | 24 ++++++++++++------------ docs/Remove-ZertoVpg.md | 4 ++-- docs/Save-ZertoVpgSetting.md | 4 ++-- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/docs/Get-ZertoEvent.md b/docs/Get-ZertoEvent.md index f3b8c67..e42daa2 100644 --- a/docs/Get-ZertoEvent.md +++ b/docs/Get-ZertoEvent.md @@ -309,13 +309,13 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -vpgIdentifier -The identifier of the VPG for which you want to return events. +### -vpg +The name of the VPG for which you want to return events. ```yaml Type: String Parameter Sets: filter -Aliases: vpgId +Aliases: vpgName Required: False Position: Named @@ -324,13 +324,13 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -vpgName -The name of the VPG for which you want to return events. +### -vpgIdentifier +The identifier of the VPG for which you want to return events. ```yaml Type: String Parameter Sets: filter -Aliases: vpg +Aliases: vpgId Required: False Position: Named diff --git a/docs/Invoke-ZertoMove.md b/docs/Invoke-ZertoMove.md index 420088e..eb1c661 100644 --- a/docs/Invoke-ZertoMove.md +++ b/docs/Invoke-ZertoMove.md @@ -14,21 +14,20 @@ Start a move of a VPG. ### main (Default) ``` -Invoke-ZertoMove [-vpgName] [[-commitPolicy] ] [[-commitPolicyTimeout] ] - [-forceShutdown] [-ContinueOnPreScriptFailure] [-WhatIf] [-Confirm] [] +Invoke-ZertoMove -vpgName [-commitPolicy ] [-commitPolicyTimeout ] [-forceShutdown] + [-ContinueOnPreScriptFailure] [-WhatIf] [-Confirm] [] ``` ### disableReverseProtection ``` -Invoke-ZertoMove [-vpgName] [[-commitPolicy] ] [[-commitPolicyTimeout] ] - [-forceShutdown] [-disableReverseProtection] [-ContinueOnPreScriptFailure] [-WhatIf] [-Confirm] - [] +Invoke-ZertoMove -vpgName [-commitPolicy ] [-commitPolicyTimeout ] [-forceShutdown] + [-disableReverseProtection] [-ContinueOnPreScriptFailure] [-WhatIf] [-Confirm] [] ``` ### keepSourceVms ``` -Invoke-ZertoMove [-vpgName] [[-commitPolicy] ] [[-commitPolicyTimeout] ] - [-forceShutdown] [-keepSourceVms] [-ContinueOnPreScriptFailure] [-WhatIf] [-Confirm] [] +Invoke-ZertoMove -vpgName [-commitPolicy ] [-commitPolicyTimeout ] [-forceShutdown] + [-keepSourceVms] [-ContinueOnPreScriptFailure] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -58,9 +57,10 @@ Default is the Site Settings setting. Type: String Parameter Sets: (All) Aliases: +Accepted values: Rollback, Commit, None Required: False -Position: 1 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -76,7 +76,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 2 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -91,7 +91,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 6 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -121,7 +121,7 @@ Parameter Sets: (All) Aliases: Required: False -Position: 3 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -136,7 +136,7 @@ Parameter Sets: keepSourceVms Aliases: Required: True -Position: 5 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False @@ -151,7 +151,7 @@ Parameter Sets: (All) Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False diff --git a/docs/New-ZertoVpg.md b/docs/New-ZertoVpg.md index c288dbd..e8a69d4 100644 --- a/docs/New-ZertoVpg.md +++ b/docs/New-ZertoVpg.md @@ -12,6 +12,16 @@ Creates a New VPG with default settings only. Customization of VM settings can b ## SYNTAX +### recoveryHostDatastore (Default) +``` +New-ZertoVpg -vpgName [-vpgPriority ] [-journalHistoryInHours ] -protectedVm + -recoverySite -recoveryHost -datastore -recoveryFolder + [-rpoInSeconds ] [-testIntervalInMinutes ] [-serviceProfile ] + [-useWanCompression ] [-zorg ] -recoveryNetwork -testNetwork + [-journalDatastore ] [-journalHardLimitInMb ] [-journalWarningThresholdInMb ] + [-WhatIf] [-Confirm] [] +``` + ### recoveryClusterDatastoreCluster ``` New-ZertoVpg -vpgName [-vpgPriority ] [-journalHistoryInHours ] -protectedVm @@ -42,16 +52,6 @@ New-ZertoVpg -vpgName [-vpgPriority ] [-journalHistoryInHours < [-WhatIf] [-Confirm] [] ``` -### recoveryHostDatastore -``` -New-ZertoVpg -vpgName [-vpgPriority ] [-journalHistoryInHours ] -protectedVm - -recoverySite -recoveryHost -datastore -recoveryFolder - [-rpoInSeconds ] [-testIntervalInMinutes ] [-serviceProfile ] - [-useWanCompression ] [-zorg ] -recoveryNetwork -testNetwork - [-journalDatastore ] [-journalHardLimitInMb ] [-journalWarningThresholdInMb ] - [-WhatIf] [-Confirm] [] -``` - ### recoveryResourcePoolDatastoreCluster ``` New-ZertoVpg -vpgName [-vpgPriority ] [-journalHistoryInHours ] -protectedVm @@ -176,7 +176,7 @@ Name of the datastore where the VM(s), Volume(s), and Journal(s) will reside. ```yaml Type: String -Parameter Sets: recoveryClusterDatastore, recoveryHostDatastore, recoveryResourcePoolDatastore +Parameter Sets: recoveryHostDatastore, recoveryClusterDatastore, recoveryResourcePoolDatastore Aliases: Required: True @@ -312,7 +312,7 @@ Name of the host where the VM(s) will be recovered. ```yaml Type: String -Parameter Sets: recoveryHostDatastoreCluster, recoveryHostDatastore +Parameter Sets: recoveryHostDatastore, recoveryHostDatastoreCluster Aliases: Required: True diff --git a/docs/Remove-ZertoVpg.md b/docs/Remove-ZertoVpg.md index c365cd7..877e44e 100644 --- a/docs/Remove-ZertoVpg.md +++ b/docs/Remove-ZertoVpg.md @@ -21,7 +21,7 @@ Remove-ZertoVpg -vpgidentifier [-keepRecoveryVolumes] [-force] [-What ### vpgName ``` -Remove-ZertoVpg [-vpgName] [-keepRecoveryVolumes] [-force] [-WhatIf] [-Confirm] [] +Remove-ZertoVpg -vpgName [-keepRecoveryVolumes] [-force] [-WhatIf] [-Confirm] [] ``` ## DESCRIPTION @@ -122,7 +122,7 @@ Parameter Sets: vpgName Aliases: Required: True -Position: 0 +Position: Named Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False diff --git a/docs/Save-ZertoVpgSetting.md b/docs/Save-ZertoVpgSetting.md index cd2cc59..4604408 100644 --- a/docs/Save-ZertoVpgSetting.md +++ b/docs/Save-ZertoVpgSetting.md @@ -36,10 +36,10 @@ VpgSettings Identifier to save ```yaml Type: String Parameter Sets: (All) -Aliases: vpgSettingsId +Aliases: sid, settingsIdentifier, vpgSettingsId Required: True -Position: 1 +Position: 0 Default value: None Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False From 510f0b9ed780240b8c8c01c2234db57d4b1dc7b9 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 4 Aug 2020 12:31:37 -0400 Subject: [PATCH 449/479] Add-ZertoVpgVm Tests --- Tests/Public/Add-ZertoVpgVm.Tests.ps1 | 53 +++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Tests/Public/Add-ZertoVpgVm.Tests.ps1 diff --git a/Tests/Public/Add-ZertoVpgVm.Tests.ps1 b/Tests/Public/Add-ZertoVpgVm.Tests.ps1 new file mode 100644 index 0000000..27af791 --- /dev/null +++ b/Tests/Public/Add-ZertoVpgVm.Tests.ps1 @@ -0,0 +1,53 @@ +#Requires -Modules Pester +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -Leaf $PSCommandPath).Split('.'))[0] + +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + BeforeAll { + $script:ScriptBlock = (Get-Command $global:function).ScriptBlock + } + + Context "$global:function::Parameter Unit Tests" { + + It "$global:function should have exactly 16 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 16 + } + + $ParameterTestCases = @( + @{ParameterName = 'vpgSettingsIdentifier'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'Vm'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'VpgName'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | Should -Be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "Supports 'SupportsShouldProcess'" { + Get-Command $global:function | Should -HaveParameter WhatIf + Get-Command $global:function | Should -HaveParameter Confirm + $script:ScriptBlock | Should -Match 'SupportsShouldProcess' + $script:ScriptBlock | Should -Match '\$PSCmdlet\.ShouldProcess\(.+\)' + } + } + + Context "Add-ZertoPeerSite::Functional Unit Tests" { + } +} +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global From 9d4b4d353384a49e171a631ecb2a62b2027d67b4 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 4 Aug 2020 17:42:37 -0400 Subject: [PATCH 450/479] Starting Remove-VpgVm --- ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 | 113 +++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 diff --git a/ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 b/ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 new file mode 100644 index 0000000..b34737a --- /dev/null +++ b/ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 @@ -0,0 +1,113 @@ +<# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> +function Remove-ZertoVpgVm { + [CmdletBinding(SupportsShouldProcess, DefaultParameterSetName = "VpgName")] + param ( + [Parameter( + Mandatory, + HelpMessage = "Vpg Settings Identifier", + ValueFromPipeline, + ValueFromPipelineByPropertyName, + ValueFromRemainingArguments, + ParameterSetName = "VpgSettingsIdentifier" + )] + [ValidateNotNullOrEmpty()] + [Alias("sid", "settingsIdentifier", "vpgSettingsId")] + [String]$vpgSettingsIdentifier, + [Parameter( + Mandatory, + HelpMessage = "Name of the VPG that contains the VM you wish to remove", + ParameterSetName = "VpgName" + )] + [ValidateNotNullOrEmpty()] + [String]$VpgName, + [Parameter( + Mandatory, + HelpMessage = "Name of VM(s) to remove from the VPG" + )] + [ValidateNotNullOrEmpty()] + [String[]]$Vm + ) + + begin { + + } + + process { + switch ($PSCmdlet.ParameterSetName) { + "VpgName" { + $VpgData = Get-ZertoVpg -vpgName $VpgName + if (-not $VpgData) { + Write-Error "Unable to find Vpg with name $VpgName. Please check your parameters and try again." -ErrorAction Stop + } else { + $protectedVms = Get-ZertoProtectedVm -vpgName $VpgData.VpgName + $vpgSettingsIdentifier = New-ZertoVpgSettingsIdentifier -vpgIdentifier $VpgIdentifier + } + } + Default {} + } + + if ($PSCmdlet.ParameterSetName -eq "VpgName") { + + + } + $baseUrl = "vpgsettings/{0}/vms" -f $vpgSettingsIdentifier + $baseSettings = Get-ZertoVpgSetting -vpgSettingsIdentifier $vpgSettingsIdentifier + if ($PSCmdlet.ParameterSetName -eq "VpgSettingsIdentifier") { + $VpgName = $baseSettings.Basic.Name + } + $unprotectedVms = Get-ZertoUnprotectedVm + $protectedVms = Get-ZertoProtectedVm + $vmMap = Get-Map -inputObject $unprotectedVms -key VmName -value VmIdentifier + $vmMap = $vmMap + (Get-Map -inputObject $protectedVms -key VmName -value VmIdentifier) + # Create array of VM identifiers + $vmIdentifiers = foreach ($machine in ($Vm | Select-Object -Unique)) { + if ($vmMap[$machine] -notin $baseSettings.Vms.vmIdentifier ) { + # If the VM is unprotected, get the identifier + $vmIdentifier = $unprotectedVms | Where-Object { $_.vmName -like $machine } | Select-Object -ExpandProperty vmIdentifier + # If the VM is not unprotected, check the protected VMs + if ( -not $vmIdentifier) { + # Get all identifiers to test if the VM is eligible to be a member of an additional VPG + $results = $protectedVms | Where-Object { $_.VmName -like $machine } | Select-Object -ExpandProperty vmIdentifier + $recoverySiteIdentifiers = $protectedVms | Where-Object { $_.VmName -like $machine } | Select-Object -ExpandProperty RecoverySite | Select-Object -ExpandProperty identifier + # If VM is currently a member of 3 VPGs, skip it. If it cannot be found, skip it. Otherwise, set the identifier + if ($baseSettings.basic.RecoverySiteIdentifier -in $recoverySiteIdentifiers) { + Write-Warning "$machine is already replicating to target site. It cannot be added to an additional VPG replicating to that site. Please check your configurations and try again. Skipping $machine" + continue + } elseif ($results.count -eq 3) { + Write-Warning "$machine is already a part of 3 VPGs and cannot be part of an additional VPG. Skipping $machine" + continue + } elseif ($results.count -eq 0) { + Write-Warning "$machine not found. Skipping $machine" + continue + } else { + $vmIdentifier = $results | Select-Object -First 1 + } + } + # Create a custom object to store the information to easily convert to JSON. Return to vmIdentifiers array. + $vmIdentifier + } else { + Write-Warning "$machine is already a member of this VPG Settings object. It will not be added again. Skipping $machine" + continue + } + } + if ($vmIdentifiers.Count -gt 0 -and $PSCmdlet.ShouldProcess($VmIdentifiers, "Adding VM(s): $Vm to Vpg $VpgName")) { + foreach ($id in $VmIdentifiers) { + # Build the Body + $Body = @{VmIdentifier = $id } + # Submit the request. Out to Null to prevent line returns while running. + $null = Invoke-ZertoRestRequest -uri $baseUrl -method POST -body ($Body | ConvertTo-Json -Depth 10) + } + + $vpgSettingsIdentifier + } else { + Write-Warning "No VMs found to add. Please check your parameters and try again." + if ($PSCmdlet.ParameterSetName -eq "VpgName") { + Remove-ZertoVpgSettingsIdentifier -vpgSettingsIdentifier $vpgSettingsIdentifier + } + } + } + + end { + + } +} From b6d8083b69c31954d876490a446410114aa6b159 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 4 Aug 2020 22:05:35 -0400 Subject: [PATCH 451/479] Remove-ZertoVpgVm update --- ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 | 102 ++++--------------- 1 file changed, 21 insertions(+), 81 deletions(-) diff --git a/ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 b/ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 index b34737a..f0e0b33 100644 --- a/ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 +++ b/ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 @@ -1,18 +1,7 @@ <# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Remove-ZertoVpgVm { - [CmdletBinding(SupportsShouldProcess, DefaultParameterSetName = "VpgName")] + [CmdletBinding(SupportsShouldProcess, ConfirmImpact = "High")] param ( - [Parameter( - Mandatory, - HelpMessage = "Vpg Settings Identifier", - ValueFromPipeline, - ValueFromPipelineByPropertyName, - ValueFromRemainingArguments, - ParameterSetName = "VpgSettingsIdentifier" - )] - [ValidateNotNullOrEmpty()] - [Alias("sid", "settingsIdentifier", "vpgSettingsId")] - [String]$vpgSettingsIdentifier, [Parameter( Mandatory, HelpMessage = "Name of the VPG that contains the VM you wish to remove", @@ -33,78 +22,29 @@ function Remove-ZertoVpgVm { } process { - switch ($PSCmdlet.ParameterSetName) { - "VpgName" { - $VpgData = Get-ZertoVpg -vpgName $VpgName - if (-not $VpgData) { - Write-Error "Unable to find Vpg with name $VpgName. Please check your parameters and try again." -ErrorAction Stop - } else { - $protectedVms = Get-ZertoProtectedVm -vpgName $VpgData.VpgName - $vpgSettingsIdentifier = New-ZertoVpgSettingsIdentifier -vpgIdentifier $VpgIdentifier - } - } - Default {} - } - - if ($PSCmdlet.ParameterSetName -eq "VpgName") { - - - } - $baseUrl = "vpgsettings/{0}/vms" -f $vpgSettingsIdentifier - $baseSettings = Get-ZertoVpgSetting -vpgSettingsIdentifier $vpgSettingsIdentifier - if ($PSCmdlet.ParameterSetName -eq "VpgSettingsIdentifier") { - $VpgName = $baseSettings.Basic.Name - } - $unprotectedVms = Get-ZertoUnprotectedVm - $protectedVms = Get-ZertoProtectedVm - $vmMap = Get-Map -inputObject $unprotectedVms -key VmName -value VmIdentifier - $vmMap = $vmMap + (Get-Map -inputObject $protectedVms -key VmName -value VmIdentifier) - # Create array of VM identifiers - $vmIdentifiers = foreach ($machine in ($Vm | Select-Object -Unique)) { - if ($vmMap[$machine] -notin $baseSettings.Vms.vmIdentifier ) { - # If the VM is unprotected, get the identifier - $vmIdentifier = $unprotectedVms | Where-Object { $_.vmName -like $machine } | Select-Object -ExpandProperty vmIdentifier - # If the VM is not unprotected, check the protected VMs - if ( -not $vmIdentifier) { - # Get all identifiers to test if the VM is eligible to be a member of an additional VPG - $results = $protectedVms | Where-Object { $_.VmName -like $machine } | Select-Object -ExpandProperty vmIdentifier - $recoverySiteIdentifiers = $protectedVms | Where-Object { $_.VmName -like $machine } | Select-Object -ExpandProperty RecoverySite | Select-Object -ExpandProperty identifier - # If VM is currently a member of 3 VPGs, skip it. If it cannot be found, skip it. Otherwise, set the identifier - if ($baseSettings.basic.RecoverySiteIdentifier -in $recoverySiteIdentifiers) { - Write-Warning "$machine is already replicating to target site. It cannot be added to an additional VPG replicating to that site. Please check your configurations and try again. Skipping $machine" - continue - } elseif ($results.count -eq 3) { - Write-Warning "$machine is already a part of 3 VPGs and cannot be part of an additional VPG. Skipping $machine" - continue - } elseif ($results.count -eq 0) { - Write-Warning "$machine not found. Skipping $machine" - continue - } else { - $vmIdentifier = $results | Select-Object -First 1 - } - } - # Create a custom object to store the information to easily convert to JSON. Return to vmIdentifiers array. - $vmIdentifier - } else { - Write-Warning "$machine is already a member of this VPG Settings object. It will not be added again. Skipping $machine" - continue - } - } - if ($vmIdentifiers.Count -gt 0 -and $PSCmdlet.ShouldProcess($VmIdentifiers, "Adding VM(s): $Vm to Vpg $VpgName")) { - foreach ($id in $VmIdentifiers) { - # Build the Body - $Body = @{VmIdentifier = $id } - # Submit the request. Out to Null to prevent line returns while running. - $null = Invoke-ZertoRestRequest -uri $baseUrl -method POST -body ($Body | ConvertTo-Json -Depth 10) - } - - $vpgSettingsIdentifier + $VpgData = Get-ZertoVpg -vpgName $VpgName + if (-not $VpgData) { + Write-Error "Unable to find Vpg with name $VpgName. Please check your parameters and try again." -ErrorAction Stop } else { - Write-Warning "No VMs found to add. Please check your parameters and try again." - if ($PSCmdlet.ParameterSetName -eq "VpgName") { - Remove-ZertoVpgSettingsIdentifier -vpgSettingsIdentifier $vpgSettingsIdentifier + $protectedVms = Get-ZertoProtectedVm -vpgName $VpgData.VpgName + } + $VmIdentifiers = foreach ($machine in ($vm | Select-Object -Unique)) { + if ($machine -in $protectedVms.VmName) { + $protectedVms.VmName.Where( { $_.VmName -like $machine }) | Select-Object -ExpandProperty VmIdentifier + } else { + Write-Warning "$machine is not found in $VpgName. Check your parameters. Skipping $machine" } } + if ($VmIdentifiers.Count -gt 0 -and $PSCmdlet.ShouldProcess(($Vm | Select-Object -Unique), "Removing VM(s): $($Vm | Select-Object -Unique) from Vpg $VpgName")) { + $vpgSettingsIdentifier = New-ZertoVpgSettingsIdentifier -vpgIdentifier $VpgData.VpgIdentifier + foreach ($identifier in $VmIdentifiers) { + $url = "vpgSettings/{0}/vms/{1}" -f $vpgSettingsIdentifier, $identifier + Invoke-ZertoRestRequest -uri $uri -method DELETE + } + Save-ZertoVpgSetting -vpgSettingsIdentifier $vpgSettingsIdentifier + } else { + Write-Warning "No VMs found to remove. Please check your parameters and try again." + } } end { From af6e81267bcff49e586521e08fc397d44f083936 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Aug 2020 07:45:55 -0400 Subject: [PATCH 452/479] Add Online Help URI --- docs/Add-ZertoVpgVm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Add-ZertoVpgVm.md b/docs/Add-ZertoVpgVm.md index 2aaf484..5997286 100644 --- a/docs/Add-ZertoVpgVm.md +++ b/docs/Add-ZertoVpgVm.md @@ -1,7 +1,7 @@ --- external help file: ZertoApiWrapper-help.xml Module Name: ZertoApiWrapper -online version: +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Add-ZertoVpgVm.md schema: 2.0.0 --- From 649e7413a7ec7d7b7d49212f9187fc8eeeeb12d3 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Aug 2020 07:46:11 -0400 Subject: [PATCH 453/479] Fix URL typo --- ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 b/ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 index f0e0b33..d1c0df6 100644 --- a/ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 +++ b/ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 @@ -39,7 +39,7 @@ function Remove-ZertoVpgVm { $vpgSettingsIdentifier = New-ZertoVpgSettingsIdentifier -vpgIdentifier $VpgData.VpgIdentifier foreach ($identifier in $VmIdentifiers) { $url = "vpgSettings/{0}/vms/{1}" -f $vpgSettingsIdentifier, $identifier - Invoke-ZertoRestRequest -uri $uri -method DELETE + Invoke-ZertoRestRequest -uri $url -method DELETE } Save-ZertoVpgSetting -vpgSettingsIdentifier $vpgSettingsIdentifier } else { From 6f798fd96af45fd706ee39e20f9980b887a284c0 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Aug 2020 08:22:19 -0400 Subject: [PATCH 454/479] Update VM Filter Method --- ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 b/ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 index d1c0df6..2af5029 100644 --- a/ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 +++ b/ZertoApiWrapper/Public/Remove-ZertoVpgVm.ps1 @@ -30,9 +30,9 @@ function Remove-ZertoVpgVm { } $VmIdentifiers = foreach ($machine in ($vm | Select-Object -Unique)) { if ($machine -in $protectedVms.VmName) { - $protectedVms.VmName.Where( { $_.VmName -like $machine }) | Select-Object -ExpandProperty VmIdentifier + $protectedVms.Where( { $_.VmName -like $machine }) | Select-Object -ExpandProperty VmIdentifier } else { - Write-Warning "$machine is not found in $VpgName. Check your parameters. Skipping $machine" + Write-Warning "Virtual Machine: '$machine' is not found in Vpg: '$VpgName'. Check your parameters. Skipping $machine" } } if ($VmIdentifiers.Count -gt 0 -and $PSCmdlet.ShouldProcess(($Vm | Select-Object -Unique), "Removing VM(s): $($Vm | Select-Object -Unique) from Vpg $VpgName")) { From 2dad34754474c80152632a4e2203eee51b57ca9a Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Aug 2020 08:41:55 -0400 Subject: [PATCH 455/479] Remove-ZertoVpgVm Help --- docs/Remove-ZertoVpgVm.md | 121 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 docs/Remove-ZertoVpgVm.md diff --git a/docs/Remove-ZertoVpgVm.md b/docs/Remove-ZertoVpgVm.md new file mode 100644 index 0000000..624c3b4 --- /dev/null +++ b/docs/Remove-ZertoVpgVm.md @@ -0,0 +1,121 @@ +--- +external help file: ZertoApiWrapper-help.xml +Module Name: ZertoApiWrapper +online version: https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Resume-ZertoVpgVm.md +schema: 2.0.0 +--- + +# Remove-ZertoVpgVm + +## SYNOPSIS +Removes one or more VMs from a specified VPG. A Task Identifier is returned to track progress. + +## SYNTAX + +``` +Remove-ZertoVpgVm -VpgName -Vm [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +Removes one or more VMs from a specified VPG. A Task Identifier is returned to track progress. Internal logic will remove duplicate VM names from the list of VMs provided as well as ensure membership in the VPG specified prior to attempting to remove the VM from the VPG. Finally the VPG is saved to commit the changes. ChangeImpact is set to 'High' to get the confirmation prompt. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Remove-ZertoVpgVm -VpgName 'My Vpg' -Vm 'Vm 1' +``` + +Removes 'Vm 1' from Vpg named 'My Vpg' + +### Example 2 +```powershell +PS C:\> Remove-ZertoVpgVm -VpgName 'My Vpg' -Vm 'Vm 1', 'Vm 2' +``` + +Removes 'Vm 1' and 'Vm 2' from Vpg named 'My Vpg'. + +### Example 3 +```powershell +PS C:\> Remove-ZertoVpgVm -VpgName 'My Vpg' -Vm 'Vm 1', 'Vm 2' -Confirm:$False +``` + +Removes 'Vm 1' and 'Vm 2' from Vpg named 'My Vpg' and bypasses the confirmation prompt + +## PARAMETERS + +### -Vm +Name of VM(s) to remove from the VPG + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -VpgName +Name of the VPG that contains the VM you wish to remove + +```yaml +Type: String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### None + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS +[Remove Vms from a VPG Settings Object](https://s3.amazonaws.com/zertodownload_docs/Latest/Zerto%20Virtual%20Replication%20Zerto%20Virtual%20Manager%20(ZVM)%20-%20vSphere%20Online%20Help/content/zvr_apis/vpg_management_api.htm?tocpath=ZVR%20RESTful%20APIs%7CZerto%20APIs%7C_____20#statusapis_4057192544_1361409) From 8d8cb58558819f19c0110d0f4df3a43c5d1c662d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Aug 2020 08:47:17 -0400 Subject: [PATCH 456/479] Remove-ZertoVpgVm Tests --- Tests/Public/Remove-ZertoVpgVm.Tests.ps1 | 52 ++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Tests/Public/Remove-ZertoVpgVm.Tests.ps1 diff --git a/Tests/Public/Remove-ZertoVpgVm.Tests.ps1 b/Tests/Public/Remove-ZertoVpgVm.Tests.ps1 new file mode 100644 index 0000000..12d2860 --- /dev/null +++ b/Tests/Public/Remove-ZertoVpgVm.Tests.ps1 @@ -0,0 +1,52 @@ +#Requires -Modules Pester +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -Leaf $PSCommandPath).Split('.'))[0] + +Describe $global:function -Tag 'Unit', 'Source', 'Built' { + BeforeAll { + $script:ScriptBlock = (Get-Command $global:function).ScriptBlock + } + + Context "$global:function::Parameter Unit Tests" { + + It "$global:function should have exactly 15 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 15 + } + + $ParameterTestCases = @( + @{ParameterName = 'Vm'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + @{ParameterName = 'VpgName'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } + ) + + It " parameter is of type" -TestCases $ParameterTestCases { + param($ParameterName, $Type, $Mandatory, $Validation) + Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type + } + + It " parameter has correct validation setting" -TestCases $ParameterTestCases { + param($ParameterName, $Validation) + Switch ($Validation) { + 'NotNullOrEmpty' { + $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes + $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 + } + + default { + $true | Should -Be $false -Because "No Validation Selected. Review test cases" + } + } + } + + It "Supports 'SupportsShouldProcess'" { + Get-Command $global:function | Should -HaveParameter WhatIf + Get-Command $global:function | Should -HaveParameter Confirm + $script:ScriptBlock | Should -Match 'SupportsShouldProcess' + $script:ScriptBlock | Should -Match '\$PSCmdlet\.ShouldProcess\(.+\)' + } + } + + Context "Add-ZertoPeerSite::Functional Unit Tests" { + } +} +Remove-Variable -Name here -Scope Global +Remove-Variable -Name function -Scope Global From c91d53ecad0e0967bb4a9529f89c947c7bf85b05 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 5 Aug 2020 09:34:35 -0400 Subject: [PATCH 457/479] Update with changes --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 341c6f1..bbc9387 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Zerto Virtual Manager + +#### New + +* Added `Add-ZertoVpgVm` function to the module. Read the [help file](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Add-ZertoVpgVm.md) for more information. +* Added `Remove-ZertoVpgVm` function to the module. Read the [help file](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Remove-ZertoVpgVm.md) for more information. + ## [1.4.3] ### Zerto Virtual Manager From ced5671ab2868fc77320a8fe40779b5422da4b91 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 20 Aug 2020 12:29:40 -0400 Subject: [PATCH 458/479] Update target host validation --- Tests/Public/Add-ZertoPeerSite.Tests.ps1 | 13 ++++--------- ZertoApiWrapper/Public/Add-ZertoPeerSite.ps1 | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 index 60a9fd3..81f590f 100644 --- a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester $global:here = (Split-Path -Parent $PSCommandPath) -$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] +$global:function = ((Split-Path -Leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { @@ -14,7 +14,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } $ParameterTestCases = @( - @{ParameterName = 'targetHost'; Type = 'String'; Mandatory = $true; Validation = 'Script' } + @{ParameterName = 'targetHost'; Type = 'String'; Mandatory = $true; Validation = 'NotNullOrEmpty' } @{ParameterName = 'targetPort'; Type = 'Int32'; Mandatory = $false; Validation = 'Range' } @{ParameterName = 'token'; Type = 'String'; Mandatory = $false; Validation = 'NotNullOrEmpty' } ) @@ -27,11 +27,6 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { It " parameter has correct validation setting" -TestCases $ParameterTestCases { param($ParameterName, $Validation) Switch ($Validation) { - 'Script' { - $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes - $attrs.Where{ $_ -is [ValidateScript] }.Count | Should -Be 1 - } - 'Range' { $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes $attrs.Where{ $_ -is [ValidateRange] }.Count | Should -Be 1 @@ -63,8 +58,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { It "Supports 'SupportsShouldProcess'" { Get-Command $global:function | Should -HaveParameter WhatIf Get-Command $global:function | Should -HaveParameter Confirm - $script:ScriptBlock | Should -match 'SupportsShouldProcess' - $script:ScriptBlock | Should -match '\$PSCmdlet\.ShouldProcess\(.+\)' + $script:ScriptBlock | Should -Match 'SupportsShouldProcess' + $script:ScriptBlock | Should -Match '\$PSCmdlet\.ShouldProcess\(.+\)' } } diff --git a/ZertoApiWrapper/Public/Add-ZertoPeerSite.ps1 b/ZertoApiWrapper/Public/Add-ZertoPeerSite.ps1 index e4bed27..6e1a050 100644 --- a/ZertoApiWrapper/Public/Add-ZertoPeerSite.ps1 +++ b/ZertoApiWrapper/Public/Add-ZertoPeerSite.ps1 @@ -6,7 +6,7 @@ function Add-ZertoPeerSite { Mandatory, HelpMessage = "Target Hostname or IP address to pair the localsite to." )] - [ValidateScript( { $_ -match [IPAddress]$_ } )] + [ValidateNotNullOrEmpty()] [string]$targetHost, [Parameter( HelpMessage = "Target communication port. Default is 9081" From 23e0b8a6652413bd33acdd39f5f31b79d2b97d51 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Thu, 20 Aug 2020 13:25:37 -0400 Subject: [PATCH 459/479] Prepping for next release --- .vscode/settings.json | 3 ++- CHANGELOG.md | 6 +++++- version.txt | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 7331185..1b91392 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,5 +4,6 @@ "editor.insertSpaces": true, "editor.tabSize": 4, "powershell.codeFormatting.preset": "OTBS", - "terminal.integrated.shell.windows": "c:/Program Files/PowerShell/7/pwsh.exe" + "terminal.integrated.shell.windows": "c:/Program Files/PowerShell/7/pwsh.exe", + "powershell.codeFormatting.addWhitespaceAroundPipe": true } diff --git a/CHANGELOG.md b/CHANGELOG.md index bbc9387..beb3345 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## [1.5.0] ### Zerto Virtual Manager @@ -14,6 +14,10 @@ and this project is transitioning to [Semantic Versioning](https://semver.org/sp * Added `Add-ZertoVpgVm` function to the module. Read the [help file](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Add-ZertoVpgVm.md) for more information. * Added `Remove-ZertoVpgVm` function to the module. Read the [help file](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/Remove-ZertoVpgVm.md) for more information. +#### Fixed + +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/103) with `Add-ZertoPeerSite` where there was an incorrect settings validator on the `-targetHost` parameter where it would not accept a hostname. + ## [1.4.3] ### Zerto Virtual Manager diff --git a/version.txt b/version.txt index 428b770..bc80560 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.4.3 +1.5.0 From 0630cbb20e0c9ccb512a26f01575b02c7dec2065 Mon Sep 17 00:00:00 2001 From: Brownstein Date: Fri, 21 Aug 2020 21:04:15 -0400 Subject: [PATCH 460/479] new param sets, pipeline input --- ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 | 121 ++++++++++++-------- 1 file changed, 75 insertions(+), 46 deletions(-) diff --git a/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 index 476f7d3..6ea5d04 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 @@ -1,22 +1,57 @@ <# .ExternalHelp ./en-us/ZertoApiWrapper-help.xml #> function Invoke-ZertoMove { - [CmdletBinding( DefaultParameterSetName = "main", SupportsShouldProcess = $true )] + [CmdletBinding( DefaultParameterSetName = "id", SupportsShouldProcess = $true )] param( [Parameter( + ParameterSetName = 'name', + HelpMessage = "Name(s) of the VPG(s) you want to move.", + Mandatory + )] + [Parameter( + ParameterSetName = 'commitName', HelpMessage = "Name(s) of the VPG(s) you want to move.", Mandatory )] [ValidateNotNullOrEmpty()] [string[]]$vpgName, [Parameter( + ParameterSetName = 'id', + HelpMessage = "ID(s) of the VPG(s) you want to move.", + Mandatory, + ValueFromPipelineByPropertyName + )] + [Parameter( + ParameterSetName = 'commitId', + HelpMessage = "ID(s) of the VPG(s) you want to move.", + Mandatory, + ValueFromPipelineByPropertyName + )] + [ValidateNotNullOrEmpty()] + [guid[]]$vpgIdentifier, + [Parameter( + ParameterSetName = 'commitName', HelpMessage = "'Rollback': After the seconds specified in the commitValue setting have elapsed, the failover is rolled back. 'Commit': After the seconds specified in the commitValue setting have elapsed, the failover continues, committing the virtual machines in the recovery site. 'None': The virtual machines in the VPG being failed over remain in the Before Commit state until either they are committed with Commit a failover, or rolled back with Roll back a failover. - Default is the Site Settings setting." + Default is the Site Settings setting.", + Mandatory + )] + [Parameter( + ParameterSetName = 'commitId', + HelpMessage = "'Rollback': After the seconds specified in the commitValue setting have elapsed, the failover is rolled back. + 'Commit': After the seconds specified in the commitValue setting have elapsed, the failover continues, committing the virtual machines in the recovery site. + 'None': The virtual machines in the VPG being failed over remain in the Before Commit state until either they are committed with Commit a failover, or rolled back with Roll back a failover. + Default is the Site Settings setting.", + Mandatory )] [ValidateSet("Rollback", "Commit", "None")] [string]$commitPolicy, [Parameter( + ParameterSetName = 'commitName', + HelpMessage = "The amount of time, in seconds, the Move is in a 'Before Commit' state, before performing the commitPolicy setting. If omitted, the site settings default will be applied." + )] + [Parameter( + ParameterSetName = 'commitId', HelpMessage = "The amount of time, in seconds, the Move is in a 'Before Commit' state, before performing the commitPolicy setting. If omitted, the site settings default will be applied." )] # Min 5 Minutes, Max 24 Hours, Default Site Settigns. @@ -27,15 +62,11 @@ function Invoke-ZertoMove { )] [switch]$forceShutdown, [Parameter( - ParameterSetName = "disableReverseProtection", - HelpMessage = "Do not enable reverse protection. The VPG definition is kept with the status Needs Configuration and the reverse settings in the VPG definition are not set.", - Mandatory + HelpMessage = "Do not enable reverse protection. The VPG definition is kept with the status Needs Configuration and the reverse settings in the VPG definition are not set." )] [switch]$disableReverseProtection, [Parameter( - ParameterSetName = "keepSourceVms", - HelpMessage = "Prevent the protected virtual machines from being deleted in the protected site. Using this setting disables reverse protection.", - Mandatory + HelpMessage = "Prevent the protected virtual machines from being deleted in the protected site. Using this setting disables reverse protection." )] [switch]$keepSourceVms, [Parameter( @@ -46,52 +77,50 @@ function Invoke-ZertoMove { begin { $baseUri = "vpgs" + $body = @{ + forceShutdown = $forceShutdown.IsPresent + ContinueOnPreScriptFailure = $ContinueOnPreScriptFailure.IsPresent + keepSourceVms = $keepSourceVms.IsPresent + reverseProtection = -not $disableReverseProtection.IsPresent + } + + if ( $keepSourceVms -and -not $disableReverseProtection ) { + Write-Verbose 'Disabling reverse protection as keepSourceVms requires it' + $body['reverseProtection'] = $false + } + + if ($PSBoundParameters.ContainsKey('commitPolicy')) { + $body['commitPolicy'] = $commitPolicy + if ($PSBoundParameters.ContainsKey('commitPolicyTimeout')) { + $body['commitPolicyTimeout'] = $commitPolicyTimeout + } + } } process { - $body = @{ } - #TODO - use a foreach loop to populate the body without all the if statments - if ($PSBoundParameters.ContainsKey('commitPolicy')) { - $body['commitPolicy'] = $commitPolicy - } - if ($PSBoundParameters.ContainsKey('commitPolicyTimeout')) { - $body['commitPolicyTimeout'] = $commitPolicyTimeout - } - if ($PSBoundParameters.ContainsKey('forceShutdown')) { - $body['forceShutdown'] = $true - } else { - $body['forceShutdown'] = $false - } - if ($PSBoundParameters.ContainsKey('ContinueOnPreScriptFailure')) { - $body['ContinueOnPreScriptFailure'] = $true - } else { - $body['ContinueOnPreScriptFailure'] = $false - } + switch ($PSCmdlet.ParameterSetName) { - "disableReverseProtection" { - $body['reverseProtection'] = $false - $body['keepSourceVms'] = $false + { $_ -in 'name', 'commitName' } { + $vpgIds = foreach ($name in $vpgName) { + $vpgId = $(Get-ZertoVpg -name $name).vpgIdentifier + if ( -not $vpgId ) { + Write-Error "VPG: '$name' not found. Please check the name and try again. Skipping" + } else { + Write-Verbose "VPG: $name, ID: $vpgId" + $vpgId + } + } } - "keepSourceVms" { - $body['reverseProtection'] = $false - $body['keepSourceVms'] = $true - } - - "main" { - $body['reverseProtection'] = $true - $body['keepSourceVms'] = $false + { $_ -in 'id', 'commitId' } { + $vpgIds = $vpgIdentifier } } - foreach ($name in $vpgName) { - $vpgId = $(Get-ZertoVpg -name $name).vpgIdentifier - if ( -not $vpgId ) { - Write-Error "VPG: $name not found. Please check the name and try again. Skipping" - } else { - $uri = "{0}/{1}/move" -f $baseUri, $vpgId - if ($PSCmdlet.ShouldProcess("Moving VPG: $name with settings: $($body | convertto-json)")) { - Invoke-ZertoRestRequest -uri $uri -method "POST" -body $($body | ConvertTo-Json) - } + + foreach ($thisId in $vpgIds) { + $uri = "{0}/{1}/move" -f $baseUri, $thisId + if ($PSCmdlet.ShouldProcess("Moving VPG: $thisId with settings: $($body | ConvertTo-Json)")) { + Invoke-ZertoRestRequest -uri $uri -method "POST" -body $($body | ConvertTo-Json) } } } From eea6e959881ee1ca0d772f4c187f89cabb445c5f Mon Sep 17 00:00:00 2001 From: Brownstein Date: Thu, 27 Aug 2020 15:08:28 -0400 Subject: [PATCH 461/479] update test and help files --- Tests/Public/Invoke-ZertoMove.Tests.ps1 | 8 +-- docs/Invoke-ZertoMove.md | 73 +++++++++++++++++++------ 2 files changed, 59 insertions(+), 22 deletions(-) diff --git a/Tests/Public/Invoke-ZertoMove.Tests.ps1 b/Tests/Public/Invoke-ZertoMove.Tests.ps1 index aaca87b..d3b398b 100644 --- a/Tests/Public/Invoke-ZertoMove.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMove.Tests.ps1 @@ -5,8 +5,8 @@ $global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - It "$global:function should have exactly 20 parameters defined" { - (Get-Command $global:function).Parameters.Count | Should -Be 20 + It "$global:function should have exactly 21 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 21 } $ParameterTestCases = @( @@ -14,8 +14,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { @{ParameterName = 'commitPolicy'; Type = 'String'; Mandatory = $false; Validation = 'Set' } @{ParameterName = 'commitPolicyTimeout'; Type = 'Int'; Mandatory = $false; Validation = 'Range' } @{ParameterName = 'forceShutdown'; Type = 'Switch'; Mandatory = $false; Validation = $null } - @{ParameterName = 'disableReverseProtection'; Type = 'Switch'; Mandatory = $true; Validation = $null } - @{ParameterName = 'keepSourceVms'; Type = 'Switch'; Mandatory = $true; Validation = $null } + @{ParameterName = 'disableReverseProtection'; Type = 'Switch'; Mandatory = $false; Validation = $null } + @{ParameterName = 'keepSourceVms'; Type = 'Switch'; Mandatory = $false; Validation = $null } @{ParameterName = 'ContinueOnPreScriptFailure'; Type = 'Switch'; Mandatory = $false; Validation = $null } @{ParameterName = 'whatIf'; Type = 'Switch'; Mandatory = $false; Validation = 'ShouldProcess' } ) diff --git a/docs/Invoke-ZertoMove.md b/docs/Invoke-ZertoMove.md index eb1c661..030ba21 100644 --- a/docs/Invoke-ZertoMove.md +++ b/docs/Invoke-ZertoMove.md @@ -12,22 +12,30 @@ Start a move of a VPG. ## SYNTAX -### main (Default) +### id (Default) ``` -Invoke-ZertoMove -vpgName [-commitPolicy ] [-commitPolicyTimeout ] [-forceShutdown] +Invoke-ZertoMove -vpgIdentifier [-forceShutdown] [-disableReverseProtection] [-keepSourceVms] [-ContinueOnPreScriptFailure] [-WhatIf] [-Confirm] [] ``` -### disableReverseProtection +### commitName ``` -Invoke-ZertoMove -vpgName [-commitPolicy ] [-commitPolicyTimeout ] [-forceShutdown] - [-disableReverseProtection] [-ContinueOnPreScriptFailure] [-WhatIf] [-Confirm] [] +Invoke-ZertoMove -vpgName -commitPolicy [-commitPolicyTimeout ] [-forceShutdown] + [-disableReverseProtection] [-keepSourceVms] [-ContinueOnPreScriptFailure] [-WhatIf] [-Confirm] + [] ``` -### keepSourceVms +### name ``` -Invoke-ZertoMove -vpgName [-commitPolicy ] [-commitPolicyTimeout ] [-forceShutdown] - [-keepSourceVms] [-ContinueOnPreScriptFailure] [-WhatIf] [-Confirm] [] +Invoke-ZertoMove -vpgName [-forceShutdown] [-disableReverseProtection] [-keepSourceVms] + [-ContinueOnPreScriptFailure] [-WhatIf] [-Confirm] [] +``` + +### commitId +``` +Invoke-ZertoMove -vpgIdentifier -commitPolicy [-commitPolicyTimeout ] [-forceShutdown] + [-disableReverseProtection] [-keepSourceVms] [-ContinueOnPreScriptFailure] [-WhatIf] [-Confirm] + [] ``` ## DESCRIPTION @@ -37,10 +45,24 @@ Start a move of a VPG. ### Example 1 ```powershell -PS C:\> Invoke-ZertoMove -vpgName "MyVpg" +PS C:\> Invoke-ZertoMove -vpgName 'MyVpg' ``` -Starts a move operation of VPG "MyVpg" +Specify the name of a vpg to move + +### Example 2 +```powershell +PS C:\> Invoke-ZertoMove -vpgIdentifier '2fbbf6b5-cddc-4653-b1fe-564f069eeb64' +``` + +Specify the identifier of a vpg to move + +### Example 3 +```powershell +PS C:\> Get-ZertoVpg | Invoke-ZertoMove +``` + +Utilize the pipeline to move multiple vpgs ## PARAMETERS @@ -55,11 +77,11 @@ Default is the Site Settings setting. ```yaml Type: String -Parameter Sets: (All) +Parameter Sets: commitName, commitId Aliases: Accepted values: Rollback, Commit, None -Required: False +Required: True Position: Named Default value: None Accept pipeline input: False @@ -72,7 +94,7 @@ If omitted, the site settings default will be applied. ```yaml Type: Int32 -Parameter Sets: (All) +Parameter Sets: commitName, commitId Aliases: Required: False @@ -102,10 +124,10 @@ Do not enable reverse protection. The VPG definition is kept with the status Nee ```yaml Type: SwitchParameter -Parameter Sets: disableReverseProtection +Parameter Sets: (All) Aliases: -Required: True +Required: False Position: Named Default value: None Accept pipeline input: False @@ -132,13 +154,28 @@ Use this switch to Prevent the protected virtual machines from being deleted in ```yaml Type: SwitchParameter -Parameter Sets: keepSourceVms +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -vpgIdentifier +ID(s) of the VPG(s) you want to move. + +```yaml +Type: Guid[] +Parameter Sets: id, commitId Aliases: Required: True Position: Named Default value: None -Accept pipeline input: False +Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` @@ -147,7 +184,7 @@ Name(s) of the VPG(s) you want to move. ```yaml Type: String[] -Parameter Sets: (All) +Parameter Sets: commitName, name Aliases: Required: True From 139e52f3e27f85bb41261dfe8de38d0ee327fcf9 Mon Sep 17 00:00:00 2001 From: Brownstein Date: Thu, 27 Aug 2020 15:28:01 -0400 Subject: [PATCH 462/479] add new parameter to test --- Tests/Public/Invoke-ZertoMove.Tests.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/Public/Invoke-ZertoMove.Tests.ps1 b/Tests/Public/Invoke-ZertoMove.Tests.ps1 index d3b398b..efb1260 100644 --- a/Tests/Public/Invoke-ZertoMove.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMove.Tests.ps1 @@ -10,6 +10,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } $ParameterTestCases = @( + @{ParameterName = 'vpgIdentifier'; Type = 'Guid[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } @{ParameterName = 'vpgName'; Type = 'String[]'; Mandatory = $true; Validation = 'NotNullOrEmpty' } @{ParameterName = 'commitPolicy'; Type = 'String'; Mandatory = $false; Validation = 'Set' } @{ParameterName = 'commitPolicyTimeout'; Type = 'Int'; Mandatory = $false; Validation = 'Range' } From f0279633dd86a521b6fdad365afdc9e6285374b9 Mon Sep 17 00:00:00 2001 From: Brownstein Date: Fri, 28 Aug 2020 13:43:22 -0400 Subject: [PATCH 463/479] add missing .IsPresent for switch value --- ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 b/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 index 6ea5d04..a63bb98 100644 --- a/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 +++ b/ZertoApiWrapper/Public/Invoke-ZertoMove.ps1 @@ -84,7 +84,7 @@ function Invoke-ZertoMove { reverseProtection = -not $disableReverseProtection.IsPresent } - if ( $keepSourceVms -and -not $disableReverseProtection ) { + if ( $keepSourceVms.IsPresent -and -not $disableReverseProtection.IsPresent ) { Write-Verbose 'Disabling reverse protection as keepSourceVms requires it' $body['reverseProtection'] = $false } From e6b5777e64f33f41e246dcf509a1501cd1dfdbcc Mon Sep 17 00:00:00 2001 From: jonsouzerto <57370019+jonsouzerto@users.noreply.github.com> Date: Thu, 3 Sep 2020 12:45:35 -0400 Subject: [PATCH 464/479] Updated recovery host key Attempting to resolve issue 108 --- ZertoApiWrapper/Public/New-ZertoVpg.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 index 710f51d..582e0cc 100644 --- a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 @@ -295,11 +295,11 @@ function New-ZertoVpg { "recoveryHostDatastoreCluster" { $baseSettings.Recovery.DefaultDatastoreClusterIdentifier = $identifiersTable['datastoreClusterIdentifier'] - $baseSettings.Recovery.DefaultHostIdentifier = $identifiersTable['hostIdentifier'] + $baseSettings.Recovery.DefaultHostIdentifier = $identifiersTable['recoveryHostIdentifier'] } "recoveryHostDatastore" { - $baseSettings.Recovery.DefaultHostIdentifier = $identifiersTable['hostIdentifier'] + $baseSettings.Recovery.DefaultHostIdentifier = $identifiersTable['recoveryHostIdentifier'] $baseSettings.Recovery.DefaultDatastoreIdentifier = $identifiersTable['datastoreIdentifier'] } From bb5dbaa0d46c2a3cf63d3c6f5f504e5ada1a811a Mon Sep 17 00:00:00 2001 From: jonsouzerto <57370019+jonsouzerto@users.noreply.github.com> Date: Thu, 3 Sep 2020 12:50:49 -0400 Subject: [PATCH 465/479] Update CHANGELOG.md Added fix information --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index beb3345..0c82604 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Zerto Virtual Manager + +#### Fixed + +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/108) with `New-ZertoVpg` where the Host Identifier was incorrect when inputting a single recovery host, changed to recoveryHostIdentifier. + ## [1.5.0] ### Zerto Virtual Manager From 5c2dd620d88a09e5fbf9a3e725fbe8cf8990e981 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 8 Sep 2020 08:20:29 -0400 Subject: [PATCH 466/479] Update for Release Notes --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c82604..ffc6a35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## [1.5.1] ### Zerto Virtual Manager #### Fixed -* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/108) with `New-ZertoVpg` where the Host Identifier was incorrect when inputting a single recovery host, changed to recoveryHostIdentifier. +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/108) with `New-ZertoVpg` where when specifying a single host as a recovery target, the host identifier was not properly assigned. - Thanks @jonsouzerto! +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/86) with `Invoke-ZertoMoveVpg` where parameters should have been mandatory in certain workflows. - Thanks @gdbarron! ## [1.5.0] From e6e6be9eded0b209d547a15b18412764a7eaa7c9 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Tue, 8 Sep 2020 08:21:10 -0400 Subject: [PATCH 467/479] Bump Version --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index bc80560..26ca594 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.5.0 +1.5.1 From 0eaf89608be745252bc57f07132482764d39e9f2 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 19 Oct 2020 18:22:10 -0400 Subject: [PATCH 468/479] Clean up VPG Settings Identifier --- ZertoApiWrapper/Public/Export-ZertoVpg.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/ZertoApiWrapper/Public/Export-ZertoVpg.ps1 b/ZertoApiWrapper/Public/Export-ZertoVpg.ps1 index 2d00a83..2d71999 100644 --- a/ZertoApiWrapper/Public/Export-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/Export-ZertoVpg.ps1 @@ -38,6 +38,7 @@ function Export-ZertoVpg { $vpgSettings = Get-ZertoVpgSetting -vpgSettingsIdentifier $vpgSettingsIdentifier $filePath = "{0}\{1}.json" -f $outputPath, $name $vpgSettings | Convertto-Json -depth 10 | Out-File -FilePath $filePath + $null = Remove-ZertoVpgSettingsIdentifier -vpgSettingsIdentifier $vpgSettingsIdentifier } } From 84b79221569b7b10f3da008f202cc3872a439e5f Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 19 Oct 2020 18:24:08 -0400 Subject: [PATCH 469/479] Update CHANGELOG --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffc6a35..835a733 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.5.2] + +### Zerto Virtual Manager + +#### Fixed + +* Fixed an issue when attempting to export more than 100 VPGs with the `Export-ZertoVpg` function that would cause an error. + ## [1.5.1] ### Zerto Virtual Manager From d3d01f892f685929e2fb687600a2bfcd71ea8d4b Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 19 Oct 2020 18:35:30 -0400 Subject: [PATCH 470/479] Bump Version --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 26ca594..4cda8f1 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.5.1 +1.5.2 From 4ac951607bc7ba06d4c58efa656b4aed8d6eda29 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 19 Oct 2020 18:43:13 -0400 Subject: [PATCH 471/479] Add required Mock --- Tests/Public/Export-ZertoVpg.Tests.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tests/Public/Export-ZertoVpg.Tests.ps1 b/Tests/Public/Export-ZertoVpg.Tests.ps1 index 957092a..0e5ec77 100644 --- a/Tests/Public/Export-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Export-ZertoVpg.Tests.ps1 @@ -46,6 +46,10 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { return "1024d377-afb8-4880-82f0-96eeff413ffd" } + Mock -ModuleName ZertoApiWrapper -CommandName Remove-ZertoVpgSettingsIdentifier { + return $null + } + Mock -ModuleName ZertoApiWrapper -CommandName Get-ZertoVpgSetting { $returnObj = @{ Backup = $null From af33715f02dd1886c30f60fc3f7a281b75a3ba23 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 9 Dec 2020 16:13:50 -0500 Subject: [PATCH 472/479] SiteId Query to VirtualizationSites Fixes #112 --- ZertoApiWrapper/Public/New-ZertoVpg.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 index 582e0cc..e8f3a92 100644 --- a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 @@ -165,7 +165,7 @@ function New-ZertoVpg { begin { # Create an identifiers table, and start converting names to identifiers. $identifiersTable = @{ } - $identifiersTable['recoverySiteIdentifier'] = (Get-ZertoPeerSite).Where({$_.PeerSiteName -like $recoverySite}) | Select-Object -ExpandProperty SiteIdentifier + $identifiersTable['recoverySiteIdentifier'] = (Get-ZertoVirtualizationSite).Where( { $_.VirtualizationSiteName -like $recoverySite }) | Select-Object -ExpandProperty SiteIdentifier $peerSiteNetworks = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -networks) $identifiersTable['failoverNetworkIdentifier'] = $peerSiteNetworks | Where-Object { $_.VirtualizationNetworkName -like $recoveryNetwork } | Select-Object -ExpandProperty NetworkIdentifier $identifiersTable['testNetworkIdentifier'] = $peerSiteNetworks | Where-Object { $_.VirtualizationNetworkName -like $testNetwork } | Select-Object -ExpandProperty NetworkIdentifier From 06e81b46d690d5de3a04106fbbb7cf38947867b6 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 9 Dec 2020 17:09:53 -0500 Subject: [PATCH 473/479] Update CHANGELOG for #112 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 835a733..a720f31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Zerto Virtual Manager + +#### Fixed + +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/112) where `New-ZertoVpg` would fail when specifying the localsite as the target site. + ## [1.5.2] ### Zerto Virtual Manager From 1daac508b222b4228426024723567b10b8790ca1 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 16 Dec 2020 09:42:23 -0500 Subject: [PATCH 474/479] Update SiteId Lookup Method --- ZertoApiWrapper/Public/New-ZertoVpg.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 index e8f3a92..d46b818 100644 --- a/ZertoApiWrapper/Public/New-ZertoVpg.ps1 +++ b/ZertoApiWrapper/Public/New-ZertoVpg.ps1 @@ -165,7 +165,7 @@ function New-ZertoVpg { begin { # Create an identifiers table, and start converting names to identifiers. $identifiersTable = @{ } - $identifiersTable['recoverySiteIdentifier'] = (Get-ZertoVirtualizationSite).Where( { $_.VirtualizationSiteName -like $recoverySite }) | Select-Object -ExpandProperty SiteIdentifier + $identifiersTable['recoverySiteIdentifier'] = Get-ZertoVirtualizationSite | Where-Object { $_.VirtualizationSiteName -like $recoverySite } | Select-Object -ExpandProperty SiteIdentifier $peerSiteNetworks = $(Get-ZertoVirtualizationSite -siteIdentifier $identifiersTable['recoverySiteIdentifier'] -networks) $identifiersTable['failoverNetworkIdentifier'] = $peerSiteNetworks | Where-Object { $_.VirtualizationNetworkName -like $recoveryNetwork } | Select-Object -ExpandProperty NetworkIdentifier $identifiersTable['testNetworkIdentifier'] = $peerSiteNetworks | Where-Object { $_.VirtualizationNetworkName -like $testNetwork } | Select-Object -ExpandProperty NetworkIdentifier From 1513cd4f4b14cf450655b5734a02f366ee8a09e9 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 16 Dec 2020 09:42:48 -0500 Subject: [PATCH 475/479] Update Synopsis --- docs/New-ZertoVpg.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/New-ZertoVpg.md b/docs/New-ZertoVpg.md index e8a69d4..8c95ba6 100644 --- a/docs/New-ZertoVpg.md +++ b/docs/New-ZertoVpg.md @@ -8,7 +8,7 @@ schema: 2.0.0 # New-ZertoVpg ## SYNOPSIS -Creates a New VPG with default settings only. Customization of VM settings can be accomplished with other module level functions. +Creates a New VPG with default settings only. Customization of VM settings can be accomplished with other module level functions. Returns a VpgSettingsIdentifier to be passed into the `Save-ZertoVpgSetting` function to create the VPG. ## SYNTAX From d413374c099fb2b414ae19bf44dff555b113ef3d Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 16 Dec 2020 09:43:22 -0500 Subject: [PATCH 476/479] CHANGLOG Updates --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a720f31..3d81fa1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,12 @@ and this project is transitioning to [Semantic Versioning](https://semver.org/sp #### Fixed -* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/112) where `New-ZertoVpg` would fail when specifying the localsite as the target site. +* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/112) where `New-ZertoVpg` would fail when specifying the local site as the target site. +* Updated the method where a Site Identifer is obtained during the `New-ZertoVpg` execution that would occasionally fail on some versions of PowerShell. + +#### Updated + +* Updated `New-ZertoVpg` function [help documentation](https://github.com/ZertoPublic/ZertoApiWrapper/blob/master/docs/New-ZertoVpg.md) to more clearly specify the return value and the requirement to pass it into the `Save-ZertoVpgSetting` function to commit the VPG. ## [1.5.2] From f06157c75e8feee6d218146c4ff22b47ca61487e Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Wed, 16 Dec 2020 13:10:02 -0500 Subject: [PATCH 477/479] Bump Version for Release --- CHANGELOG.md | 2 +- version.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d81fa1..1ff98e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project is transitioning to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [1.5.3] ### Zerto Virtual Manager diff --git a/version.txt b/version.txt index 4cda8f1..8af85be 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.5.2 +1.5.3 From 55b6614a69026496af69975d50c1f220bfcc76d4 Mon Sep 17 00:00:00 2001 From: Mitchell Enfinger Date: Wed, 16 Feb 2022 13:51:46 -0500 Subject: [PATCH 478/479] added lines for multiple CPUs --- ZertoApiWrapper/Public/Install-ZertoVra.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ZertoApiWrapper/Public/Install-ZertoVra.ps1 b/ZertoApiWrapper/Public/Install-ZertoVra.ps1 index 3ce61d2..eb76faa 100644 --- a/ZertoApiWrapper/Public/Install-ZertoVra.ps1 +++ b/ZertoApiWrapper/Public/Install-ZertoVra.ps1 @@ -25,6 +25,11 @@ function Install-ZertoVra { )] [ValidateRange(1, 16)] [int]$memoryInGB = 3, + [Parameter( + HelpMessage = "Initial number of CPUs to assign to the VRA. Default is 1, Minimum is 1, Maximum is 4" + )] + [ValidateRange(1, 4)] + [int]$NumOfCpus = 1, [Parameter( HelpMessage = "Bandwidth group to assign to the VRA. If unspecified will assign to the 'default_group'" )] @@ -136,6 +141,7 @@ function Install-ZertoVra { } $vraBasic['HostIdentifier'] = $hostIdentifier.toString() $vraBasic['MemoryInGB'] = $memoryInGB + $vraBasic['NumOfCpus'] = $NumOfCpus $vraBasic['NetworkIdentifier'] = $networkIdentifier.toString() $vraBasic['UsePublicKeyInsteadOfCredentials'] = $true $vraBasicNetwork = [ordered]@{ } From 4b1506f962aac6285116d376ec8eb5c2e023bca5 Mon Sep 17 00:00:00 2001 From: Mitchell Enfinger Date: Wed, 16 Feb 2022 14:23:38 -0500 Subject: [PATCH 479/479] forgot to include the test changes --- Tests/Public/Install-ZertoVra.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Public/Install-ZertoVra.Tests.ps1 b/Tests/Public/Install-ZertoVra.Tests.ps1 index a5005d3..221000f 100644 --- a/Tests/Public/Install-ZertoVra.Tests.ps1 +++ b/Tests/Public/Install-ZertoVra.Tests.ps1 @@ -6,7 +6,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { It "$global:function should have exactly 24 parameters defined" { - (Get-Command $global:function).Parameters.Count | Should -Be 24 + (Get-Command $global:function).Parameters.Count | Should -Be 25 } $ParameterTestCases = @(