Files
Andy Jordan f665242c1b Move installation of test modules to bootstrapping (#132)
So we can get this working on OneBranch.
2026-02-19 18:14:20 -08:00

39 lines
1.3 KiB
PowerShell

# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
Describe "DSC MOF Compilation" {
BeforeAll {
$module = Get-Module PowerShellGet -ListAvailable | Sort-Object -Property Version -Descending | Select-Object -First 1
$psGetModuleVersion = $module.Version.ToString()
}
It "Should be able to compile a MOF using PSModule resource" {
if ($env:GITHUB_ACTIONS -eq 'true' -or $env:TF_BUILD -eq 'true') {
Set-ItResult -Skipped -Because "does not work in CI"
}
if (-not $IsWindows) {
Set-ItResult -Pending -Because "https://github.com/PowerShell/PowerShellGet/pull/529"
}
Write-Verbose "DSC_HOME: ${env:DSC_HOME}" -verbose
[Scriptblock]::Create(@"
configuration DSCTestConfig
{
Import-DscResource -ModuleName PowerShellGet -ModuleVersion $psGetModuleVersion
Node "localhost" {
PSModule f1
{
Name = 'PSDscResources'
InstallationPolicy = 'Trusted'
}
}
}
DSCTestConfig -OutputPath TestDrive:\DscTestConfig2
"@) | Should -Not -Throw
"TestDrive:\DscTestConfig2\localhost.mof" | Should -Exist
}
}