File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change 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
-
12
1
function Write-DscTrace {
13
2
param (
14
3
[Parameter (Mandatory = $false )]
@@ -22,6 +11,19 @@ function Write-DscTrace {
22
11
$host.ui.WriteErrorLine ($trace )
23
12
}
24
13
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
+
25
27
function Build-DscConfigDocument {
26
28
[CmdletBinding ()]
27
29
[OutputType ([System.Collections.Specialized.OrderedDictionary ])]
You can’t perform that action at this time.
0 commit comments