Skip to content

Commit b6bf046

Browse files
Debug test
1 parent 70f17ce commit b6bf046

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/dsc/psresourceget.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ function ConvertInputToPSResource(
274274

275275
# catch any un-caught exception and write it to the error stream
276276
trap {
277-
# Write-Trace -Level Error -message $_.Exception.Message
277+
Write-Trace -Level Error -message $_.Exception.Message
278278
# exit 1
279279
Get-LoadedAssembliesByALC | Select-Object -Property ALCName, AssemblyName, Location | ForEach-Object {
280280
Write-Trace -message "ALC: $($_.ALCName) - Assembly: $($_.AssemblyName) - Location: $($_.Location)" -level trace

test/DscResource/PSResourceGetDSCResource.Tests.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ function SetupDsc {
4242
throw "Module to test not found: $moduleToTest"
4343
}
4444

45-
Import-Module $moduleToTest -Verbose -Force
45+
$psrgMod = Get-Module -Name Microsoft.PowerShell.PSResourceGet
46+
47+
if (-not $psrgMod) {
48+
Write-Verbose -Verbose "In SetupDsc: Importing module: $moduleToTest "
49+
Import-Module $moduleToTest -Verbose -Force
50+
}
4651
}
4752

4853
function SetupTestRepos {
@@ -112,6 +117,8 @@ Describe 'Repository Resource Tests' -Tags 'CI' {
112117

113118
$resourceInput = $repoParams | ConvertTo-Json -Depth 5
114119

120+
Get-Module -Name Microsoft.PowerShell.PSResourceGet | Write-Verbose -Verbose
121+
115122
$getResult = & $script:dscExe -l trace resource get --resource Microsoft.PowerShell.PSResourceGet/Repository --input $resourceInput -o json | ConvertFrom-Json
116123

117124
$getResult.actualState.name | Should -BeExactly 'TestRepo'

0 commit comments

Comments
 (0)