I am trying to achieve that my output if it is one single line it gets written away in a variable
This is what i have so far
az group list --query '[].{name:name}' --output table
$filter = Read-Host -Prompt "Please filter to find the correct resource group"
az group list --query "[?contains(name, '$filter')].name" --output tsv
what this code does is that you can filter all the resource groups and you get to see the ouptut in a TSV
What i am trying to add is that it checks if it is the only line and then write that line away (if it is one line)
Since you are already using powershell, why not just use powershell?
Thanks for the help with changing the code! The end result is now: