Skip to content

Commit 2d10602

Browse files
committed
Set verbosePreference
1 parent f71d987 commit 2d10602

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

extensions/powershell/convertDscResource.psm1

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ if ($Script:IsPowerShellCore)
99
Import-Module -Name 'PSDesiredStateConfiguration' -MinimumVersion 2.0.7 -Prefix 'Pwsh'
1010
}
1111

12+
$VerbosePreference = 'Continue'
13+
1214
function Write-DscTrace {
1315
param(
1416
[Parameter(Mandatory = $false)]
@@ -109,15 +111,6 @@ function ConvertTo-DscObject
109111
$Tokens = $null
110112
$ParseErrors = $null
111113

112-
(Get-Module -Name 'PSDesiredStateConfiguration' -ListAvailable | ConvertTo-Json) | Write-DscTrace Debug
113-
114-
# # Load the PSDesiredStateConfiguration module
115-
# Import-Module -Name 'PSDesiredStateConfiguration' -RequiredVersion '1.1' -Force -ErrorAction stop -ErrorVariable $importModuleError
116-
# if (-not [string]::IsNullOrEmpty($importModuleError)) {
117-
# 'Could not import PSDesiredStateConfiguration 1.1 in Windows PowerShell. ' + $importModuleError | Write-DscTrace -Operation Error
118-
# exit 1
119-
# }
120-
121114
# Remove the module version information.
122115
$start = $Content.ToLower().IndexOf('import-dscresource')
123116
if ($start -ge 0)
@@ -209,6 +202,7 @@ function ConvertTo-DscObject
209202
}
210203
else
211204
{
205+
Write-Verbose -Message "Loading DSC resources from module '$($moduleToLoad.ModuleName)'" -Verbose
212206
$currentResources = Get-DSCResource -Module $moduleToLoad.ModuleName
213207
}
214208

extensions/powershell/win_powershell.tests.ps1

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ BeforeDiscovery {
3333
Describe 'PowerShell extension tests' {
3434
It 'Example PowerShell file should work' -Skip:(!$IsWindows -or !$isElevated) {
3535
Write-Verbose -Message $env:PSModulePath -Verbose
36-
37-
$names = Get-ChildItem "$env:SystemRoot\System32\WindowsPowerShell\v1.0\Modules"
38-
foreach ($name in $names) {
39-
Write-Verbose -Message "Found module: $($name.Name)" -Verbose
40-
}
4136

4237
$psFile = Resolve-Path -Path "$PSScriptRoot\..\..\dsc\examples\variable.dsc.ps1"
4338
$out = dsc -l trace config get -f $psFile 2>$TestDrive/error.log | ConvertFrom-Json

0 commit comments

Comments
 (0)