mirror of
https://github.com/Corsinvest/cv4pve-api-powershell.git
synced 2026-04-25 20:25:48 +03:00
[GH-ISSUE #22] @tag-??? search in get-pvevm uses incorrect substring length #16
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#16
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 @sgtmjrme on GitHub (Sep 23, 2024).
Original GitHub issue: https://github.com/Corsinvest/cv4pve-api-powershell/issues/22
What happened?
If you attempt to filter your get-pvevm command using the "-vmidorname '@tag-BLAH'" flag, it returns nothing.
The issue is that the elseif search uses $item.substring(6)... "@tag-" is only 5 characters, and so adding any character between your expected tag and the "-" will make it work again. Ex, "@tag-ABLAH" will search for all VM's with a tag of "BLAH".
*While doing other testing, I've also noticed that (at least for the API for 8.2.7), tags are separated with semi-colons instead of commas, so searching for a tag when a VM has more than one always fails.
Expected behavior
It returns something when used appropriately.
Relevant log output
Proxmox VE Version
8.2.7
Version (bug)
Latest
Version (working)
No response
On what operating system are you experiencing the issue?
Windows
Pull Request