Skip to content

Commit e5a727d

Browse files
committed
Add debugging
1 parent 2782953 commit e5a727d

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

test/InstallPSResourceTests/InstallPSResourceLocal.Tests.ps1

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,33 @@ Describe 'Test Install-PSResource for local repositories' -tags 'CI' {
145145
$pkg.Name | Should -Be $testModuleClobber
146146
$pkg.Version | Should -Be "1.0.0"
147147

148-
Install-PSResource -Name $testModuleClobber2 -Repository $localRepo -TrustRepository -NoClobber -ErrorVariable ev -ErrorAction SilentlyContinue
148+
149+
# Get the first available module named 'clobbertestmodule1' and its exported commands
150+
$module = (Get-Module -ListAvailable $testModuleClobber)[0]
151+
152+
# Iterate through each exported command in the module
153+
foreach ($command in $module.ExportedCommands.Values) {
154+
# Output the command's name and details
155+
Write-Output "Command Name: $($command.Name)"
156+
Write-Output "Command Type: $($command.CommandType)"
157+
Write-Output "----------------------------------"
158+
}
159+
160+
161+
Install-PSResource -Name $testModuleClobber2 -Repository $localRepo -TrustRepository -NoClobber -ErrorVariable ev -ErrorAction SilentlyContinue -verbose
149162
$pkg = Get-InstalledPSResource $testModuleClobber2 -ErrorAction SilentlyContinue
163+
164+
# Get the first available module named 'clobbertestmodule1' and its exported commands
165+
$module2 = (Get-Module -ListAvailable $testModuleClobber2)[0]
166+
167+
# Iterate through each exported command in the module
168+
foreach ($command in $module2.ExportedCommands.Values) {
169+
# Output the command's name and details
170+
Write-Output "Command Name: $($command.Name)"
171+
Write-Output "Command Type: $($command.CommandType)"
172+
Write-Output "----------------------------------"
173+
}
174+
150175
$pkg | Should -BeNullOrEmpty
151176
$ev.Count | Should -Be 1
152177
$ev[0] | Should -Be "'testModuleClobber2' package could not be installed with error: The following commands are already available on this system: 'Test-Cmdlet1, Test-Cmdlet1'. This module 'testModuleClobber2' may override the existing commands. If you still want to install this module 'testModuleClobber2', remove the -NoClobber parameter."

0 commit comments

Comments
 (0)