mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Fixing up mof compilation test script to set PSMODULEPATH properly
This commit is contained in:
@@ -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