151 Commits

Author SHA1 Message Date
Wes Carroll a2d724a54c Merge pull request #114 from ZertoPublic/wcarroll/where-fix
Wcarroll/where fix
2020-12-16 13:14:46 -05:00
Wes Carroll f06157c75e Bump Version for Release 2020-12-16 13:10:02 -05:00
Wes Carroll d413374c09 CHANGLOG Updates 2020-12-16 09:43:22 -05:00
Wes Carroll 1513cd4f4b Update Synopsis 2020-12-16 09:42:48 -05:00
Wes Carroll 1daac508b2 Update SiteId Lookup Method 2020-12-16 09:42:23 -05:00
Wes Carroll a22d9e3416 Merge pull request #113 from ZertoPublic/wcarroll/issue112
SiteId Query to VirtualizationSites Fixes #112
2020-12-09 21:57:36 -05:00
Wes Carroll 06e81b46d6 Update CHANGELOG for #112 2020-12-09 17:09:53 -05:00
Wes Carroll af33715f02 SiteId Query to VirtualizationSites Fixes #112 2020-12-09 16:13:50 -05:00
Wes Carroll 912bca0f9c Merge pull request #111 from ZertoPublic/export_bug_fix
Export bug fix
2020-10-19 19:10:37 -04:00
Wes Carroll 4ac951607b Add required Mock 2020-10-19 18:43:13 -04:00
Wes Carroll d3d01f892f Bump Version 2020-10-19 18:35:30 -04:00
Wes Carroll 84b7922156 Update CHANGELOG 2020-10-19 18:24:08 -04:00
Wes Carroll 0eaf89608b Clean up VPG Settings Identifier 2020-10-19 18:22:10 -04:00
Wes Carroll 50e03b36f5 Merge pull request #110 from ZertoPublic/Release
Release into Master
2020-09-08 08:55:07 -04:00
Wes Carroll 4531d2d53b Merge branch 'release_prep' into Release 2020-09-08 08:22:32 -04:00
Wes Carroll e6e6be9ede Bump Version 2020-09-08 08:21:10 -04:00
Wes Carroll 5c2dd620d8 Update for Release Notes 2020-09-08 08:20:29 -04:00
Wes Carroll a5a91febcf Merge pull request #109 from jonsouzerto/master
Fixed issue 108
2020-09-04 10:28:45 -04:00
jonsouzerto bb5dbaa0d4 Update CHANGELOG.md
Added fix information
2020-09-03 12:50:49 -04:00
jonsouzerto e6b5777e64 Updated recovery host key
Attempting to resolve issue 108
2020-09-03 12:45:35 -04:00
Wes Carroll ddee165575 Merge pull request #107 from gdbarron/invoke-move-updates
Invoke-ZertoMove parameter, pipeline, and restructuring updates
2020-08-28 13:48:34 -04:00
Brownstein f0279633dd add missing .IsPresent for switch value 2020-08-28 13:43:22 -04:00
Brownstein 139e52f3e2 add new parameter to test 2020-08-27 15:28:01 -04:00
Brownstein eea6e95988 update test and help files 2020-08-27 15:08:28 -04:00
Brownstein 0630cbb20e new param sets, pipeline input 2020-08-21 21:04:15 -04:00
Wes Carroll 682750fc6d Merge pull request #106 from ZertoPublic/Release
Merge pull request #105 from ZertoPublic/master
2020-08-20 13:44:03 -04:00
Wes Carroll 9dc9aa92d0 Merge pull request #105 from ZertoPublic/master
Release 1.5.0
2020-08-20 13:31:28 -04:00
Wes Carroll 23e0b8a665 Prepping for next release 2020-08-20 13:25:37 -04:00
Wes Carroll ae53dcd4d2 Merge pull request #104 from ZertoPublic/wcarroll/issue103
Update target host validation
2020-08-20 12:39:21 -04:00
Wes Carroll ced5671ab2 Update target host validation 2020-08-20 12:29:40 -04:00
Wes Carroll cb528df3d4 Merge pull request #102 from ZertoPublic/Add-VMToVpg
Add-ZertoVpgVm and Remove-ZertoVpgVm
2020-08-05 09:41:09 -04:00
Wes Carroll c91d53ecad Update with changes 2020-08-05 09:34:35 -04:00
Wes Carroll 8d8cb58558 Remove-ZertoVpgVm Tests 2020-08-05 08:47:17 -04:00
Wes Carroll 2dad347544 Remove-ZertoVpgVm Help 2020-08-05 08:41:55 -04:00
Wes Carroll 6f798fd96a Update VM Filter Method 2020-08-05 08:22:19 -04:00
Wes Carroll 649e7413a7 Fix URL typo 2020-08-05 07:46:11 -04:00
Wes Carroll af6e81267b Add Online Help URI 2020-08-05 07:45:55 -04:00
Wes Carroll b6d8083b69 Remove-ZertoVpgVm update 2020-08-04 22:05:35 -04:00
Wes Carroll 9d4b4d3533 Starting Remove-VpgVm 2020-08-04 17:42:37 -04:00
Wes Carroll 510f0b9ed7 Add-ZertoVpgVm Tests 2020-08-04 12:31:37 -04:00
Wes Carroll 9561936be7 Update Help Files 2020-08-04 11:46:12 -04:00
Wes Carroll 961eafb945 Update Event Documentation 2020-08-04 11:44:36 -04:00
Wes Carroll aa73534d7f Create Add-ZertoVpgVm Help File 2020-08-04 11:42:41 -04:00
Wes Carroll 56bbe59ea7 Always return the Vpg Settings Identifier 2020-08-04 11:23:37 -04:00
Wes Carroll 5f786775dc Verbose Output - VM and VPG name 2020-08-04 11:23:20 -04:00
Wes Carroll 14ef5048e4 Only process unique VM names 2020-08-04 11:22:45 -04:00
Wes Carroll d7e46bd263 Check for existence of Vpg 2020-08-04 10:48:58 -04:00
Wes Carroll c64c82f8bc Add parameter alias 2020-08-04 07:53:15 -04:00
Wes Carroll a59feb2d5f Add switch for vpgName 2020-08-03 21:21:05 -04:00
Wes Carroll d9e1063654 update GitIgnore 2020-08-03 21:13:38 -04:00
Wes Carroll d9e6c74f27 Add parameter aliases 2020-07-31 18:02:00 -04:00
Wes Carroll df82bc26ca Add function Add-ZertoVpgVm 2020-07-31 17:42:28 -04:00
Wes Carroll dbde9aa4c2 Merge pull request #101 from ZertoPublic/master
Merge Current Master to Release Branch
2020-07-08 13:14:52 -04:00
Wes Carroll 7dcb6539a5 Merge pull request #100 from ZertoPublic/wcarroll/prep_release
Prep Release Information
2020-07-08 13:10:34 -04:00
Wes Carroll 3621ddef8d Set Version Numbers 2020-07-08 13:08:49 -04:00
Wes Carroll 5b4a25b66d Merge pull request #98 from ZertoPublic:wcarroll/issue95
Remove zvmLocalInfo Script Scope Variable
2020-07-06 14:45:37 -04:00
Wes Carroll 5a2c01341c Update Changlog for Issue 95 2020-07-06 14:32:32 -04:00
Wes Carroll c477d40364 Remove Mocks that are not required any longer 2020-07-06 14:30:07 -04:00
Wes Carroll 494c45b02c Remove tests for removed variable 2020-07-06 14:26:56 -04:00
Wes Carroll 8318229cf4 Remove Removal of Variable no longer required 2020-07-06 14:26:36 -04:00
Wes Carroll 7427ffe707 Remove operation to set ZvmLocalInfo Variable 2020-07-06 14:26:10 -04:00
Wes Carroll 713c94461c Replace Script Scope LocalSite Info Variable 2020-07-06 14:25:43 -04:00
Wes Carroll 0872f1a655 Merge pull request #97 from ZertoPublic/wcarroll/issue96
Fixes Set-ZertoLicense ShouldProcess issue
2020-07-01 19:11:54 -04:00
Wes Carroll a072905253 Update ChangLog with Issue 96 updates 2020-07-01 17:34:25 -04:00
Wes Carroll 41fddf5f13 Set-ZertoLicense - Fix ShouldProcess error
Fixes #96
2020-07-01 17:09:38 -04:00
Wes Carroll 136d1b2c76 Merge pull request #94 from NScuola/patch-1
Adding port information for pairing v7.5+
2020-07-01 14:12:15 -04:00
NScuola a25bf3adfe Adding port information for pairing v7.5+
Adding port information to example for pairing v7.5+.
2020-07-01 14:06:30 -04:00
Wes Carroll 93c55bdd07 Merge pull request #93 from ZertoPublic/issue_90
Make New-ZertoVpg -RecoverySite parameter case-insensitive
2020-06-23 13:13:40 -04:00
Wes Carroll 5627992a04 Update CHANGELOG 2020-06-23 12:54:03 -04:00
Wes Carroll 7fc7edff86 Update PeerSite Lookup Method 2020-06-23 12:51:33 -04:00
Wes Carroll 6f1e582ceb Merge pull request #92 from ZertoPublic/issue_89
Set New-ZertoVpg Default Parameter Set
2020-06-23 12:40:07 -04:00
Wes Carroll 0f1b4302bb Update CHANGELOG with latest updates 2020-06-22 17:18:55 -04:00
Wes Carroll ea8d6f096d Update Parameter with Proper Names 2020-06-22 17:18:40 -04:00
Wes Carroll ddae22fb9f Specify defaultParameterSetName 2020-06-22 17:18:16 -04:00
Wes Carroll 6903ccc99b Update CHANGELOG 2020-06-22 17:03:32 -04:00
Wes Carroll 7ce6369ad7 Add tests for switches 2020-06-22 16:48:32 -04:00
Wes Carroll 2d453ef608 Put params in correct order 2020-06-22 16:48:31 -04:00
Wes Carroll 363b6e727c Update Param Order Syntax in Help File 2020-06-22 16:48:31 -04:00
Wes Carroll f4c1cf630a Moved Credential to Second Position 2020-06-22 16:48:31 -04:00
Wes Carroll 348fcbd28c Update Help for AutoReconnect switch 2020-06-22 16:48:31 -04:00
Wes Carroll 3000a2b013 Initial auto reconnect 2020-06-22 16:48:31 -04:00
Wes Carroll 52609bf64a Merge pull request #88 from ZertoPublic/wcarroll-patch-1
Added Time Example
2020-06-18 13:26:50 -04:00
Wes Carroll e021a7bab0 Added Time Example
Struggled to find a time example. Added one for future use.
2020-06-18 13:20:10 -04:00
Wes Carroll c3ad8dd415 Merge pull request #87 from ZertoPublic/Refactor-Build
Refactor build
2020-06-11 11:35:16 -04:00
Wes Carroll f81a22ca80 Update Artifact Publish task to latest 2020-06-11 09:24:02 -04:00
Wes Carroll de1a85cecd Add ReleaseNotes.md File Creation 2020-06-10 19:30:50 -04:00
Wes Carroll d3acba3967 Remove Unused Publish Task 2020-06-10 15:54:59 -04:00
Wes Carroll 512d5bbd74 Update Publish Location 2020-06-10 15:52:59 -04:00
Wes Carroll 9ad9cb7f1e Update Build Path for Artifact Utilization 2020-06-10 12:20:44 -04:00
Wes Carroll a55b0cd467 Remove SourceFileTests publish 2020-06-10 09:58:32 -04:00
Wes Carroll aab22cf266 Add Branch to Auto-Build 2020-06-10 09:53:01 -04:00
Wes Carroll 906d35186f Update Required Module Versions 2020-06-10 09:44:27 -04:00
Wes Carroll c7c3428dd5 Update release task to use full build process 2020-06-10 09:44:21 -04:00
Wes Carroll e90d2a23cc Update tests to only show failed 2020-06-10 09:44:16 -04:00
Wes Carroll 925ecaf224 Update default build operation 2020-06-10 09:44:11 -04:00
Wes Carroll 32403ec3e3 Update build script with params 2020-06-10 09:44:04 -04:00
Wes Carroll 73540faeb9 Update Build Paths 2020-06-09 22:34:22 -04:00
Wes Carroll 932262e33a Merge pull request #85 from ZertoPublic/wcarroll-patch-2
Add Username Example
2020-06-09 21:27:49 -04:00
Wes Carroll 1e84f5aea0 Add Username Example
added example with username filter
2020-06-09 15:21:11 -04:00
Wes Carroll 7befc7d21e Merge pull request #84 from ZertoPublic/wcarroll-patch-1
Correct example numbering issue
2020-06-05 12:57:07 -04:00
Wes Carroll cdad0c5e79 Correct example numbering issue 2020-06-05 09:43:48 -04:00
Wes Carroll 291aae9dcd Merge pull request #83 from ZertoPublic/ReleasePrep
Release prep
2020-05-17 11:26:23 -04:00
Wes Carroll f8f0d980d0 Update Unreleased to Release Number 2020-05-17 11:22:12 -04:00
Wes Carroll b72099559c Bump Version 2020-05-17 11:21:56 -04:00
Wes Carroll 6046103da0 Merge pull request #82 from ZertoPublic/Fix-ZertoStartClone
Fix zerto start clone
2020-05-17 11:18:15 -04:00
Wes Carroll cccd45b7fd Update ChangeLog 2020-05-17 11:07:31 -04:00
Wes Carroll 77b7e1c376 Fix Body Creation Method 2020-05-17 11:05:15 -04:00
Wes Carroll 8f735bee62 Correct body creation method 2020-05-17 11:04:41 -04:00
Wes Carroll de505debf9 Merge pull request #81 from ZertoPublic/Invoke-ZertoMoveCommit-Fix
Fix Invoke-ZertoMoveCommit
2020-05-13 10:38:31 -04:00
Wes Carroll bc570e9005 Update Changlog with MoveCommit Changes 2020-05-09 20:52:55 -04:00
Wes Carroll 804a60be77 Update for explicit switches 2020-05-09 20:10:13 -04:00
Wes Carroll 1e678214b1 Update for explicit reverse and keep params 2020-05-09 20:10:13 -04:00
Wes Carroll ba0b12e83c Add accepted values 2020-05-09 20:10:13 -04:00
Wes Carroll b33b07b524 Set Explicit Reverse\Keep Options 2020-05-09 20:10:13 -04:00
Wes Carroll d4b4d1b4d7 Merge pull request #80 from ZertoPublic:Get-ZertoEvent-Fix
Get zerto event fix
2020-05-09 11:04:59 -04:00
Wes Carroll fbe3f4d031 Add Get-ZertoEvent Fix 2020-05-09 10:36:37 -04:00
Wes Carroll 26cfb832a4 Update CHANGELOG.md 2020-05-07 20:49:16 -04:00
Wes Carroll 865ca1dd39 Update Logic to Convert VpgName to VpgIdentifier 2020-05-07 20:21:39 -04:00
Wes Carroll 2887f6d450 Update README.md
Fix link to updated WIKI page
2020-05-07 13:54:14 -04:00
Wes Carroll 5613b97eef Merge pull request #79 from ZertoPublic/PrepRelease
Release Update
2020-05-06 13:00:52 -04:00
Wes Carroll 3a2e8f4ee7 Bump Version 2020-05-06 12:45:09 -04:00
Wes Carroll 380ac5c841 Move Recent Updates to ChangeLog 2020-05-06 12:44:58 -04:00
Wes Carroll c2a0ac9fa0 Update CHANGELOG for Release 2020-05-06 12:44:32 -04:00
Wes Carroll ba2bed6b53 Merge pull request #78 from ZertoPublic/Update-Function-Tests
Update function tests
2020-05-06 09:56:01 -04:00
Wes Carroll 5ec0ddce62 Add general Changes to Changelog 2020-05-06 08:24:28 -04:00
Wes Carroll 83f00e00ee Update the Version Pattern 2020-05-06 08:17:26 -04:00
Wes Carroll 63a1ab928e Update builtfiletests to ensure module is built 2020-05-05 22:13:54 -04:00
Wes Carroll e6ead11891 Update mandatory parameter declaration 2020-05-05 21:59:14 -04:00
Wes Carroll aecd4fd1d5 Updated CHANGELOG with formatting information 2020-05-05 21:25:54 -04:00
Wes Carroll 8dcee4068a Update PSSA Rules for New PSSA Version 2020-05-05 16:30:49 -04:00
Wes Carroll b0d68ea224 Updete to use process block for pipeline 2020-05-05 16:29:56 -04:00
Wes Carroll 22b0da87b9 Update to latest versions of modules 2020-05-05 14:35:29 -04:00
Wes Carroll fc3c08637b Module Release Notes point to GitHub 2020-05-05 14:32:13 -04:00
Wes Carroll 4894084292 Remove RELEASENOTES for CHANGELOG 2020-05-05 14:27:27 -04:00
Wes Carroll 781368398c Update release notes to point to CHANGELOG 2020-05-05 14:26:41 -04:00
Wes Carroll 4271afd5b4 Move historical Release Notes to ChangeLog 2020-05-05 14:11:49 -04:00
Wes Carroll 6c2b029014 Update Parameter Name to work with filter 2020-05-05 13:47:19 -04:00
Wes Carroll e47458b2df Update ReleaseNotes to maintain history 2020-04-30 11:53:55 -04:00
Wes Carroll d38f206824 Update ZVM Headers 2020-04-30 11:11:29 -04:00
Wes Carroll ed6024fe63 Add Tests for Password Update
# Conflicts:
#	Tests/Public/Edit-ZertoVra.Tests.ps1
2020-04-20 17:21:52 -04:00
Wes Carroll 8b213ede25 Merge pull request #77 from ZertoPublic/Pester5Prep
Pester 5 prep
2020-04-20 17:00:00 -04:00
Wes Carroll 6620246e4c Update Method to Grab Path
https://jakubjares.com/2020/04/11/pester5-importing-ps-files/
2020-04-20 16:35:02 -04:00
Wes Carroll 71610ce9fe Pin Pester v4 2020-04-20 16:28:19 -04:00
Wes Carroll fb45693fb1 Pester 5 Prep 2020-04-20 16:28:03 -04:00
Wes Carroll 8578c775dd Merge pull request #76 from ZertoPublic/Refactor-Copy-ZertoVpg
Refactor Copy-ZertoVpg and Add Tests
2020-04-20 16:19:54 -04:00
Wes Carroll b186c561e6 Start of Next Releasenotes 2020-04-20 16:14:41 -04:00
Wes Carroll ae6a80b48d Merge branch 'master' into Refactor-Copy-ZertoVpg 2020-04-20 15:50:13 -04:00
Wes Carroll 9fafe4b58b Make PowerShell Gallery Badge Clickable 2020-04-20 15:34:07 -04:00
Wes Carroll c1b7c490ff Create Function Tests 2020-04-20 15:33:17 -04:00
Wes Carroll 589a3b7d6e Create Mock Data for Tests 2020-04-20 15:33:12 -04:00
Wes Carroll 9913c96d65 Refactor Function 2020-04-20 15:33:05 -04:00
183 changed files with 2067 additions and 1130 deletions
+1
View File
@@ -6,3 +6,4 @@ SourceTestResults.xml
publish/*
CodeCoverage.xml
scratch
.DS_Store
+2 -1
View File
@@ -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
}
+159
View File
@@ -0,0 +1,159 @@
# 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).
## [1.5.3]
### Zerto Virtual Manager
#### Fixed
* 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]
### 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
#### Fixed
* 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]
### 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.
#### 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
#### 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.
* 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.
* Fixed an [issue](https://github.com/ZertoPublic/ZertoApiWrapper/issues/95) when attempting to connect to an unlicensed site.
## [1.4.2]
### Zerto Virtual Manager
#### Fixed
* 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]
### 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
* 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)
+3 -9
View File
@@ -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
@@ -27,18 +27,12 @@ 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
* 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
-29
View File
@@ -1,29 +0,0 @@
### 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)
+13 -13
View File
@@ -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"
+10 -10
View File
@@ -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 "&"
+8 -13
View File
@@ -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 {
@@ -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 "<ParameterName> 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
@@ -43,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"
}
}
}
@@ -53,18 +48,18 @@ 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'" {
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\(.+\)'
}
}
+53
View File
@@ -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 "<ParameterName> parameter is of <Type> type" -TestCases $ParameterTestCases {
param($ParameterName, $Type, $Mandatory, $Validation)
Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type
}
It "<ParameterName> 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
+2 -2
View File
@@ -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 {
@@ -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 {
@@ -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
+17 -18
View File
@@ -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 {
@@ -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 {
@@ -57,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 {
@@ -89,27 +95,21 @@ 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
$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
$headers.keys.count | Should be 2
$headers.keys.count | Should -Be 3
}
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" {
@@ -134,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
}
}
}
+73 -2
View File
@@ -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 {
@@ -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
}
}
@@ -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' {
+20 -15
View File
@@ -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' {
@@ -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
}
@@ -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 "<ParameterName> parameter is of <Type> type" -TestCases $ParameterTestCases {
@@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@{ ParameterName = 'groupName' }
)
it "<ParameterName> validates against null or empty values" -TestCases $StringTestCases {
It "<ParameterName> 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,20 +53,27 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
@{ParameterName = 'subnetMask' }
)
it "<ParameterName> validates string for a valid IP Address" -TestCases $IpAddrTestCases {
It "<ParameterName> 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\]\$_'
}
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" {
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,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 $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 "<ParameterName> has <Validation> validation set" -TestCases $ParameterTestCases {
It "<ParameterName> has <Validation> 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" {
}
}
+10 -6
View File
@@ -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' {
@@ -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
@@ -199,11 +203,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 +215,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
+7 -7
View File
@@ -1,13 +1,13 @@
#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
}
$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
}
}
+5 -5
View File
@@ -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 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"
}
}
}
+8 -8
View File
@@ -1,13 +1,13 @@
#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 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'" {
@@ -1,13 +1,13 @@
#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 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
}
}
@@ -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 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
}
}
+5 -5
View File
@@ -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 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"
}
}
}
@@ -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 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"
}
}
}
@@ -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 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
}
}
@@ -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 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
}
}
@@ -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 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
}
}
@@ -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 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
}
}
@@ -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 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
}
}
@@ -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 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"
}
}
}
@@ -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 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"
}
}
}
+5 -5
View File
@@ -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 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"
}
}
}
+4 -4
View File
@@ -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
}
}
+5 -5
View File
@@ -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
}
@@ -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' {
@@ -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
}
}
@@ -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' {
@@ -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
}
}
+3 -3
View File
@@ -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' {
@@ -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"
}
}
}
@@ -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' {
@@ -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"
}
}
}
@@ -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' {
@@ -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
}
}
@@ -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' {
@@ -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
}
}
+3 -3
View File
@@ -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' {
@@ -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"
}
}
}
@@ -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' {
@@ -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"
}
}
}
@@ -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' {
@@ -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"
}
}
}
@@ -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' {
@@ -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"
}
}
}
+3 -3
View File
@@ -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' {
@@ -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"
}
}
}
@@ -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' {
@@ -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"
}
}
}
@@ -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' {
@@ -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"
}
}
}
@@ -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' {
@@ -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"
}
}
}
+2 -2
View File
@@ -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' {
@@ -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' {
@@ -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' {
@@ -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"
}
}
}
+5 -5
View File
@@ -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' {
@@ -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
}
}
+3 -3
View File
@@ -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' {
@@ -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"
}
}
}
+3 -3
View File
@@ -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' {
@@ -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"
}
}
}
@@ -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' {
@@ -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"
}
}
}
+3 -3
View File
@@ -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' {
@@ -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"
}
}
}
+3 -3
View File
@@ -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' {
@@ -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
}
}
+3 -3
View File
@@ -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' {
@@ -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"
}
}
}
+3 -3
View File
@@ -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' {
@@ -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"
}
}
}
+5 -5
View File
@@ -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' {
@@ -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
}
}
+3 -3
View File
@@ -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' {
@@ -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"
}
}
}
+3 -3
View File
@@ -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' {
}
default {
$true | Should be $false -Because "No Validation Selected. Review test cases"
$true | Should -Be $false -Because "No Validation Selected. Review test cases"
}
}
}
+2 -2
View File
@@ -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' {
+2 -2
View File
@@ -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' {
+3 -3
View File
@@ -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' {
@@ -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
}
}
+6 -6
View File
@@ -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' {
@@ -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" {
+2 -2
View File
@@ -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' {
+2 -2
View File
@@ -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' {
+3 -3
View File
@@ -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' {
@@ -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"
}
}
}
+2 -2
View File
@@ -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' {
@@ -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' {
@@ -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' {
@@ -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' {
+2 -2
View File
@@ -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' {
@@ -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' {
@@ -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
+2 -2
View File
@@ -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' {
+2 -2
View File
@@ -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' {
+2 -2
View File
@@ -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' {
+2 -2
View File
@@ -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' {
+2 -2
View File
@@ -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' {
+2 -2
View File
@@ -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' {
@@ -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" {
+4 -4
View File
@@ -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" {
+2 -2
View File
@@ -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' {
+3 -3
View File
@@ -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' {
@@ -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" {
@@ -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' {
+7 -7
View File
@@ -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 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
}
@@ -1,13 +1,13 @@
#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 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"
}
}
}
@@ -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
+5 -5
View File
@@ -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
+9 -8
View File
@@ -1,21 +1,22 @@
#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 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 = @(
@{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' }
@{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' }
)
@@ -55,7 +56,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 +68,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
}
@@ -1,13 +1,13 @@
#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 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"
}
}
}
@@ -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
@@ -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' {
@@ -40,12 +40,12 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' {
It "<TestName> 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
+79
View File
@@ -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"
}
+18
View File
@@ -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"
}
]
+1
View File
@@ -0,0 +1 @@
9607f923-00a7-477b-8b04-26a386214455
+2 -2
View File
@@ -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 {
+2 -2
View File
@@ -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' {

Some files were not shown because too many files have changed in this diff Show More