mirror of
https://github.com/PowerShell/PSDesiredStateConfiguration
synced 2026-06-21 13:45:25 +00:00
Fix configuration (#32)
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user