Skip to content

Commit 2ee2daf

Browse files
Add import in test and more ALC logging
1 parent 5cf2888 commit 2ee2daf

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

src/dsc/psresourceget.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,11 @@ function PopulatePSResourceListObject {
881881
}
882882

883883
if ($null -eq (Get-Module -Name Microsoft.PowerShell.PSResourceGet)) {
884+
Write-Trace -level trace -message "Microsoft.PowerShell.PSResourceGet module is not currently loaded. Getting loaded assemblies for diagnostics."
885+
Get-LoadedAssembliesByALC | Select-Object -Property ALCName, AssemblyName, Location | ForEach-Object {
886+
Write-Trace -message "ALC: $($_.ALCName) - Assembly: $($_.AssemblyName) - Location: $($_.Location)" -level trace
887+
}
888+
884889
Write-Trace -level trace -message "Microsoft.PowerShell.PSResourceGet module is not imported. Importing it."
885890
Import-Module -Name Microsoft.PowerShell.PSResourceGet -Force -ErrorAction Stop -Verbose
886891
}

test/DscResource/PSResourceGetDSCResource.Tests.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ function SetupDsc {
3434
Write-Verbose -Verbose "Adding DSC resource path to PATH environment variable: $resourcePath"
3535

3636
$env:PATH += "$pathSeparator$resourcePath"
37+
38+
Import-Module -Path $resourcePath -Verbose -Force
3739
}
3840

3941
function SetupTestRepos {

0 commit comments

Comments
 (0)