Skip to content

Commit 7342f16

Browse files
committed
Find PSDesiredStateConfiguration
1 parent 4183c27 commit 7342f16

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

extensions/powershell/convertDscResource.psm1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ function ConvertTo-DscObject
9898
$Tokens = $null
9999
$ParseErrors = $null
100100

101+
(Get-Module -Name 'PSDesiredStateConfiguration' | ConvertTo-Json) | Write-DscTrace Debug
102+
101103
# Load the PSDesiredStateConfiguration module
102-
Import-Module -Name 'PSDesiredStateConfiguration' -RequiredVersion 1.1 -UseWindowsPowerShell -WarningAction SilentlyContinue -ErrorVariable $importModuleError
104+
Import-Module -Name 'PSDesiredStateConfiguration' -RequiredVersion '1.1' -Force -ErrorAction stop -ErrorVariable $importModuleError
103105
if (-not [string]::IsNullOrEmpty($importModuleError)) {
104106
'Could not import PSDesiredStateConfiguration 1.1 in Windows PowerShell. ' + $importModuleError | Write-DscTrace -Operation Error
105107
exit 1

0 commit comments

Comments
 (0)