Update Method to Grab Path

https://jakubjares.com/2020/04/11/pester5-importing-ps-files/
This commit is contained in:
Wes Carroll
2020-04-20 16:35:02 -04:00
parent 71610ce9fe
commit 6620246e4c
107 changed files with 273 additions and 273 deletions
+5 -5
View File
@@ -1,16 +1,16 @@
#Requires -Modules Pester
$global:here = (Split-Path -Parent $MyInvocation.MyCommand.Path)
$global:function = ((Split-Path -leaf $MyInvocation.MyCommand.Path).Split('.'))[0]
$global:here = (Split-Path -Parent $PSCommandPath)
$global:function = ((Split-Path -leaf $PSCommandPath).Split('.'))[0]
Describe $global:function -Tag 'Unit', 'Source', 'Built' {
Context "$global:function::Parameter Unit Tests" {
it "$global:function should have exactly 12 parameters defined" {
(get-command $global:function).Parameters.Count | Should -Be 12
It "$global:function should have exactly 12 parameters defined" {
(Get-Command $global:function).Parameters.Count | Should -Be 12
}
it "has a mandatory string parameter for the vpgName" {
It "has a mandatory string parameter for the vpgName" {
Get-Command $global:function | Should -HaveParameter vpgName
Get-Command $global:function | Should -HaveParameter vpgName -Type string[]
Get-Command $global:function | Should -HaveParameter vpgName -Mandatory