Skip to content

Commit a748b43

Browse files
committed
Fix test logging
1 parent fe36692 commit a748b43

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/InstallPSResourceTests/InstallPSResourceLocal.Tests.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,12 @@ Describe 'Test Install-PSResource for local repositories' -tags 'CI' {
163163
Install-PSResource -Name $testModuleClobber2 -Repository $localRepo -TrustRepository -NoClobber -ErrorVariable ev -ErrorAction SilentlyContinue -verbose
164164
$pkg = Get-InstalledPSResource $testModuleClobber2 -ErrorAction SilentlyContinue
165165

166-
# Get the first available module named 'clobbertestmodule1' and its exported commands
167-
$module2 = (Get-Module -ListAvailable $testModuleClobber2)[0]
168-
$module2Idx = $module[0]
169-
# Iterate through each exported command in the module
170-
foreach ($command in $module2Idx.ExportedCommands.Values) {
166+
if (!$pkg) {
167+
# Get the first available module named 'clobbertestmodule1' and its exported commands
168+
$module2 = (Get-Module -ListAvailable $testModuleClobber2)[0]
169+
$module2Idx = $module[0]
170+
# Iterate through each exported command in the module
171+
foreach ($command in $module2Idx.ExportedCommands.Values) {
171172
# Output the command's name and details
172173
Write-Verbose -Verbose "Command Name: $($command.Name)"
173174
Write-Verbose -Verbose "Command Type: $($command.CommandType)"

0 commit comments

Comments
 (0)