From 6620246e4cd13488ebbc18a71874734ec1b9f4a4 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Mon, 20 Apr 2020 16:35:02 -0400 Subject: [PATCH] Update Method to Grab Path https://jakubjares.com/2020/04/11/pester5-importing-ps-files/ --- Tests/Private/Get-Map.Tests.ps1 | 26 +++++++++---------- Tests/Private/Get-ZertoApiFilter.Tests.ps1 | 20 +++++++------- Tests/Public/Add-ZertoPeerSite.Tests.ps1 | 4 +-- Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 | 4 +-- Tests/Public/Connect-ZertoAnalytics.Tests.ps1 | 4 +-- Tests/Public/Connect-ZertoServer.Tests.ps1 | 4 +-- Tests/Public/Copy-ZertoVpg.Tests.ps1 | 4 +-- Tests/Public/Disconnect-ZertoServer.Tests.ps1 | 4 +-- Tests/Public/Edit-ZertoVra.Tests.ps1 | 16 ++++++------ .../Public/Export-ZertoVmNicSetting.Tests.ps1 | 8 +++--- Tests/Public/Export-ZertoVpg.Tests.ps1 | 12 ++++----- Tests/Public/Get-ZAAlert.Tests.ps1 | 4 +-- Tests/Public/Get-ZADatastore.Tests.ps1 | 4 +-- Tests/Public/Get-ZAEvent.Tests.ps1 | 4 +-- .../Get-ZAJournalAverageHistory.Tests.ps1 | 4 +-- .../Public/Get-ZAJournalAverageSize.Tests.ps1 | 4 +-- Tests/Public/Get-ZAJournalBreach.Tests.ps1 | 4 +-- .../Public/Get-ZAJournalHistoryStat.Tests.ps1 | 4 +-- .../Get-ZAJournalSiteAverageHistory.Tests.ps1 | 4 +-- .../Get-ZAJournalSiteAverageSize.Tests.ps1 | 4 +-- .../Get-ZAJournalSiteHistoryStat.Tests.ps1 | 4 +-- .../Get-ZAJournalSiteHistorySummary.Tests.ps1 | 4 +-- .../Get-ZAJournalSiteSizeStat.Tests.ps1 | 4 +-- .../Get-ZAJournalStatusProportion.Tests.ps1 | 4 +-- .../Public/Get-ZAJournalStorageStat.Tests.ps1 | 4 +-- Tests/Public/Get-ZAJournalSummary.Tests.ps1 | 4 +-- Tests/Public/Get-ZALicense.Tests.ps1 | 8 +++--- Tests/Public/Get-ZAMonitoring.Tests.ps1 | 10 +++---- .../Get-ZANetworkSiteAverageIOPS.Tests.ps1 | 4 +-- ...-ZANetworkSiteAveragePerformance.Tests.ps1 | 4 +-- Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 | 4 +-- .../Public/Get-ZANetworkSiteSummary.Tests.ps1 | 4 +-- .../Get-ZANetworkVpgAverageIOPS.Tests.ps1 | 4 +-- ...t-ZANetworkVpgAveragePerformance.Tests.ps1 | 4 +-- Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 | 4 +-- .../Public/Get-ZANetworkVpgSummary.Tests.ps1 | 4 +-- .../Get-ZAPlannerJournalSizeReport.Tests.ps1 | 4 +-- ...APlannerNetworkPerformanceReport.Tests.ps1 | 4 +-- Tests/Public/Get-ZAPlannerSite.Tests.ps1 | 4 +-- .../Public/Get-ZAPlannerStatsReport.Tests.ps1 | 4 +-- Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 | 4 +-- .../Public/Get-ZAPlannerZcasReport.Tests.ps1 | 4 +-- Tests/Public/Get-ZAProtectedVm.Tests.ps1 | 4 +-- .../Public/Get-ZAProtectedVmReport.Tests.ps1 | 4 +-- .../Public/Get-ZARPOAccountAverage.Tests.ps1 | 4 +-- Tests/Public/Get-ZARPOAverage.Tests.ps1 | 4 +-- Tests/Public/Get-ZARPOBreach.Tests.ps1 | 4 +-- Tests/Public/Get-ZARPOStat.Tests.ps1 | 4 +-- .../Get-ZARPOStatusProportion.Tests.ps1 | 4 +-- Tests/Public/Get-ZARPOSummary.Tests.ps1 | 4 +-- Tests/Public/Get-ZASite.Tests.ps1 | 4 +-- Tests/Public/Get-ZASitePair.Tests.ps1 | 4 +-- Tests/Public/Get-ZASiteTopology.Tests.ps1 | 4 +-- Tests/Public/Get-ZATask.Tests.ps1 | 4 +-- Tests/Public/Get-ZAVolume.Tests.ps1 | 4 +-- Tests/Public/Get-ZAVpg.Tests.ps1 | 4 +-- Tests/Public/Get-ZAzOrg.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoAlert.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoDatastore.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoEvent.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoLicense.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoLocalSite.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoPeerSite.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoProtectedVm.Tests.ps1 | 4 +-- .../Public/Get-ZertoRecoveryReport.Tests.ps1 | 4 +-- .../Public/Get-ZertoResourcesReport.Tests.ps1 | 4 +-- .../Public/Get-ZertoServiceProfile.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoTask.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 | 4 +-- .../Get-ZertoVirtualizationSite.Tests.ps1 | 6 ++--- Tests/Public/Get-ZertoVolume.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoVpg.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoVpgSetting.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoVra.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoZorg.Tests.ps1 | 4 +-- Tests/Public/Get-ZertoZsspSession.Tests.ps1 | 4 +-- .../Public/Import-ZertoVmNicSetting.Tests.ps1 | 8 +++--- Tests/Public/Import-ZertoVpg.Tests.ps1 | 8 +++--- Tests/Public/Install-ZertoVra.Tests.ps1 | 4 +-- Tests/Public/Invoke-ZARestRequest.Tests.ps1 | 4 +-- .../Public/Invoke-ZertoEvacuateVra.Tests.ps1 | 4 +-- Tests/Public/Invoke-ZertoFailover.Tests.ps1 | 4 +-- .../Invoke-ZertoFailoverCommit.Tests.ps1 | 4 +-- .../Invoke-ZertoFailoverRollback.Tests.ps1 | 10 +++---- Tests/Public/Invoke-ZertoForceSync.Tests.ps1 | 10 +++---- Tests/Public/Invoke-ZertoMove.Tests.ps1 | 4 +-- Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 | 4 +-- .../Public/Invoke-ZertoMoveRollback.Tests.ps1 | 10 +++---- .../Public/Invoke-ZertoRestRequest.Tests.ps1 | 4 +-- Tests/Public/New-ZertoPairingToken.Tests.ps1 | 4 +-- Tests/Public/New-ZertoVpg.Tests.ps1 | 4 +-- .../New-ZertoVpgSettingsIdentifier.Tests.ps1 | 4 +-- Tests/Public/Remove-ZertoPeerSite.Tests.ps1 | 4 +-- Tests/Public/Remove-ZertoVpg.Tests.ps1 | 4 +-- ...emove-ZertoVpgSettingsIdentifier.Tests.ps1 | 4 +-- Tests/Public/Resume-ZertoVpg.Tests.ps1 | 4 +-- Tests/Public/Save-ZertoVpgSetting.Tests.ps1 | 4 +-- Tests/Public/Set-ZertoAlert.Tests.ps1 | 4 +-- Tests/Public/Set-ZertoLicense.Tests.ps1 | 4 +-- .../Public/Set-ZertoUserCredential.Tests.ps1 | 4 +-- Tests/Public/Start-ZertoCloneVpg.Tests.ps1 | 4 +-- .../Public/Start-ZertoFailoverTest.Tests.ps1 | 4 +-- Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 | 4 +-- Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 | 4 +-- Tests/Public/Suspend-ZertoVpg.Tests.ps1 | 4 +-- Tests/Public/Uninstall-ZertoVra.Tests.ps1 | 4 +-- Tests/ZertoApiWrapper.Tests.ps1 | 22 ++++++++-------- 107 files changed, 273 insertions(+), 273 deletions(-) diff --git a/Tests/Private/Get-Map.Tests.ps1 b/Tests/Private/Get-Map.Tests.ps1 index 8aeca06..040afda 100644 --- a/Tests/Private/Get-Map.Tests.ps1 +++ b/Tests/Private/Get-Map.Tests.ps1 @@ -1,45 +1,45 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { InModuleScope -ModuleName ZertoApiWrapper { Context "$global:function::Parameter Unit Tests" { - it "have a mandatory parameter for the Input Object" { + It "have a mandatory parameter for the Input Object" { Get-Command $global:function | Should -HaveParameter InputObject -Mandatory -Type PSCustomObject } - it "Input Object should not accecpt a Null or Empty value" { + It "Input Object should not accecpt a Null or Empty value" { $myObj = [PSCustomObject]@{ } { Get-Map -InputObject $myObj -Key "Key" -Value "Value" } | Should Throw { Get-Map -InputObject $null -Key "Key" -Value "Value" } | Should Throw { Get-Map -InputObject "" -Key "Key" -Value "Value" } | Should Throw } - it "have a mandatory string parameter for the Map Key" { + It "have a mandatory string parameter for the Map Key" { Get-Command $global:function | Should -HaveParameter Key -Mandatory -Type String } - it "The Map variable should not accecpt a Null or Empty value" { + It "The Map variable should not accecpt a Null or Empty value" { $myObj = [PSCustomObject]@{one = 1; two = 2 } { Get-Map -InputObject $myObj -Key "" -Value "Value" } | Should Throw { Get-Map -InputObject $null -Key $null -Value "Value" } | Should Throw { Get-Map -InputObject $myObj -Key 1 -Value "Value" } | Should Throw } - it "The Value variable should not accecpt a Null or Empty value" { + It "The Value variable should not accecpt a Null or Empty value" { $myObj = [PSCustomObject]@{one = 1; two = 2 } { Get-Map -InputObject $myObj -Key "Key" -Value "" } | Should Throw { Get-Map -InputObject $myObj -Key "Key" -Value $null } | Should Throw { Get-Map -InputObject $myObj -Key "Key" -Value 1 } | Should Throw } - it "have a mandatory string parameter for the Map Value" { + It "have a mandatory string parameter for the Map Value" { Get-Command $global:function | Should -HaveParameter Value -Mandatory -Type String } - it "should have an Output type of Hashtable" { + It "should have an Output type of Hashtable" { (Get-Command $global:function).OutputType.Name | Should -Match "Hashtable" } } @@ -49,15 +49,15 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeEach { $MyMap = Get-Map -InputObject $MyObj -Key "vmIdentifier" -Value "vmName" } - it "Returned object should be a hashtable" { + It "Returned object should be a hashtable" { $myMap | Should -BeOfType Hashtable } - it "should return a hashtable with 3 entries" { - $myMap.count | should -Be 3 + It "should return a hashtable with 3 entries" { + $myMap.count | Should -Be 3 } - it "should be properly mapped" { + It "should be properly mapped" { $myMap["vmid.12"] | Should -Be "ExchangeMailbox" $myMap["vmid.13"] | Should -Be "ExchangeApplication" $myMap["vmid.14"] | Should -Be "ExchangeWeb" diff --git a/Tests/Private/Get-ZertoApiFilter.Tests.ps1 b/Tests/Private/Get-ZertoApiFilter.Tests.ps1 index a42e57e..ce0fbfb 100644 --- a/Tests/Private/Get-ZertoApiFilter.Tests.ps1 +++ b/Tests/Private/Get-ZertoApiFilter.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -16,7 +16,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { { Get-ZertoApiFilter -filtertable $null } | Should Throw } - it "should have an Output type of String" { + It "should have an Output type of String" { (Get-Command $global:function).OutputType.Name | Should -Match "String" } } @@ -47,19 +47,19 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } } - it "converts bool to text" { - Get-ZertoApiFilter -filtertable $singleBoolItemTest | should -Be "?BoolItem=True" + It "converts bool to text" { + Get-ZertoApiFilter -filtertable $singleBoolItemTest | Should -Be "?BoolItem=True" } - it "one item test" { - Get-ZertoApiFilter -filtertable $oneItemTest | should -Be "?OneItem=Test" + It "one item test" { + Get-ZertoApiFilter -filtertable $oneItemTest | Should -Be "?OneItem=Test" } - it "should ignore CommonParameters" { - Get-ZertoApiFilter -filtertable $commonParamTest | should -Be "?OneItem=Test" + It "should ignore CommonParameters" { + Get-ZertoApiFilter -filtertable $commonParamTest | Should -Be "?OneItem=Test" } - it "should process a filter table with more than one item" { + It "should process a filter table with more than one item" { $returnString = Get-ZertoApiFilter -filtertable $twoItemTest $returnString | Should -match "^\?" $returnString | Should -match "&" diff --git a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 index 3bbe71b..60a9fd3 100644 --- a/Tests/Public/Add-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Add-ZertoPeerSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { diff --git a/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 b/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 index 7ae3eea..4fbb862 100644 --- a/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Checkpoint-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { diff --git a/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 index 2c335b6..d91ed80 100644 --- a/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 +++ b/Tests/Public/Connect-ZertoAnalytics.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { diff --git a/Tests/Public/Connect-ZertoServer.Tests.ps1 b/Tests/Public/Connect-ZertoServer.Tests.ps1 index b43ca28..da0ab18 100644 --- a/Tests/Public/Connect-ZertoServer.Tests.ps1 +++ b/Tests/Public/Connect-ZertoServer.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { diff --git a/Tests/Public/Copy-ZertoVpg.Tests.ps1 b/Tests/Public/Copy-ZertoVpg.Tests.ps1 index 4bb19e4..6f0c629 100644 --- a/Tests/Public/Copy-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Copy-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { diff --git a/Tests/Public/Disconnect-ZertoServer.Tests.ps1 b/Tests/Public/Disconnect-ZertoServer.Tests.ps1 index 873fab2..51e5f2c 100644 --- a/Tests/Public/Disconnect-ZertoServer.Tests.ps1 +++ b/Tests/Public/Disconnect-ZertoServer.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Edit-ZertoVra.Tests.ps1 b/Tests/Public/Edit-ZertoVra.Tests.ps1 index 9c872fc..3767301 100644 --- a/Tests/Public/Edit-ZertoVra.Tests.ps1 +++ b/Tests/Public/Edit-ZertoVra.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -28,7 +28,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { @{ParameterName = 'vraIpAddress'; Type = 'String'; Mandatory = $false } @{ParameterName = 'defaultGateway'; Type = 'String'; Mandatory = $false } @{ParameterName = 'subnetMask'; Type = 'String'; Mandatory = $false } - @{ParameterName = 'HostRootPassword'; Type = 'securestring'; Mandatory = $false} + @{ParameterName = 'HostRootPassword'; Type = 'securestring'; Mandatory = $false } ) It " parameter is of type" -TestCases $ParameterTestCases { @@ -41,7 +41,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { @{ ParameterName = 'groupName' } ) - it " validates against null or empty values" -TestCases $StringTestCases { + It " validates against null or empty values" -TestCases $StringTestCases { param($ParameterName) $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 @@ -53,7 +53,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { @{ParameterName = 'subnetMask' } ) - it " validates string for a valid IP Address" -TestCases $IpAddrTestCases { + It " validates string for a valid IP Address" -TestCases $IpAddrTestCases { param($ParameterName) $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes $attrs.Where{ $_ -is [ValidateScript] }.Count | Should -Be 1 @@ -65,8 +65,8 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { It "Returns a task id string" { $results = Edit-ZertoVra -vraIdentifier "MyVraIdentifier" -groupName "MyGroup" - $results | should not benullorempty - $results | should -BeOfType "String" + $results | Should not benullorempty + $results | Should -BeOfType "String" $results | Should -BeExactly "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a" } @@ -82,7 +82,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Edit-ZertoVra -vraIdentifier "DhcpVraIdentifier" -groupName "MyNewGroup" | Should -BeExactly "7e79035e-fb8c-47fe-815c-12ddd41708e6.3e4cdd0d-1064-4022-921f-6265ad6d335a" } - it "Supports 'SupportsShouldProcess'" { + It "Supports 'SupportsShouldProcess'" { Get-Command $global:function | Should -HaveParameter WhatIf Get-Command $global:function | Should -HaveParameter Confirm (Get-Command $global:function).ScriptBlock | Should -Match 'SupportsShouldProcess' diff --git a/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 b/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 index be52ffb..f7ecbb1 100644 --- a/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 +++ b/Tests/Public/Export-ZertoVmNicSetting.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -16,7 +16,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { Get-Command $global:function | Should -HaveParameter $ParameterName -Mandatory:$Mandatory -Type $Type } - it " has validation set" -TestCases $ParameterTestCases { + It " has validation set" -TestCases $ParameterTestCases { param($ParameterName) $attrs = (Get-Command $global:function).Parameters[$ParameterName].Attributes $attrs.Where{ $_ -is [ValidateNotNullOrEmpty] }.Count | Should -Be 1 @@ -24,7 +24,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } Context "$global:function::Function Unit Tests" { - + } } diff --git a/Tests/Public/Export-ZertoVpg.Tests.ps1 b/Tests/Public/Export-ZertoVpg.Tests.ps1 index e733e93..957092a 100644 --- a/Tests/Public/Export-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Export-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { @@ -199,11 +199,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $outputPath = "TestDrive:" - it "Output path should exist" { + It "Output path should exist" { $outputPath | Should -Exist } - it "Exported JSON file should exist after function called" { + It "Exported JSON file should exist after function called" { $vpgName = "HRIS" Export-ZertoVpg -outputPath $outputPath -vpgName $vpgName $outputFile = "{0}\{1}.json" -f $outputPath, $vpgName @@ -211,11 +211,11 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { $outputFile | Should -Not -BeNullOrEmpty } - it "Only one file should be present in the TestDrive" { + It "Only one file should be present in the TestDrive" { (Get-ChildItem $outputPath).Count | Should -BeExactly 1 } - it "Should be valid JSON" { + It "Should be valid JSON" { $vpgName = "HRIS" Export-ZertoVpg -outputPath $outputPath -vpgName $vpgName $outputFile = "{0}\{1}.json" -f $outputPath, $vpgName diff --git a/Tests/Public/Get-ZAAlert.Tests.ps1 b/Tests/Public/Get-ZAAlert.Tests.ps1 index 474bf6f..1a4cd6d 100644 --- a/Tests/Public/Get-ZAAlert.Tests.ps1 +++ b/Tests/Public/Get-ZAAlert.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZADatastore.Tests.ps1 b/Tests/Public/Get-ZADatastore.Tests.ps1 index c1e5653..8cc0132 100644 --- a/Tests/Public/Get-ZADatastore.Tests.ps1 +++ b/Tests/Public/Get-ZADatastore.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAEvent.Tests.ps1 b/Tests/Public/Get-ZAEvent.Tests.ps1 index 3766d44..61bcfd8 100644 --- a/Tests/Public/Get-ZAEvent.Tests.ps1 +++ b/Tests/Public/Get-ZAEvent.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 index 1032f8f..4ab1f59 100644 --- a/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalAverageHistory.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 b/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 index ada02a1..4ab0358 100644 --- a/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalAverageSize.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalBreach.Tests.ps1 b/Tests/Public/Get-ZAJournalBreach.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZAJournalBreach.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalBreach.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 b/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalHistoryStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 index a5f82d1..b91ec04 100644 --- a/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteAverageHistory.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 index a5f82d1..b91ec04 100644 --- a/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteAverageSize.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 index a5f82d1..b91ec04 100644 --- a/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteHistoryStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 index a5f82d1..b91ec04 100644 --- a/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteHistorySummary.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 b/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 index a5f82d1..b91ec04 100644 --- a/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSiteSizeStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 b/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalStatusProportion.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 b/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalStorageStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAJournalSummary.Tests.ps1 b/Tests/Public/Get-ZAJournalSummary.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZAJournalSummary.Tests.ps1 +++ b/Tests/Public/Get-ZAJournalSummary.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZALicense.Tests.ps1 b/Tests/Public/Get-ZALicense.Tests.ps1 index c7e8462..e3e16ee 100644 --- a/Tests/Public/Get-ZALicense.Tests.ps1 +++ b/Tests/Public/Get-ZALicense.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 11 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 11 + It "$global:function should have exactly 11 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 11 } } diff --git a/Tests/Public/Get-ZAMonitoring.Tests.ps1 b/Tests/Public/Get-ZAMonitoring.Tests.ps1 index 69c36ca..1ced87b 100644 --- a/Tests/Public/Get-ZAMonitoring.Tests.ps1 +++ b/Tests/Public/Get-ZAMonitoring.Tests.ps1 @@ -1,15 +1,15 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 12 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 12 + It "$global:function should have exactly 12 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 12 } - it "$global:function has a non-mandatory string parameter for the zOrgIdentifier" { + It "$global:function has a non-mandatory string parameter for the zOrgIdentifier" { Get-Command $global:function | Should -HaveParameter zOrgIdentifier -Type String Get-Command $global:function | Should -HaveParameter zOrgIdentifier -not -Mandatory } diff --git a/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 index 1a3b5cc..be1237c 100644 --- a/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteAverageIOPS.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 index 1a3b5cc..be1237c 100644 --- a/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteAveragePerformance.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 index 2c7833c..0d7b26a 100644 --- a/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 b/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 index 2c7833c..0d7b26a 100644 --- a/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkSiteSummary.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 index ada02a1..4ab0358 100644 --- a/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgAverageIOPS.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 index ada02a1..4ab0358 100644 --- a/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgAveragePerformance.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 index f1ad9c2..e2ece1b 100644 --- a/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 b/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 index f1ad9c2..e2ece1b 100644 --- a/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 +++ b/Tests/Public/Get-ZANetworkVpgSummary.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 index 376f710..f6b7536 100644 --- a/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerJournalSizeReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 index be0afa1..357d797 100644 --- a/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerNetworkPerformanceReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAPlannerSite.Tests.ps1 b/Tests/Public/Get-ZAPlannerSite.Tests.ps1 index f15ee7b..0697f3d 100644 --- a/Tests/Public/Get-ZAPlannerSite.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 index 376f710..f6b7536 100644 --- a/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerStatsReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 index 97173fa..6f43e52 100644 --- a/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerWanReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 b/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 index c7302d5..9940422 100644 --- a/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 +++ b/Tests/Public/Get-ZAPlannerZcasReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAProtectedVm.Tests.ps1 b/Tests/Public/Get-ZAProtectedVm.Tests.ps1 index 89e1e5d..cb28168 100644 --- a/Tests/Public/Get-ZAProtectedVm.Tests.ps1 +++ b/Tests/Public/Get-ZAProtectedVm.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAProtectedVmReport.Tests.ps1 b/Tests/Public/Get-ZAProtectedVmReport.Tests.ps1 index 95ad321..40af444 100644 --- a/Tests/Public/Get-ZAProtectedVmReport.Tests.ps1 +++ b/Tests/Public/Get-ZAProtectedVmReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 b/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 index 7cb989f..5ba5c2d 100644 --- a/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 +++ b/Tests/Public/Get-ZARPOAccountAverage.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZARPOAverage.Tests.ps1 b/Tests/Public/Get-ZARPOAverage.Tests.ps1 index aa6d9e7..eb3a548 100644 --- a/Tests/Public/Get-ZARPOAverage.Tests.ps1 +++ b/Tests/Public/Get-ZARPOAverage.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZARPOBreach.Tests.ps1 b/Tests/Public/Get-ZARPOBreach.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZARPOBreach.Tests.ps1 +++ b/Tests/Public/Get-ZARPOBreach.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZARPOStat.Tests.ps1 b/Tests/Public/Get-ZARPOStat.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZARPOStat.Tests.ps1 +++ b/Tests/Public/Get-ZARPOStat.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 b/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 +++ b/Tests/Public/Get-ZARPOStatusProportion.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZARPOSummary.Tests.ps1 b/Tests/Public/Get-ZARPOSummary.Tests.ps1 index b0ad1b1..94b7a9e 100644 --- a/Tests/Public/Get-ZARPOSummary.Tests.ps1 +++ b/Tests/Public/Get-ZARPOSummary.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZASite.Tests.ps1 b/Tests/Public/Get-ZASite.Tests.ps1 index e9c710c..6ce1ca9 100644 --- a/Tests/Public/Get-ZASite.Tests.ps1 +++ b/Tests/Public/Get-ZASite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZASitePair.Tests.ps1 b/Tests/Public/Get-ZASitePair.Tests.ps1 index 7cb989f..5ba5c2d 100644 --- a/Tests/Public/Get-ZASitePair.Tests.ps1 +++ b/Tests/Public/Get-ZASitePair.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZASiteTopology.Tests.ps1 b/Tests/Public/Get-ZASiteTopology.Tests.ps1 index f97e366..ebe6cb0 100644 --- a/Tests/Public/Get-ZASiteTopology.Tests.ps1 +++ b/Tests/Public/Get-ZASiteTopology.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZATask.Tests.ps1 b/Tests/Public/Get-ZATask.Tests.ps1 index c8ceb12..2a38bde 100644 --- a/Tests/Public/Get-ZATask.Tests.ps1 +++ b/Tests/Public/Get-ZATask.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAVolume.Tests.ps1 b/Tests/Public/Get-ZAVolume.Tests.ps1 index 6d1a5a0..7042d03 100644 --- a/Tests/Public/Get-ZAVolume.Tests.ps1 +++ b/Tests/Public/Get-ZAVolume.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAVpg.Tests.ps1 b/Tests/Public/Get-ZAVpg.Tests.ps1 index 3b9bd52..90f9b3f 100644 --- a/Tests/Public/Get-ZAVpg.Tests.ps1 +++ b/Tests/Public/Get-ZAVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZAzOrg.Tests.ps1 b/Tests/Public/Get-ZAzOrg.Tests.ps1 index 8ac00f2..e3e16ee 100644 --- a/Tests/Public/Get-ZAzOrg.Tests.ps1 +++ b/Tests/Public/Get-ZAzOrg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoAlert.Tests.ps1 b/Tests/Public/Get-ZertoAlert.Tests.ps1 index 8f3c29b..9944cda 100644 --- a/Tests/Public/Get-ZertoAlert.Tests.ps1 +++ b/Tests/Public/Get-ZertoAlert.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoDatastore.Tests.ps1 b/Tests/Public/Get-ZertoDatastore.Tests.ps1 index 49d9e80..a250084 100644 --- a/Tests/Public/Get-ZertoDatastore.Tests.ps1 +++ b/Tests/Public/Get-ZertoDatastore.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoEvent.Tests.ps1 b/Tests/Public/Get-ZertoEvent.Tests.ps1 index 4149371..5a418e8 100644 --- a/Tests/Public/Get-ZertoEvent.Tests.ps1 +++ b/Tests/Public/Get-ZertoEvent.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoLicense.Tests.ps1 b/Tests/Public/Get-ZertoLicense.Tests.ps1 index 8ac00f2..e3e16ee 100644 --- a/Tests/Public/Get-ZertoLicense.Tests.ps1 +++ b/Tests/Public/Get-ZertoLicense.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoLocalSite.Tests.ps1 b/Tests/Public/Get-ZertoLocalSite.Tests.ps1 index fe3af42..b82e8a6 100644 --- a/Tests/Public/Get-ZertoLocalSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoLocalSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoPeerSite.Tests.ps1 b/Tests/Public/Get-ZertoPeerSite.Tests.ps1 index 9456bd7..16ab624 100644 --- a/Tests/Public/Get-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoPeerSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoProtectedVm.Tests.ps1 b/Tests/Public/Get-ZertoProtectedVm.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoProtectedVm.Tests.ps1 +++ b/Tests/Public/Get-ZertoProtectedVm.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoRecoveryReport.Tests.ps1 b/Tests/Public/Get-ZertoRecoveryReport.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoRecoveryReport.Tests.ps1 +++ b/Tests/Public/Get-ZertoRecoveryReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoResourcesReport.Tests.ps1 b/Tests/Public/Get-ZertoResourcesReport.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoResourcesReport.Tests.ps1 +++ b/Tests/Public/Get-ZertoResourcesReport.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoServiceProfile.Tests.ps1 b/Tests/Public/Get-ZertoServiceProfile.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoServiceProfile.Tests.ps1 +++ b/Tests/Public/Get-ZertoServiceProfile.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoTask.Tests.ps1 b/Tests/Public/Get-ZertoTask.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoTask.Tests.ps1 +++ b/Tests/Public/Get-ZertoTask.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 b/Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 +++ b/Tests/Public/Get-ZertoUnprotectedVm.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 b/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 index b5f0f7e..100a482 100644 --- a/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 +++ b/Tests/Public/Get-ZertoVirtualizationSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { @@ -59,7 +59,7 @@ Describe $global:function -Tag 'Unit', 'Source', 'Built' { } Context "$global:function::Parameter Functional Tests" { - Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { + Mock -ModuleName ZertoApiWrapper -CommandName Invoke-ZertoRestRequest -ParameterFilter { $uri -eq 'virtualizationsites' } { return (Get-Content "$global:here\Mocks\VirtualSite-NoParams.json" -Raw) | ConvertFrom-Json diff --git a/Tests/Public/Get-ZertoVolume.Tests.ps1 b/Tests/Public/Get-ZertoVolume.Tests.ps1 index 4b86f54..a46cda1 100644 --- a/Tests/Public/Get-ZertoVolume.Tests.ps1 +++ b/Tests/Public/Get-ZertoVolume.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoVpg.Tests.ps1 b/Tests/Public/Get-ZertoVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Get-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoVpgSetting.Tests.ps1 b/Tests/Public/Get-ZertoVpgSetting.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoVpgSetting.Tests.ps1 +++ b/Tests/Public/Get-ZertoVpgSetting.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoVra.Tests.ps1 b/Tests/Public/Get-ZertoVra.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoVra.Tests.ps1 +++ b/Tests/Public/Get-ZertoVra.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoZorg.Tests.ps1 b/Tests/Public/Get-ZertoZorg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoZorg.Tests.ps1 +++ b/Tests/Public/Get-ZertoZorg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Get-ZertoZsspSession.Tests.ps1 b/Tests/Public/Get-ZertoZsspSession.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Get-ZertoZsspSession.Tests.ps1 +++ b/Tests/Public/Get-ZertoZsspSession.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 b/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 index ce84a86..20db68c 100644 --- a/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 +++ b/Tests/Public/Import-ZertoVmNicSetting.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 11 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 11 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } It "Has a mandatory string array parameter for the settings file to import" { diff --git a/Tests/Public/Import-ZertoVpg.Tests.ps1 b/Tests/Public/Import-ZertoVpg.Tests.ps1 index f0f8969..6b48c30 100644 --- a/Tests/Public/Import-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Import-ZertoVpg.Tests.ps1 @@ -1,12 +1,12 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 12 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 12 + It "$global:function should have exactly 12 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 12 } It "Has a mandatory string array parameter for the settings file to import" { diff --git a/Tests/Public/Install-ZertoVra.Tests.ps1 b/Tests/Public/Install-ZertoVra.Tests.ps1 index 7105db6..a5005d3 100644 --- a/Tests/Public/Install-ZertoVra.Tests.ps1 +++ b/Tests/Public/Install-ZertoVra.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Invoke-ZARestRequest.Tests.ps1 b/Tests/Public/Invoke-ZARestRequest.Tests.ps1 index 7a6eade..983c373 100644 --- a/Tests/Public/Invoke-ZARestRequest.Tests.ps1 +++ b/Tests/Public/Invoke-ZARestRequest.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 b/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 index 47629c7..cfd3c2e 100644 --- a/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoEvacuateVra.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Invoke-ZertoFailover.Tests.ps1 b/Tests/Public/Invoke-ZertoFailover.Tests.ps1 index efe2cc7..88e38bd 100644 --- a/Tests/Public/Invoke-ZertoFailover.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailover.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 b/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 index b5d1cd6..5c59b8b 100644 --- a/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailoverCommit.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 b/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 index 84109bd..248b8f1 100644 --- a/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoFailoverRollback.Tests.ps1 @@ -1,16 +1,16 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 12 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 12 + It "$global:function should have exactly 12 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 12 } - it "has a mandatory string parameter for the vpgName" { + It "has a mandatory string parameter for the vpgName" { Get-Command $global:function | Should -HaveParameter vpgName Get-Command $global:function | Should -HaveParameter vpgName -Type string[] Get-Command $global:function | Should -HaveParameter vpgName -Mandatory diff --git a/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 b/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 index 159e825..e35259a 100644 --- a/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoForceSync.Tests.ps1 @@ -1,16 +1,16 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 12 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 12 + It "$global:function should have exactly 12 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 12 } - it "has a mandatory string parameter for the vpgName" { + It "has a mandatory string parameter for the vpgName" { Get-Command $global:function | Should -HaveParameter vpgName Get-Command $global:function | Should -HaveParameter vpgName -Type string[] Get-Command $global:function | Should -HaveParameter vpgName -Mandatory diff --git a/Tests/Public/Invoke-ZertoMove.Tests.ps1 b/Tests/Public/Invoke-ZertoMove.Tests.ps1 index 393d66b..aaca87b 100644 --- a/Tests/Public/Invoke-ZertoMove.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMove.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 b/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 index 81f585a..06b7449 100644 --- a/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMoveCommit.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 b/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 index 53c3383..8e0b4fd 100644 --- a/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoMoveRollback.Tests.ps1 @@ -1,16 +1,16 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { Context "$global:function::Parameter Unit Tests" { - it "$global:function should have exactly 14 parameters defined" { - (get-command $global:function).Parameters.Count | Should -Be 14 + It "$global:function should have exactly 14 parameters defined" { + (Get-Command $global:function).Parameters.Count | Should -Be 14 } - it "has a mandatory string parameter for the vpgName" { + It "has a mandatory string parameter for the vpgName" { Get-Command $global:function | Should -HaveParameter vpgName Get-Command $global:function | Should -HaveParameter vpgName -Type string[] Get-Command $global:function | Should -HaveParameter vpgName -Mandatory diff --git a/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 b/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 index f0c7315..16ed79e 100644 --- a/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 +++ b/Tests/Public/Invoke-ZertoRestRequest.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/New-ZertoPairingToken.Tests.ps1 b/Tests/Public/New-ZertoPairingToken.Tests.ps1 index 51ccce7..8d69a2c 100644 --- a/Tests/Public/New-ZertoPairingToken.Tests.ps1 +++ b/Tests/Public/New-ZertoPairingToken.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { BeforeAll { diff --git a/Tests/Public/New-ZertoVpg.Tests.ps1 b/Tests/Public/New-ZertoVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/New-ZertoVpg.Tests.ps1 +++ b/Tests/Public/New-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/New-ZertoVpgSettingsIdentifier.Tests.ps1 b/Tests/Public/New-ZertoVpgSettingsIdentifier.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/New-ZertoVpgSettingsIdentifier.Tests.ps1 +++ b/Tests/Public/New-ZertoVpgSettingsIdentifier.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Remove-ZertoPeerSite.Tests.ps1 b/Tests/Public/Remove-ZertoPeerSite.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Remove-ZertoPeerSite.Tests.ps1 +++ b/Tests/Public/Remove-ZertoPeerSite.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Remove-ZertoVpg.Tests.ps1 b/Tests/Public/Remove-ZertoVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Remove-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Remove-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 b/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 +++ b/Tests/Public/Remove-ZertoVpgSettingsIdentifier.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Resume-ZertoVpg.Tests.ps1 b/Tests/Public/Resume-ZertoVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Resume-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Resume-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Save-ZertoVpgSetting.Tests.ps1 b/Tests/Public/Save-ZertoVpgSetting.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Save-ZertoVpgSetting.Tests.ps1 +++ b/Tests/Public/Save-ZertoVpgSetting.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Set-ZertoAlert.Tests.ps1 b/Tests/Public/Set-ZertoAlert.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Set-ZertoAlert.Tests.ps1 +++ b/Tests/Public/Set-ZertoAlert.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Set-ZertoLicense.Tests.ps1 b/Tests/Public/Set-ZertoLicense.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Set-ZertoLicense.Tests.ps1 +++ b/Tests/Public/Set-ZertoLicense.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Set-ZertoUserCredential.Tests.ps1 b/Tests/Public/Set-ZertoUserCredential.Tests.ps1 index 4cca845..74cc8ac 100644 --- a/Tests/Public/Set-ZertoUserCredential.Tests.ps1 +++ b/Tests/Public/Set-ZertoUserCredential.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { InModuleScope -ModuleName ZertoApiWrapper { diff --git a/Tests/Public/Start-ZertoCloneVpg.Tests.ps1 b/Tests/Public/Start-ZertoCloneVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Start-ZertoCloneVpg.Tests.ps1 +++ b/Tests/Public/Start-ZertoCloneVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Start-ZertoFailoverTest.Tests.ps1 b/Tests/Public/Start-ZertoFailoverTest.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Start-ZertoFailoverTest.Tests.ps1 +++ b/Tests/Public/Start-ZertoFailoverTest.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 b/Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 +++ b/Tests/Public/Stop-ZertoCloneVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 b/Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 +++ b/Tests/Public/Stop-ZertoFailoverTest.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Suspend-ZertoVpg.Tests.ps1 b/Tests/Public/Suspend-ZertoVpg.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Suspend-ZertoVpg.Tests.ps1 +++ b/Tests/Public/Suspend-ZertoVpg.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/Public/Uninstall-ZertoVra.Tests.ps1 b/Tests/Public/Uninstall-ZertoVra.Tests.ps1 index e6e6083..770482b 100644 --- a/Tests/Public/Uninstall-ZertoVra.Tests.ps1 +++ b/Tests/Public/Uninstall-ZertoVra.Tests.ps1 @@ -1,6 +1,6 @@ #Requires -Modules Pester -$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path) -$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0] +$global:here = (Split-Path -Parent $PSCommandPath) +$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0] Describe $global:function -Tag 'Unit', 'Source', 'Built' { diff --git a/Tests/ZertoApiWrapper.Tests.ps1 b/Tests/ZertoApiWrapper.Tests.ps1 index bcbb9ca..0f398ae 100644 --- a/Tests/ZertoApiWrapper.Tests.ps1 +++ b/Tests/ZertoApiWrapper.Tests.ps1 @@ -1,5 +1,5 @@ #Requires -Modules Pester -$testPath = Split-Path -Parent $MyInvocation.MyCommand.Path +$testPath = Split-Path -Parent $PSCommandPath $docsPath = $testPath -replace 'Tests', 'docs' $modulePath = $testPath -replace 'Tests', 'ZertoApiWrapper' $module = Split-Path -Leaf $modulePath @@ -9,7 +9,7 @@ Describe "Module: $module" -Tags 'Unit' { Context "Module Configuration" { It "Has a root module file ($module.psm1)" { - "$modulePath\$module.psm1" | should -Exist + "$modulePath\$module.psm1" | Should -Exist } It "Is valid Powershell (Has no script errors)" { @@ -75,20 +75,20 @@ Describe "Module: $module" -Tags 'Unit' { $externalHelpFile | Should -Exist } - it "External Help file does not contain place holder values" { - $stubExist = Get-Content -Path $externalHelpFile | Where-Object {$_.Trim() -like '*{{*}}*'} + It "External Help file does not contain place holder values" { + $stubExist = Get-Content -Path $externalHelpFile | Where-Object { $_.Trim() -like '*{{*}}*' } if ($stubExist) { Write-Warning "Found a stub in the Markdown File $externalHelpFile" Write-Warning "$stubExist" } - $stubExist | should benullorempty + $stubExist | Should benullorempty } } It "Is an advanced function" { - $Function.FullName | should -FileContentMatch 'function' - $Function.FullName | should -FileContentMatch 'cmdletbinding' - $Function.FullName | should -FileContentMatch 'param' + $Function.FullName | Should -FileContentMatch 'function' + $Function.FullName | Should -FileContentMatch 'cmdletbinding' + $Function.FullName | Should -FileContentMatch 'param' } It "Is valid Powershell (Has no script errors)" { @@ -97,15 +97,15 @@ Describe "Module: $module" -Tags 'Unit' { $errors | Should -HaveCount 0 } - it "Has openbraces on the same line as the statement" { - $openingBracesExist = $contents | Where-Object {$_.Trim() -eq '{'} + It "Has openbraces on the same line as the statement" { + $openingBracesExist = $contents | Where-Object { $_.Trim() -eq '{' } if ($openingBracesExist) { Write-Warning "Found the following opening brances on their own line:" foreach ($openingBrace in $openingBracesExist) { Write-Warning "Opening Brace on it's own line - $openingBrace" } } - $openingBracesExist | should -BeNullOrEmpty + $openingBracesExist | Should -BeNullOrEmpty } } }