diff --git a/CHANGELOG.md b/CHANGELOG.md index 8eb97f8a8..95e8511e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## 2019-11-06 + +### Changed [Get-RubrikVcd & Get-RubrikVApp Options function names] + +* Renamed Get-RubrikVAppExportOptions to `Get-RubrikVAppExportOption` to use singular nouns +* Renamed Get-RubrikVAppRecoverOptions to `Get-RubrikVAppRecoverOption` to use singular nouns +* Renamed Get-RubrikVcdTemplateExportOptions to `Get-RubrikVcdTemplateExportOption` to use singular nouns +* Updated documentation and unit tests where required +* Addresses [Issue 509](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/509) + +### Changed [parameter type from boolean to switch] + +* Changed this for the following functions: + * `Export-RubrikVAPP` + * `New-RubrikBootstrap` + * `Restore-RubrikVAPP` +* Addresses [Issue 326](https://github.com/rubrikinc/rubrik-sdk-for-powershell/issues/326) + ## 2019-11-05 ### Changed [Submit-Request] diff --git a/Rubrik/Private/Get-RubrikAPIData.ps1 b/Rubrik/Private/Get-RubrikAPIData.ps1 index 6f8715b94..3dc92612e 100644 --- a/Rubrik/Private/Get-RubrikAPIData.ps1 +++ b/Rubrik/Private/Get-RubrikAPIData.ps1 @@ -1052,7 +1052,7 @@ function Get-RubrikAPIData($endpoint) { Success = '200' } } - 'Get-RubrikVAppExportOptions' = @{ + 'Get-RubrikVAppExportOption' = @{ '1.0' = @{ Description = 'Retrieves export options for a vCD vApp' URI = '/api/internal/vcd/vapp/snapshot/{id}/export/options' @@ -1068,7 +1068,7 @@ function Get-RubrikAPIData($endpoint) { Success = '200' } } - 'Get-RubrikVAppRecoverOptions' = @{ + 'Get-RubrikVAppRecoverOption' = @{ '1.0' = @{ Description = 'Retrieves instant recovery options for a vCD vApp' URI = '/api/internal/vcd/vapp/snapshot/{id}/instant_recover/options' @@ -1080,7 +1080,7 @@ function Get-RubrikAPIData($endpoint) { Success = '200' } } - 'Get-RubrikVcdTemplateExportOptions' = @{ + 'Get-RubrikVcdTemplateExportOption' = @{ '1.0' = @{ Description = 'Retrieves export options for a vCD Template' URI = '/api/v1/vcd/vapp/template/snapshot/{id}/export/options' diff --git a/Rubrik/Public/Export-RubrikVApp.ps1 b/Rubrik/Public/Export-RubrikVApp.ps1 index eb2fceab0..83dad24ea 100644 --- a/Rubrik/Public/Export-RubrikVApp.ps1 +++ b/Rubrik/Public/Export-RubrikVApp.ps1 @@ -99,7 +99,7 @@ function Export-RubrikVApp # Power on vApp after restoration. [Parameter(ParameterSetName='Full',Mandatory = $true)] [Parameter(ParameterSetName='Partial',Mandatory = $true)] - [Bool]$PowerOn, + [switch]$PowerOn, # Rubrik server IP or FQDN [Parameter(ParameterSetName='Full')] [Parameter(ParameterSetName='Partial')] diff --git a/Rubrik/Public/Export-RubrikVCDTemplate.ps1 b/Rubrik/Public/Export-RubrikVCDTemplate.ps1 index de74ac10f..c81e7454c 100644 --- a/Rubrik/Public/Export-RubrikVCDTemplate.ps1 +++ b/Rubrik/Public/Export-RubrikVCDTemplate.ps1 @@ -81,7 +81,7 @@ function Export-RubrikVCDTemplate Write-Verbose -Message "Using $($name) for export" } if(!$orgvdcid) { - $options = Get-RubrikVcdTemplateExportOptions -id $id -catalogid $catalogid -name $name + $options = Get-RubrikVcdTemplateExportOption -id $id -catalogid $catalogid -name $name $orgvdcid = $options.originalVdcExportOptions.orgVdcId Write-Verbose -Message "Using Org VDC $($orgvdc) for export" } diff --git a/Rubrik/Public/Get-RubrikVAppExportOptions.ps1 b/Rubrik/Public/Get-RubrikVAppExportOption.ps1 similarity index 91% rename from Rubrik/Public/Get-RubrikVAppExportOptions.ps1 rename to Rubrik/Public/Get-RubrikVAppExportOption.ps1 index 00416d0d2..9754ad92f 100644 --- a/Rubrik/Public/Get-RubrikVAppExportOptions.ps1 +++ b/Rubrik/Public/Get-RubrikVAppExportOption.ps1 @@ -1,12 +1,12 @@ #requires -Version 3 -function Get-RubrikVAppExportOptions +function Get-RubrikVAppExportOption { <# .SYNOPSIS Retrieves export for a vCD vApp known to a Rubrik cluster .DESCRIPTION - The Get-RubrikVAppExportOptions cmdlet retrieves export options for a vCD vApp known to a Rubrik cluster + The Get-RubrikVAppExportOption cmdlet retrieves export options for a vCD vApp known to a Rubrik cluster .NOTES Written by Matt Elliott for community usage @@ -14,11 +14,11 @@ function Get-RubrikVAppExportOptions GitHub: shamsway .LINK - https://rubrik.gitbook.io/rubrik-sdk-for-powershell/command-documentation/reference/Get-RubrikVAppExportOptions + https://rubrik.gitbook.io/rubrik-sdk-for-powershell/command-documentation/reference/Get-RubrikVAppExportOption .EXAMPLE $SnapshotID = (Get-RubrikVApp -Name 'vApp01' | Get-RubrikSnapshot -Latest).id - Get-RubrikVAppExportOptions -id $SnapshotID -ExportMode 'ExportToNewVapp' + Get-RubrikVAppExportOption -id $SnapshotID -ExportMode 'ExportToNewVapp' This returns available export options for the specific snapshot. #> diff --git a/Rubrik/Public/Get-RubrikVAppRecoverOptions.ps1 b/Rubrik/Public/Get-RubrikVAppRecoverOption.ps1 similarity index 89% rename from Rubrik/Public/Get-RubrikVAppRecoverOptions.ps1 rename to Rubrik/Public/Get-RubrikVAppRecoverOption.ps1 index d00d2c5df..1194901d4 100644 --- a/Rubrik/Public/Get-RubrikVAppRecoverOptions.ps1 +++ b/Rubrik/Public/Get-RubrikVAppRecoverOption.ps1 @@ -1,12 +1,12 @@ #requires -Version 3 -function Get-RubrikVAppRecoverOptions +function Get-RubrikVAppRecoverOption { <# .SYNOPSIS Retrieves instant recovery options a vCD vApp known to a Rubrik cluster .DESCRIPTION - The Get-RubrikVAppRecoverOptions cmdlet is used to retrieve instant recovery options for a vCD vApp known to a Rubrik cluster + The Get-RubrikVAppRecoverOption cmdlet is used to retrieve instant recovery options for a vCD vApp known to a Rubrik cluster .NOTES Written by Matt Elliott for community usage @@ -14,11 +14,11 @@ function Get-RubrikVAppRecoverOptions Github: shamsway .LINK - https://rubrik.gitbook.io/rubrik-sdk-for-powershell/command-documentation/reference/Get-RubrikVAppRecoverOptions + https://rubrik.gitbook.io/rubrik-sdk-for-powershell/command-documentation/reference/Get-RubrikVAppRecoverOption .EXAMPLE $SnapshotID = (Get-RubrikVApp -Name 'vApp01' | Get-RubrikSnapshot -Latest).id - Get-RubrikVAppRecoverOptions -id $SnapshotID + Get-RubrikVAppRecoverOption -id $SnapshotID This will return recovery options on the specific snapshot. #> diff --git a/Rubrik/Public/Get-RubrikVCDTemplateExportOptions.ps1 b/Rubrik/Public/Get-RubrikVCDTemplateExportOption.ps1 similarity index 90% rename from Rubrik/Public/Get-RubrikVCDTemplateExportOptions.ps1 rename to Rubrik/Public/Get-RubrikVCDTemplateExportOption.ps1 index e8936662d..281069799 100644 --- a/Rubrik/Public/Get-RubrikVCDTemplateExportOptions.ps1 +++ b/Rubrik/Public/Get-RubrikVCDTemplateExportOption.ps1 @@ -1,12 +1,12 @@ #requires -Version 3 -function Get-RubrikVCDTemplateExportOptions +function Get-RubrikVCDTemplateExportOption { <# .SYNOPSIS Retrieves export options for a vCD Template known to a Rubrik cluster .DESCRIPTION - The Get-RubrikVCDTemplateExportOptions cmdlet retrieves export options for a vCD Template known to a Rubrik cluster + The Get-RubrikVCDTemplateExportOption cmdlet retrieves export options for a vCD Template known to a Rubrik cluster .NOTES Written by Matt Elliott for community usage @@ -14,11 +14,11 @@ function Get-RubrikVCDTemplateExportOptions GitHub: shamsway .LINK - https://rubrik.gitbook.io/rubrik-sdk-for-powershell/command-documentation/reference/Get-RubrikVCDTemplateExportOptions + https://rubrik.gitbook.io/rubrik-sdk-for-powershell/command-documentation/reference/Get-RubrikVCDTemplateExportOption .EXAMPLE $SnapshotID = (Get-RubrikVApp -Name 'vAppTemplate01' | Get-RubrikSnapshot -Latest).id - Get-RubrikVCDTemplateExportOptions -id $SnapshotID -catalogid 'VcdCatalog:::01234567-8910-1abc-d435-0abc1234d567' -Name 'vAppTemplate01-export' + Get-RubrikVCDTemplateExportOption -id $SnapshotID -catalogid 'VcdCatalog:::01234567-8910-1abc-d435-0abc1234d567' -Name 'vAppTemplate01-export' This will return export options details on the specific snapshot. #> diff --git a/Rubrik/Public/New-RubrikBootStrap.ps1 b/Rubrik/Public/New-RubrikBootStrap.ps1 index e7a36c6c2..5b64e9f48 100644 --- a/Rubrik/Public/New-RubrikBootStrap.ps1 +++ b/Rubrik/Public/New-RubrikBootStrap.ps1 @@ -89,8 +89,8 @@ function New-RubrikBootStrap [System.Object] $nodeConfigs, # Software Encryption - [bool] - $enableSoftwareEncryptionAtRest = $false, + [switch] + $enableSoftwareEncryptionAtRest, # Cluster/Edge Name [ValidateNotNullOrEmpty()] [string] diff --git a/Rubrik/Public/Restore-RubrikVApp.ps1 b/Rubrik/Public/Restore-RubrikVApp.ps1 index af3c38743..ccca2a425 100644 --- a/Rubrik/Public/Restore-RubrikVApp.ps1 +++ b/Rubrik/Public/Restore-RubrikVApp.ps1 @@ -26,14 +26,14 @@ function Restore-RubrikVApp .EXAMPLE $id = (Get-RubrikVApp -Name "vApp01" -PrimaryClusterID local | Get-RubrikSnapshot -Latest ).id - $recoveropts = Get-RubrikVAppRecoverOptions -Id $id + $recoveropts = Get-RubrikVAppRecoverOption -Id $id $restorableVms = $recoveropts.restorableVms $vm = @() $vm += $restorableVms[0] Restore-RubrikVApp -id $id -Partial $vm -PowerOn:$false This retreives the latest snapshot from the given vApp 'vApp01' and performs a partial restore on the first VM in the vApp. - This is an advanced use case and the user is responsible for parsing the output from Get-RubrikVAppRecoverOptions. - Syntax of the object passed with the -Partial Parameter must match the format of the object returned from (Get-RubrikVAppRecoverOptions).restorableVms + This is an advanced use case and the user is responsible for parsing the output from Get-RubrikVAppRecoverOption. + Syntax of the object passed with the -Partial Parameter must match the format of the object returned from (Get-RubrikVAppRecoverOption).restorableVms #> [CmdletBinding(SupportsShouldProcess = $true,ConfirmImpact = 'High')] @@ -76,7 +76,7 @@ function Restore-RubrikVApp # Power on vApp after restoration. [Parameter(ParameterSetName='Full',Mandatory = $true)] [Parameter(ParameterSetName='Partial',Mandatory = $true)] - [Bool]$PowerOn, + [switch]$PowerOn, # Rubrik server IP or FQDN [Parameter(ParameterSetName='Full')] [Parameter(ParameterSetName='Partial')] @@ -120,7 +120,7 @@ function Restore-RubrikVApp } else { Write-Verbose -Message "Performing Full vApp Recovery" - $recoveropts = Get-RubrikVAppRecoverOptions -id $id + $recoveropts = Get-RubrikVAppRecoverOption -id $id $resources.Body.vmsToRestore = $recoveropts.restorableVms $resources.Body.shouldPowerOnVmsAfterRecovery = $PowerOn @@ -150,7 +150,7 @@ function Restore-RubrikVApp } if($NetworkMapping) { - # Check RubrikVAppRecoverOptions to verify + # Check RubrikVAppRecoverOption to verify $found = $false Write-Verbose -Message "Validating $($NetworkMapping) network" foreach($network in $recoveropts.availableVappNetworks) { diff --git a/Rubrik/Rubrik.psd1 b/Rubrik/Rubrik.psd1 index 548fdd0a9..6caded1ba 100644 --- a/Rubrik/Rubrik.psd1 +++ b/Rubrik/Rubrik.psd1 @@ -12,7 +12,7 @@ RootModule = 'Rubrik.psm1' # Version number of this module. -ModuleVersion = '4.0.513' +ModuleVersion = '4.0.0.514' # Supported PSEditions # CompatiblePSEditions = @() @@ -97,9 +97,9 @@ FunctionsToExport = @('Connect-Rubrik', 'Disconnect-Rubrik', 'Export-RubrikDatab 'Get-RubrikOracleDB', 'Get-RubrikOrganization', 'Get-RubrikReport', 'Get-RubrikNetworkThrottle' 'Get-RubrikProxySetting', 'Get-RubrikReportData', 'Get-RubrikRequest', 'Get-RubrikSetting', 'Get-RubrikSLA', 'Get-RubrikSnapshot', 'Get-RubrikSNMPSetting', 'Get-RubrikSoftwareVersion', - 'Get-RubrikSQLInstance', 'Get-RubrikSupportTunnel', 'Get-RubrikVAppExportOptions', + 'Get-RubrikSQLInstance', 'Get-RubrikSupportTunnel', 'Get-RubrikVAppExportOption', 'Get-RubrikObject', 'Get-RubrikUserRole', 'Get-RubrikLoginBanner', 'Get-RubrikNotificationSetting', - 'Get-RubrikVAppRecoverOptions', 'Get-RubrikVCDTemplateExportOptions', 'Get-RubrikUnmanagedObject', + 'Get-RubrikVAppRecoverOption', 'Get-RubrikVCDTemplateExportOption', 'Get-RubrikUnmanagedObject', 'Get-RubrikUser', 'Get-RubrikVApp', 'Get-RubrikVAppSnapshot', 'Get-RubrikVCD', 'Get-RubrikVCenter', 'Get-RubrikVersion', 'Get-RubrikVM', 'Get-RubrikVMSnapshot', 'Get-RubrikVMwareDatastore', 'Get-RubrikVMwareHost', 'Get-RubrikVolumeGroup', diff --git a/Tests/Get-RubrikVAppExportOptions.Tests.ps1 b/Tests/Get-RubrikVAppExportOption.Tests.ps1 similarity index 91% rename from Tests/Get-RubrikVAppExportOptions.Tests.ps1 rename to Tests/Get-RubrikVAppExportOption.Tests.ps1 index 08e546547..ee71ef4d3 100644 --- a/Tests/Get-RubrikVAppExportOptions.Tests.ps1 +++ b/Tests/Get-RubrikVAppExportOption.Tests.ps1 @@ -5,7 +5,7 @@ foreach ( $privateFunctionFilePath in ( Get-ChildItem -Path './Rubrik/Private' | . $privateFunctionFilePath } -Describe -Name 'Public/Get-RubrikVAppExportOptions' -Tag 'Public', 'Get-RubrikVAppExportOptions' -Fixture { +Describe -Name 'Public/Get-RubrikVAppExportOption' -Tag 'Public', 'Get-RubrikVAppExportOption' -Fixture { #region init $global:rubrikConnection = @{ id = 'test-id' @@ -74,7 +74,7 @@ Describe -Name 'Public/Get-RubrikVAppExportOptions' -Tag 'Public', 'Get-RubrikVA } It -Name 'Expected results returned' -Test { - $result = Get-RubrikVAppExportOptions -id '01234567-8910-1abc-d435-0abc1234d567' -ExportMode 'ExportToNewVapp' + $result = Get-RubrikVAppExportOption -id '01234567-8910-1abc-d435-0abc1234d567' -ExportMode 'ExportToNewVapp' $result.allChildVmsWithDefaultNetworkConnections[0].name | Should -BeExactly 'vApp01' $result.targetVappNetworks[0].name | Should -BeExactly 'network01' } @@ -85,11 +85,11 @@ Describe -Name 'Public/Get-RubrikVAppExportOptions' -Tag 'Public', 'Get-RubrikVA } Context -Name 'Parameter Validation' { It -Name 'Parameter ID cannot be null' -Test { - { Get-RubrikVAppExportOptions -id $null } | + { Get-RubrikVAppExportOption -id $null } | Should -Throw "Cannot validate argument on parameter 'id'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again." } It -Name 'Parameter ID cannot be empty' -Test { - { Get-RubrikVAppExportOptions -id '' } | + { Get-RubrikVAppExportOption -id '' } | Should -Throw "Cannot validate argument on parameter 'id'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again." } } diff --git a/Tests/Get-RubrikVAppRecoverOptions.Tests.ps1 b/Tests/Get-RubrikVAppRecoverOption.Tests.ps1 similarity index 91% rename from Tests/Get-RubrikVAppRecoverOptions.Tests.ps1 rename to Tests/Get-RubrikVAppRecoverOption.Tests.ps1 index ad4004ebd..5ac96ea2c 100644 --- a/Tests/Get-RubrikVAppRecoverOptions.Tests.ps1 +++ b/Tests/Get-RubrikVAppRecoverOption.Tests.ps1 @@ -5,7 +5,7 @@ foreach ( $privateFunctionFilePath in ( Get-ChildItem -Path './Rubrik/Private' | . $privateFunctionFilePath } -Describe -Name 'Public/Get-RubrikVAppRecoverOptions' -Tag 'Public', 'Get-RubrikVAppRecoverOptions' -Fixture { +Describe -Name 'Public/Get-RubrikVAppRecoverOption' -Tag 'Public', 'Get-RubrikVAppRecoverOption' -Fixture { #region init $global:rubrikConnection = @{ id = 'test-id' @@ -67,7 +67,7 @@ Describe -Name 'Public/Get-RubrikVAppRecoverOptions' -Tag 'Public', 'Get-RubrikV } It -Name 'Expected results returned' -Test { - $result = Get-RubrikVAppRecoverOptions -id '01234567-8910-1abc-d435-0abc1234d567' + $result = Get-RubrikVAppRecoverOption -id '01234567-8910-1abc-d435-0abc1234d567' $result.restorableVms[0].name | Should -BeExactly 'vApp01' $result.availableVappNetworks[0].name | Should -BeExactly 'network01' } @@ -78,11 +78,11 @@ Describe -Name 'Public/Get-RubrikVAppRecoverOptions' -Tag 'Public', 'Get-RubrikV } Context -Name 'Parameter Validation' { It -Name 'Parameter ID cannot be null' -Test { - { Get-RubrikVAppRecoverOptions -id $null } | + { Get-RubrikVAppRecoverOption -id $null } | Should -Throw "Cannot validate argument on parameter 'id'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again." } It -Name 'Parameter ID cannot be empty' -Test { - { Get-RubrikVAppRecoverOptions -id '' } | + { Get-RubrikVAppRecoverOption -id '' } | Should -Throw "Cannot validate argument on parameter 'id'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again." } } diff --git a/Tests/Get-RubrikVcdTemplateExportOptions.Tests.ps1 b/Tests/Get-RubrikVcdTemplateExportOption.Tests.ps1 similarity index 87% rename from Tests/Get-RubrikVcdTemplateExportOptions.Tests.ps1 rename to Tests/Get-RubrikVcdTemplateExportOption.Tests.ps1 index 1ff4df77b..c8f43bc51 100644 --- a/Tests/Get-RubrikVcdTemplateExportOptions.Tests.ps1 +++ b/Tests/Get-RubrikVcdTemplateExportOption.Tests.ps1 @@ -5,7 +5,7 @@ foreach ( $privateFunctionFilePath in ( Get-ChildItem -Path './Rubrik/Private' | . $privateFunctionFilePath } -Describe -Name 'Public/Get-RubrikVcdTemplateExportOptions' -Tag 'Public', 'Get-RubrikVcdTemplateExportOptions' -Fixture { +Describe -Name 'Public/Get-RubrikVcdTemplateExportOption' -Tag 'Public', 'Get-RubrikVcdTemplateExportOption' -Fixture { #region init $global:rubrikConnection = @{ id = 'test-id' @@ -46,7 +46,7 @@ Describe -Name 'Public/Get-RubrikVcdTemplateExportOptions' -Tag 'Public', 'Get-R } It -Name 'Expected results returned' -Test { - $result = Get-RubrikVcdTemplateExportOptions -id '01234567-8910-1abc-d435-0abc1234d567' -catalogid 'VcdCatalog:::01234567-8910-1abc-d435-0abc1234d567' -name 'Template-Export' + $result = Get-RubrikVcdTemplateExportOption -id '01234567-8910-1abc-d435-0abc1234d567' -catalogid 'VcdCatalog:::01234567-8910-1abc-d435-0abc1234d567' -name 'Template-Export' $result.originalVdcExportOptions.orgVdcId | Should -BeExactly '01234567-8910-1abc-d435-0abc1234d567' $result.defaultCatalogExportOptions.orgVdcId | Should -BeExactly '01234567-8910-1abc-d435-0abc1234d567' } @@ -73,7 +73,7 @@ Describe -Name 'Public/Get-RubrikVcdTemplateExportOptions' -Tag 'Public', 'Get-R } It -Name 'Expected results returned' -Test { - $result = Get-RubrikVcdTemplateExportOptions -id '01234567-8910-1abc-d435-0abc1234d567' -catalogid 'VcdCatalog:::01234567-8910-1abc-d435-0abc1234d567' -orgvdcid 'VcdOrgVdc:::665f23c6-1fc3-4d49-bb58-5841b0c20818' -name 'Template-Export' + $result = Get-RubrikVcdTemplateExportOption -id '01234567-8910-1abc-d435-0abc1234d567' -catalogid 'VcdCatalog:::01234567-8910-1abc-d435-0abc1234d567' -orgvdcid 'VcdOrgVdc:::665f23c6-1fc3-4d49-bb58-5841b0c20818' -name 'Template-Export' $result.advancedExportOptions.orgVdcId | Should -BeExactly '01234567-8910-1abc-d435-0abc1234d567' } @@ -114,7 +114,7 @@ Describe -Name 'Public/Get-RubrikVcdTemplateExportOptions' -Tag 'Public', 'Get-R } It -Name 'Expected results returned' -Test { - $result = Get-RubrikVcdTemplateExportOptions -id '01234567-8910-1abc-d435-0abc1234d567' -catalogid 'VcdCatalog:::01234567-8910-1abc-d435-0abc1234d567' + $result = Get-RubrikVcdTemplateExportOption -id '01234567-8910-1abc-d435-0abc1234d567' -catalogid 'VcdCatalog:::01234567-8910-1abc-d435-0abc1234d567' $result.originalVdcExportOptions.orgVdcId | Should -BeExactly '01234567-8910-1abc-d435-0abc1234d567' $result.defaultCatalogExportOptions.orgVdcId | Should -BeExactly '01234567-8910-1abc-d435-0abc1234d567' } @@ -127,11 +127,11 @@ Describe -Name 'Public/Get-RubrikVcdTemplateExportOptions' -Tag 'Public', 'Get-R } Context -Name 'Parameter Validation' { It -Name 'Parameter ID cannot be null' -Test { - { Get-RubrikVcdTemplateExportOptions -id $null } | + { Get-RubrikVcdTemplateExportOption -id $null } | Should -Throw "Cannot validate argument on parameter 'id'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again." } It -Name 'Parameter ID cannot be empty' -Test { - { Get-RubrikVcdTemplateExportOptions -id '' } | + { Get-RubrikVcdTemplateExportOption -id '' } | Should -Throw "Cannot validate argument on parameter 'id'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again." } } diff --git a/Tests/Restore-RubrikVApp.Tests.ps1 b/Tests/Restore-RubrikVApp.Tests.ps1 index 030ffb4a6..29a55e676 100644 --- a/Tests/Restore-RubrikVApp.Tests.ps1 +++ b/Tests/Restore-RubrikVApp.Tests.ps1 @@ -88,7 +88,7 @@ Describe -Name 'Public/Restore-RubrikVApp' -Tag 'Public', 'Restore-RubrikVApp' - #endregion Context -Name 'Test script logic' { - Mock -CommandName Get-RubrikVAppRecoverOptions -Verifiable -ModuleName 'Rubrik' -MockWith { + Mock -CommandName Get-RubrikVAppRecoverOption -Verifiable -ModuleName 'Rubrik' -MockWith { return $recoveropts } @@ -112,7 +112,7 @@ Describe -Name 'Public/Restore-RubrikVApp' -Tag 'Public', 'Restore-RubrikVApp' - } Assert-VerifiableMock - Assert-MockCalled -CommandName Get-RubrikVAppRecoverOptions -ModuleName 'Rubrik' -Exactly 2 + Assert-MockCalled -CommandName Get-RubrikVAppRecoverOption -ModuleName 'Rubrik' -Exactly 2 Assert-MockCalled -CommandName Submit-Request -ModuleName 'Rubrik' -Exactly 3 } diff --git a/azure-pipelines/scripts/build.ps1 b/azure-pipelines/scripts/build.ps1 index d814ff4f8..ca9401614 100644 --- a/azure-pipelines/scripts/build.ps1 +++ b/azure-pipelines/scripts/build.ps1 @@ -17,7 +17,7 @@ try { } $version = (Invoke-WebRequest @WebRequestSplat) -split '\n' -match 'ModuleVersion' -replace "\s|'|ModuleVersion|=" $version = [version][string]$version - [String]$newVersion = "$($version.Major).$($version.Minor).$($manifest.version.revision+1)" + [String]$newVersion = "$($version.Major).$($version.Minor).$($version.Build).$($manifest.version.revision+1)" Write-Output "New Version: $newVersion" else { $newVersion = $manifest.Version