Skip to content

Commit 8e63705

Browse files
authored
Fix configuration (#32)
1 parent 74a60c4 commit 8e63705

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

src/PSDesiredStateConfiguration/PSDesiredStateConfiguration.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
RootModule = 'PSDesiredStateConfiguration.psm1'
1010

1111
# Version number of this module.
12-
moduleVersion = '2.0.2'
12+
moduleVersion = '2.0.3'
1313

1414
# Supported PSEditions
1515
CompatiblePSEditions = @('Core')

src/PSDesiredStateConfiguration/PSDesiredStateConfiguration.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,7 @@ function Configuration
18901890
return $null
18911891
}
18921892

1893-
$moduleToImport | Forearch-Object -Process {
1893+
$moduleToImport | Foreach-Object -Process {
18941894
$versionToUse = $_.Version
18951895
if( [string]::IsNullOrEmpty($versionToUse))
18961896
{

test/configuration.Tests.ps1

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
Describe "DSC MOF Compilation" -tags "CI" {
4+
BeforeAll {
5+
$module = Get-Module PowerShellGet -ListAvailable | Sort-Object -Property Version -Descending | Select-Object -First 1
6+
7+
$psGetModuleVersion = $module.Version.ToString()
8+
}
9+
10+
It "Should be able to compile a MOF using PSModule resource" {
11+
if ($IsLinux) {
12+
Set-ItResult -Pending -Because "https://github.com/PowerShell/PowerShellGet/pull/529"
13+
}
14+
15+
Write-Verbose "DSC_HOME: ${env:DSC_HOME}" -verbose
16+
[Scriptblock]::Create(@"
17+
configuration DSCTestConfig
18+
{
19+
Import-DscResource -ModuleName PowerShellGet -ModuleVersion $psGetModuleVersion
20+
Node "localhost" {
21+
PSModule f1
22+
{
23+
Name = 'PsDscResources'
24+
InstallationPolicy = 'Trusted'
25+
}
26+
}
27+
}
28+
29+
DSCTestConfig -OutputPath TestDrive:\DscTestConfig2
30+
"@) | Should -Not -Throw
31+
32+
"TestDrive:\DscTestConfig2\localhost.mof" | Should -Exist
33+
}
34+
}

0 commit comments

Comments
 (0)