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

query specific field while listing environments #270

Closed
sanjeev40084 opened this issue Aug 18, 2022 · 1 comment
Closed

query specific field while listing environments #270

sanjeev40084 opened this issue Aug 18, 2022 · 1 comment

Comments

@sanjeev40084
Copy link

i am trying to assign security role to multiple environments to one of my user. the process i was planning to follow was to retrieve all 'sandbox' environment-id first and loop through each of those environment id to use 'pac admin assign-user' command to assign the security role to the user. however i haven't figure out a way just to select 'environment id' or 'environment url' while running 'pac admin list' command. Is there a way i can just get those fields (environment url or environment id), save in some sort of array and be able to loop through.

@tehcrashxor
Copy link
Member

pac admin list supports a number of filters:
image
so you can filter to just the Sandbox environments with pac admin list --type sandbox

There are no plans to add options to the PAC commands to only display a specified field, but this can be accomplished by piping the output to shell commands or scripts to select that for you. This will of course depend on which OS and shell you use, but as an example with PowerShell, you could:
pac admin list --type sandbox --json | ConvertFrom-Json | Select-Object -Property EnvironmentUrl
image

@tehcrashxor tehcrashxor closed this as not planned Won't fix, can't repro, duplicate, stale Mar 3, 2023
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

2 participants