mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Fixing up mof compilation test script to set PSMODULEPATH properly
This commit is contained in:
1 parent
643533b6a8
commit
e0fdf1ed00
1 file changed
+10
-13
@@ -1,13 +1,15 @@
|
||||
$originalPSModulePath = $env:PSModulePath
|
||||
|
||||
try
|
||||
{
|
||||
$env:DSC_HOME = Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath assets) -ChildPath dsc
|
||||
# $env:PSMODULEPATH = $env:PSMODULEPATH + ";" + $env:DEVPATH + "Modules"
|
||||
# $env:PSModulePath = "$($env:DEVPATH)\Modules"
|
||||
|
||||
Describe "DSC MOF Compilation" -tags "CI" {
|
||||
|
||||
AfterAll {
|
||||
$env:PSMODULEPATH = $_modulePath
|
||||
}
|
||||
BeforeAll {
|
||||
$env:DSC_HOME = Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath assets) -ChildPath dsc
|
||||
$_modulePath = $env:PSMODULEPATH
|
||||
$powershellexe = (get-process -pid $PID).MainModule.FileName
|
||||
$env:PSMODULEPATH = join-path ([io.path]::GetDirectoryName($powershellexe)) Modules
|
||||
}
|
||||
|
||||
It "Should be able to compile a MOF from a basic configuration" -Skip:$IsWindows {
|
||||
[Scriptblock]::Create(@"
|
||||
configuration DSCTestConfig
|
||||
@@ -162,8 +164,3 @@ Describe "DSC MOF Compilation" -tags "CI" {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
$env:PSModulePath = $originalPSModulePath
|
||||
}
|
||||
Reference in new issue
Block a user