Skip to content

Commit 71f31cc

Browse files
committed
Debug lines
1 parent 52738e6 commit 71f31cc

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

extensions/powershell/convertDscResource.psm1

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
$Script:IsPowerShellCore = $PSVersionTable.PSEdition -eq 'Core'
2-
3-
if ($Script:IsPowerShellCore) {
4-
if ($IsWindows) {
5-
Import-Module -Name 'PSDesiredStateConfiguration' -RequiredVersion 1.1 -UseWindowsPowerShell -WarningAction SilentlyContinue
6-
}
7-
Import-Module -Name 'PSDesiredStateConfiguration' -MinimumVersion 2.0.7 -Prefix 'Pwsh' -WarningAction SilentlyContinue
8-
} else {
9-
Import-Module -Name 'PSDesiredStateConfiguration' -RequiredVersion 1.1 -WarningAction SilentlyContinue
10-
}
11-
121
function Write-DscTrace {
132
param(
143
[Parameter(Mandatory = $false)]
@@ -22,6 +11,19 @@ function Write-DscTrace {
2211
$host.ui.WriteErrorLine($trace)
2312
}
2413

14+
$Script:IsPowerShellCore = $PSVersionTable.PSEdition -eq 'Core'
15+
16+
if ($Script:IsPowerShellCore) {
17+
if ($IsWindows) {
18+
Import-Module -Name 'PSDesiredStateConfiguration' -RequiredVersion 1.1 -UseWindowsPowerShell -WarningAction SilentlyContinue
19+
}
20+
Import-Module -Name 'PSDesiredStateConfiguration' -MinimumVersion 2.0.7 -Prefix 'Pwsh' -WarningAction SilentlyContinue
21+
} else {
22+
"Loading module: 'PSDesiredStateConfiguration" | Write-DscTrace -Operation Trace
23+
"The PSModulePaths: $env:PSModulePath" | Write-DscTrace -Operation Trace
24+
Import-Module -Name 'PSDesiredStateConfiguration' -RequiredVersion 1.1 -WarningAction SilentlyContinue
25+
}
26+
2527
function Build-DscConfigDocument {
2628
[CmdletBinding()]
2729
[OutputType([System.Collections.Specialized.OrderedDictionary])]

0 commit comments

Comments
 (0)