Merge pull request #78 from ZertoPublic/Update-Function-Tests
Update function tests
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
# 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.
|
||||
* 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
|
||||
|
||||
* 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
|
||||
|
||||
* 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)
|
||||
@@ -1,5 +0,0 @@
|
||||
|
||||
|
||||
### Zerto Virtual Manager
|
||||
|
||||
* Refactored `Copy-ZertoVpg` functionality to leverage identifier and name maps and eliminate `where-object` searches.
|
||||
@@ -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'" {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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' }
|
||||
|
||||
@@ -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'
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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 [Release Notes](https://github.com/ZertoPublic/ZertoApiWrapper/releases/tag/{0}) on GitHub." -f $version
|
||||
|
||||
$ManifestParams = @{
|
||||
Path = "$BuildRoot\temp\ZertoApiWrapper.psd1"
|
||||
@@ -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'
|
||||
@@ -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
|
||||
@@ -204,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"
|
||||
|
||||
@@ -3,7 +3,7 @@ function Get-ZertoApiFilter {
|
||||
[Outputtype([String])]
|
||||
param(
|
||||
[Parameter(
|
||||
Mandatory = $true,
|
||||
Mandatory,
|
||||
HelpMessage = "Hashtable that contains filter keys and values"
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
|
||||
@@ -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]$_ } )]
|
||||
|
||||
@@ -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."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ function Edit-ZertoVra {
|
||||
[cmdletbinding( SupportsShouldProcess = $true )]
|
||||
param(
|
||||
[Parameter(
|
||||
Mandatory = $true,
|
||||
Mandatory,
|
||||
HelpMessage = "Identifier of the VRA to be updated."
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -17,7 +17,7 @@ function Get-ZAAlert {
|
||||
[Parameter(
|
||||
HelpMessage = "The alert Idnetifier",
|
||||
ParameterSetName = "alertId",
|
||||
Mandatory = $true
|
||||
Mandatory
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$alertIdentifier
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -17,7 +17,7 @@ function Get-ZATask {
|
||||
[Parameter(
|
||||
HelpMessage = "The task Idnetifier",
|
||||
ParameterSetName = "taskId",
|
||||
Mandatory = $true
|
||||
Mandatory
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$taskIdentifier
|
||||
|
||||
@@ -11,7 +11,7 @@ function Get-ZAVpg {
|
||||
[Parameter(
|
||||
HelpMessage = "The VPG Identifier",
|
||||
ParameterSetName = "vpg",
|
||||
Mandatory = $true
|
||||
Mandatory
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$vpgIdentifier
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4,7 +4,7 @@ function Import-ZertoVpg {
|
||||
param(
|
||||
[Parameter(
|
||||
HelpMessage = "VPG settings JSON file(s) to import.",
|
||||
Mandatory = $true,
|
||||
Mandatory,
|
||||
ValueFromPipeline = $true,
|
||||
ValueFromPipelineByPropertyName = $true
|
||||
)]
|
||||
|
||||
@@ -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())) {
|
||||
|
||||
@@ -4,7 +4,7 @@ function Invoke-ZertoFailoverCommit {
|
||||
param(
|
||||
[Parameter(
|
||||
HelpMessage = "Name(s) of the VPG(s) to commit.",
|
||||
Mandatory = $true
|
||||
Mandatory
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string[]]$vpgName,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4,7 +4,7 @@ function Invoke-ZertoForceSync {
|
||||
param(
|
||||
[Parameter(
|
||||
HelpMessage = "Name(s) of VPG(s) to force sync",
|
||||
Mandatory = $true
|
||||
Mandatory
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string[]]$vpgName
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -4,7 +4,7 @@ function Resume-ZertoVpg {
|
||||
param(
|
||||
[Parameter(
|
||||
HelpMessage = "Name(s) of VPG(s) to resume replication",
|
||||
Mandatory = $true
|
||||
Mandatory
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string[]]$vpgName
|
||||
|
||||
@@ -6,7 +6,7 @@ function Save-ZertoVpgSetting {
|
||||
param(
|
||||
[Parameter(
|
||||
HelpMessage = "VpgSettings Identifier to save",
|
||||
Mandatory = $true,
|
||||
Mandatory,
|
||||
ValueFromPipeline = $true,
|
||||
ValueFromPipelineByPropertyName = $true
|
||||
)]
|
||||
@@ -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 {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ function Start-ZertoFailoverTest {
|
||||
param(
|
||||
[Parameter(
|
||||
HelpMessage = "Name of VPG to failover test",
|
||||
Mandatory = $true
|
||||
Mandatory
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$vpgName,
|
||||
|
||||
@@ -4,7 +4,7 @@ function Stop-ZertoCloneVpg {
|
||||
param(
|
||||
[Parameter(
|
||||
HelpMessage = "Name of the VPG to stop cloning",
|
||||
Mandatory = $true
|
||||
Mandatory
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$vpgName
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -4,7 +4,7 @@ function Suspend-ZertoVpg {
|
||||
param(
|
||||
[Parameter(
|
||||
HelpMessage = "Name(s) of VPG(s) to pause replication",
|
||||
Mandatory = $true
|
||||
Mandatory
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string[]]$vpgName
|
||||
|
||||
@@ -3,7 +3,7 @@ function Uninstall-ZertoVra {
|
||||
[cmdletbinding()]
|
||||
param(
|
||||
[Parameter(
|
||||
Mandatory = $true,
|
||||
Mandatory,
|
||||
HelpMessage = "Host Name attached to the VRA to be removed."
|
||||
)]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
|
||||
@@ -19,7 +19,7 @@ Get-ZertoEvent [<CommonParameters>]
|
||||
|
||||
### filter
|
||||
```
|
||||
Get-ZertoEvent [-startDate <String>] [-endDate <String>] [-vpg <String>] [-vpgIdentifier <String>]
|
||||
Get-ZertoEvent [-startDate <String>] [-endDate <String>] [-vpgName <String>] [-vpgIdentifier <String>]
|
||||
[-eventType <String>] [-siteName <String>] [-siteIdentifier <String>] [-zorgIdentifier <String>]
|
||||
[-entityType <String>] [-userName <String>] [-category <String>] [-eventCategory <String>]
|
||||
[-alertIdentifier <String>] [<CommonParameters>]
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user