This repository was archived by the owner on Jun 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +31
-24
lines changed
Modules/OperationValidation Expand file tree Collapse file tree 9 files changed +31
-24
lines changed Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ param (
263
263
[string []]$Name ,
264
264
[version ]$Version
265
265
)
266
- foreach ($p in $env: psmodulepath .split (" ; " ))
266
+ foreach ($p in $env: PSModulePath .split ($ script :pathSeparator ))
267
267
{
268
268
if ( Test-Path - Path $p )
269
269
{
Original file line number Diff line number Diff line change 1
1
2
+ $script :pathSeparator = [IO.Path ]::PathSeparator
3
+
2
4
# Dot source public/private functions
3
5
$public = @ ( Get-ChildItem - Path $PSScriptRoot \Public\* .ps1 - Recurse - ErrorAction SilentlyContinue )
4
6
$private = @ ( Get-ChildItem - Path $PSScriptRoot \Private\* .ps1 - Recurse - ErrorAction SilentlyContinue )
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ function Get-ModuleList {
12
12
13
13
if ($PSCmdlet.ParameterSetName -eq ' Name' )
14
14
{
15
- $pathsToSearch = $env: PSModulePath.Split (' ; ' )
15
+ $pathsToSearch = $env: PSModulePath.Split ($ script :pathSeparator )
16
16
}
17
17
elseIf ($PSCmdlet.ParameterSetName -eq ' Path' )
18
18
{
Original file line number Diff line number Diff line change @@ -230,7 +230,7 @@ function Invoke-OperationValidation
230
230
$testInfo = Get-OperationValidation @getOvfParams
231
231
}
232
232
233
- if ( $null -ne $ testInfo )
233
+ if ( $testInfo )
234
234
{
235
235
# first check to be sure all of the TestInfos are sane
236
236
foreach ($ti in $testinfo )
@@ -343,7 +343,7 @@ function Invoke-OperationValidation
343
343
else
344
344
{
345
345
$pesterParams.Quiet = ! $IncludePesterOutput
346
- }
346
+ }
347
347
348
348
foreach ($filePath in $TestFilePath ) {
349
349
write-progress - Activity " Invoking tests in $filePath "
Original file line number Diff line number Diff line change @@ -6,12 +6,13 @@ $testModuleDir = (Resolve-Path -Path (Join-Path -Path $env:BHProjectPath -ChildP
6
6
7
7
# Get module commands
8
8
# Remove all versions of the module from the session. Pester can't handle multiple versions.
9
+ $pathSeparator = [IO.Path ]::PathSeparator
9
10
$savedModulePath = $env: PSModulePath
10
- if ( $env: psmodulepath .split (" ; " ) -notcontains $testModuleDir ) {
11
- $env: psmodulepath += " ; $ testModuleDir"
11
+ if ( $env: PSModulePath .split ($pathSeparator ) -notcontains $testModuleDir ) {
12
+ $env: PSModulePath += ( $pathSeparator + $ testModuleDir)
12
13
}
13
- if ($env: PSModulePath.Split (' ; ' ) -notcontains $env: BHModulePath ) {
14
- $env: PSModulePath += " ; $ env: BHProjectPath"
14
+ if ($env: PSModulePath.Split ($pathSeparator ) -notcontains $env: BHModulePath ) {
15
+ $env: PSModulePath += ( $pathSeparator + $ env: BHProjectPath)
15
16
}
16
17
Remove-Module Microsoft.PowerShell.Operation.Validation - Force - ErrorAction SilentlyContinue - Verbose:$false
17
18
Import-Module $env: BHModulePath - Force - Verbose:$false
Original file line number Diff line number Diff line change @@ -4,12 +4,13 @@ $testModuleDir = (Resolve-Path -Path (Join-Path -Path $env:BHProjectPath -ChildP
4
4
Describe " OperationValidation Module Tests" {
5
5
6
6
BeforeAll {
7
+ $pathSeparator = [IO.Path ]::PathSeparator
7
8
$SavedModulePath = $env: PSModulePath
8
- if ( $env: psmodulepath .split (" ; " ) -notcontains $testModuleDir ) {
9
- $env: psmodulepath += " ; $ testModuleDir"
9
+ if ( $env: PSModulePath .split ($pathSeparator ) -notcontains $testModuleDir ) {
10
+ $env: PSModulePath += ( $pathSeparator + $ testModuleDir)
10
11
}
11
- if ($env: PSModulePath.Split (' ; ' ) -notcontains $env: BHModulePath ) {
12
- $env: PSModulePath += " ; $ env: BHProjectPath"
12
+ if ($env: PSModulePath.Split ($pathSeparator ) -notcontains $env: BHModulePath ) {
13
+ $env: PSModulePath += ( $pathSeparator + $ env: BHProjectPath)
13
14
}
14
15
Remove-Module Microsoft.PowerShell.Operation.Validation - Force - ErrorAction SilentlyContinue
15
16
Import-Module $env: BHModulePath - Force
Original file line number Diff line number Diff line change @@ -4,12 +4,13 @@ $testModuleDir = (Resolve-Path -Path (Join-Path -Path $env:BHProjectPath -ChildP
4
4
Describe ' Get-OperationValidation' {
5
5
6
6
BeforeAll {
7
+ $pathSeparator = [IO.Path ]::PathSeparator
7
8
$savedModulePath = $env: PSModulePath
8
- if ($testModuleDir -notin $env: psmodulepath .split (" ; " )) {
9
- $env: PSModulePath += " ; $ testModuleDir"
9
+ if ($testModuleDir -notin $env: PSModulePath .split ($pathSeparator )) {
10
+ $env: PSModulePath += ( $pathSeparator + $ testModuleDir)
10
11
}
11
- if ($env: BHProjectPath -notin $env: PSModulePath.Split (' ; ' )) {
12
- $env: PSModulePath += " ; $ env: BHProjectPath"
12
+ if ($env: BHProjectPath -notin $env: PSModulePath.Split ($pathSeparator )) {
13
+ $env: PSModulePath += ( $pathSeparator + $ env: BHProjectPath)
13
14
}
14
15
Remove-Module Microsoft.PowerShell.Operation.Validation - Force - ErrorAction SilentlyContinue - Verbose:$false
15
16
Import-Module $env: BHModulePath - Force - Verbose:$false
Original file line number Diff line number Diff line change @@ -4,12 +4,13 @@ $testModuleDir = (Resolve-Path -Path (Join-Path -Path $env:BHProjectPath -ChildP
4
4
Describe ' Invoke-OperationValidation' {
5
5
6
6
BeforeAll {
7
+ $pathSeparator = [IO.Path ]::PathSeparator
7
8
$savedModulePath = $env: PSModulePath
8
- if ($testModuleDir -notin $env: psmodulepath .split (" ; " )) {
9
- $env: PSModulePath += " ; $ testModuleDir"
9
+ if ($testModuleDir -notin $env: PSModulePath .split ($pathSeparator )) {
10
+ $env: PSModulePath += ( $pathSeparator + $ testModuleDir)
10
11
}
11
- if ($env: BHProjectPath -notin $env: PSModulePath.Split (' ; ' )) {
12
- $env: PSModulePath += " ; $ env: BHProjectPath"
12
+ if ($env: BHProjectPath -notin $env: PSModulePath.Split ($pathSeparator )) {
13
+ $env: PSModulePath += ( $pathSeparator + $ env: BHProjectPath)
13
14
}
14
15
Remove-Module Microsoft.PowerShell.Operation.Validation - Force - ErrorAction SilentlyContinue - Verbose:$false
15
16
Import-Module $env: BHModulePath - Force - Verbose:$false
Original file line number Diff line number Diff line change 2
2
Describe ' Module' {
3
3
4
4
BeforeAll {
5
+ $pathSeparator = [IO.Path ]::PathSeparator
5
6
$savedModulePath = $env: PSModulePath
6
- if ( $env: psmodulepath .split (" ; " ) -notcontains $testModuleDir ) {
7
- $env: psmodulepath += " ; $ testModuleDir"
7
+ if ( $env: PSModulePath .split ($pathSeparator ) -notcontains $testModuleDir ) {
8
+ $env: PSModulePath += ( $pathSeparator + $ testModuleDir)
8
9
}
9
- if ($env: PSModulePath.Split (' ; ' ) -notcontains $env: BHModulePath ) {
10
- $env: PSModulePath += " ; $ env: BHProjectPath"
10
+ if ($env: PSModulePath.Split ($pathSeparator ) -notcontains $env: BHModulePath ) {
11
+ $env: PSModulePath += ( $pathSeparator + $ env: BHProjectPath)
11
12
}
12
13
Remove-Module Microsoft.PowerShell.Operation.Validation - Force - ErrorAction SilentlyContinue
13
14
Import-Module $env: BHModulePath - Force
You can’t perform that action at this time.
0 commit comments