fix(test): add -Confirm:$false to Suspend/Restart container Pester tests

Suspend-PveContainer and Restart-PveContainer gained ConfirmImpact.High
in F062/F063 fixes. The "Should throw when no session is active" Pester
tests invoke these cmdlets without -Confirm:$false, causing the
confirmation prompt to fire before the session check — failing in
non-interactive CI on all platforms.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Clint Branham
2026-03-23 15:09:58 -05:00
parent 339ffaf0bd
commit d74f8c952a
2 changed files with 2 additions and 2 deletions
@@ -70,7 +70,7 @@ Describe 'Suspend-PveContainer' -Tag 'Unit' {
Context 'Without active session' {
It 'Should throw when no session is active' {
Skip-IfMissing 'Suspend-PveContainer'
{ Suspend-PveContainer -Node 'pve' -VmId 100 -ErrorAction Stop } |
{ Suspend-PveContainer -Node 'pve' -VmId 100 -Confirm:$false -ErrorAction Stop } |
Should -Throw '*No active Proxmox VE session*'
}
}
@@ -288,7 +288,7 @@ Describe 'Restart-PveContainer' {
Context 'Without active session' {
It 'Should throw when no session is active' {
Skip-IfMissing 'Restart-PveContainer'
{ Restart-PveContainer -Node 'pve-node1' -VmId 200 -ErrorAction Stop } |
{ Restart-PveContainer -Node 'pve-node1' -VmId 200 -Confirm:$false -ErrorAction Stop } |
Should -Throw '*No active Proxmox VE session*'
}
}