mirror of
https://github.com/PowerShell/PSDesiredStateConfiguration
synced 2026-06-21 13:45:25 +00:00
f665242c1b
So we can get this working on OneBranch.
39 lines
1.3 KiB
PowerShell
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
|
|
}
|
|
}
|