mirror of
https://github.com/Corsinvest/cv4pve-api-powershell.git
synced 2026-04-25 12:15:48 +03:00
[GH-ISSUE #47] Invoke-PveRestApi does not catch empty PveTicketLast #30
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cv4pve-api-powershell#30
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @r3st0r3 on GitHub (Dec 19, 2025).
Original GitHub issue: https://github.com/Corsinvest/cv4pve-api-powershell/issues/47
What happened?
If no cluster connect happens before first call of Invoke-PveRestApi an error is thrown:
Instead the function should throw an exception when the fallback to $Global:PveTicketLast does not work because it is empty/null.
To reproduce use following code for example (load module before):
Get-PveClusterOptionsError
Yes this only happens when the coder/user forgets to connect first or when the connect attempt fails and is not catched. But clean code should throw an exception here.
Expected behavior
clean and catchable exception like:
Relevant log output
Proxmox VE Version
9.1.0
Module Version
9.1.0
PowerShell Version
7.4.10
Version (working)
No response
On what operating system are you experiencing the issue?
Windows
Pull Request