MethodsAndPractices / vsteam

PowerShell module for accessing Azure DevOps Services and Azure DevOps Server (formerly VSTS or TFS)
https://methodsandpractices.github.io/vsteam-docs/
MIT License
445 stars 155 forks source link

Put area before resource in Invoke-VSteam Request, add completers and allow it to expand values #302

Closed jhoneill closed 4 years ago

jhoneill commented 4 years ago

Area comes first on the URL path and it's confusing to have it suggested first.

It would be nice if -area tab completed and if -area was present the -resource was also tab completable . At least 50% of the time the value property of the output is required so a switch which says give me the values would be helpful.

SebastianSchuetze commented 4 years ago

do you see an API for the completion or do you mean hard coded?

jhoneill commented 4 years ago

As far as I can see there is no API to find out what available, so wrote have a script (generate-areaClasses.ps1) which re-writes the completer classes and adds everything the module knows about. I know "wiki" is missing, and there are probably others which need to be typed. I might read down the documents for any more, it's just a time saver, not a validator. I was doing other completers and just got tired of (a) Having the parameters in a different order from how the URI got build , and (b) typing them all the time. 30 minutes writing which is paying itself back 2 or 3 seconds at a time!

DarqueWarrior commented 4 years ago

We can get the areas and resources from Get-VSTeamOption. I am working on this now. I have it where you can tab complete Area. Will create the resource completer next. The order of the parameters does not mater in the definition of the function just the order passed to the function.

DarqueWarrior commented 4 years ago

This was a great idea! I am close to being done.

DarqueWarrior commented 4 years ago

This will be in next release.

jhoneill commented 4 years ago

Glad you like the idea. The reason for having area before resource is when you tab complete the parameters it makes more sense to them in the order they appear in the URL . Having resource first leads to putting "teamsettings" first and "work" second and building a broken URL. After doing it for the 100th time I just swapped the parameter order on my version.