Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@tag-??? search in get-pvevm uses incorrect substring length #22

Closed
1 task
sgtmjrme opened this issue Sep 23, 2024 · 0 comments
Closed
1 task

@tag-??? search in get-pvevm uses incorrect substring length #22

sgtmjrme opened this issue Sep 23, 2024 · 0 comments

Comments

@sgtmjrme
Copy link

sgtmjrme commented Sep 23, 2024

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

PS C:\Program Files\PowerShell\7> get-pvevm -vmidorname '@tag-rj'
PS C:\Program Files\PowerShell\7> get-pvevm -vmidorname '@tag-Brj'

name      : <Server Name>
...

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

  • I would like to do a Pull Request
franklupo added a commit that referenced this issue Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant