fix(test): add -Confirm:$false to all ConfirmImpact.High cmdlet calls in tests

ConfirmImpact.High causes interactive confirmation prompts in
non-interactive CI, blocking before ProcessRecord runs. Add
-Confirm:$false to all Stop-PveVm, Reset-PveVm, Remove-*,
Restore-*, and New-PveTemplate calls in both unit and integration tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Clint Branham
2026-03-20 12:40:54 -05:00
parent 202b472d7a
commit ae55dbf0d7
7 changed files with 18 additions and 18 deletions
@@ -244,7 +244,7 @@ Describe 'Stop-PveContainer' {
Context 'Without active session' {
It 'Should throw when no session is active' {
Skip-IfMissing 'Stop-PveContainer'
{ Stop-PveContainer -Node 'pve-node1' -VmId 200 -ErrorAction Stop } |
{ Stop-PveContainer -Node 'pve-node1' -VmId 200 -Confirm:$false -ErrorAction Stop } |
Should -Throw '*No active Proxmox VE session*'
}
}
@@ -224,7 +224,7 @@ Describe 'Remove-PveContainerSnapshot' {
Context 'Without active session' {
It 'Should throw when no session is active (without -WhatIf)' {
Skip-IfMissing 'Remove-PveContainerSnapshot'
{ Remove-PveContainerSnapshot -Node 'pve-node1' -VmId 100 -Name 'snap1' -ErrorAction Stop } |
{ Remove-PveContainerSnapshot -Node 'pve-node1' -VmId 100 -Name 'snap1' -Confirm:$false -ErrorAction Stop } |
Should -Throw '*No active Proxmox VE session*'
}
}
@@ -292,7 +292,7 @@ Describe 'Restore-PveContainerSnapshot' {
Context 'Without active session' {
It 'Should throw when no session is active (without -WhatIf)' {
Skip-IfMissing 'Restore-PveContainerSnapshot'
{ Restore-PveContainerSnapshot -Node 'pve-node1' -VmId 100 -Name 'snap1' -ErrorAction Stop } |
{ Restore-PveContainerSnapshot -Node 'pve-node1' -VmId 100 -Name 'snap1' -Confirm:$false -ErrorAction Stop } |
Should -Throw '*No active Proxmox VE session*'
}
}