Fix configuration (#32)

This commit is contained in:
Travis Plunk
2019-09-10 18:00:26 -07:00
committed by GitHub
parent 74a60c4a16
commit 8e6370598c
3 changed files with 36 additions and 2 deletions
@@ -9,7 +9,7 @@
RootModule = 'PSDesiredStateConfiguration.psm1'
# Version number of this module.
moduleVersion = '2.0.2'
moduleVersion = '2.0.3'
# Supported PSEditions
CompatiblePSEditions = @('Core')
@@ -1890,7 +1890,7 @@ function Configuration
return $null
}
$moduleToImport | Forearch-Object -Process {
$moduleToImport | Foreach-Object -Process {
$versionToUse = $_.Version
if( [string]::IsNullOrEmpty($versionToUse))
{
+34
View File
@@ -0,0 +1,34 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
Describe "DSC MOF Compilation" -tags "CI" {
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 ($IsLinux) {
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
}
}