Comments (6)
Pull Request #49 contained a pair of commands to try to address this concern:
- Connect-ADO
- Disconnect-ADO
Import-ADOProxy has been there for a bit, though you are correct in that it's a bit too fancy for most users.
Connect-ADO will currently default the -Organization on all -ADO* commands and it will also cache a PAT. It primarily works by setting $psDefaultParameterValues ( a PowerShell v4+ feature, if memory serves)
Disconnect-ADO will clear this information.
I'm going to leave this issue open so that you can validate and request additional changes. I'm probably going to have Connect-ADO augment tab completion on connection (so that -Project will autocomplete to the list of projects in your org you can see, for instance).
Please attempt use of this feature in 0.4.5, let me know if Connect-ADO fits your needs, and update this issue with additional feature requests.
from psdevops.
I 100% agree that typing in these fields every time is a PITA. I agree with the intent of the requirement. I've been thinking about how I'll accomplish such a thing.
There are a couple of things I have against just setting universal defaults:
- Not all operations require -Project, and some act very differently when provided a project
- It doesn't allow me do side-by-side operations (say, TFS --> Azure DevOps, or Org1-->Org2)
The other approach I've had in mind for this problem is the ability to create and maintain a "proxy module". In this, you'd do something similar to above, except you'd also specify the name of this module and an optional prefix.
So maybe something like:
Import-PSDevOps -Org Start-Automating -Project PSDevOps -Name StartAutomatingDevOps -Prefix SA
That would import a copy of the module, which renames cmdlets to Get-SABuild, and defaults to -Organization StartAutomating and -Project PSDevOps
This way, you could have multiple proxies loaded, they wouldn't step on each other, and you could gracefully handle the "project cmdlets" or "org cmdlets" problem.
What do you think of this approach, compared to your suggestion?
Asking it another way:
Is it easier to remember to call your set first, and make a number of mandatory parameters optional (thus perpetually forget -Org or -Project) or is it easier to build your proxy once?
from psdevops.
Personally I could work with what ever improvement that you find is more aligned with your road map.
But from an adoption point of view, I'm afraid the proxy module will be to complex for what ordinary people are trying to gain. It is the first time that I ever heard about proxy modules, with a prefix, that will then prep my module context and variables. But I'm no powershell ninja, so I might just missing to learn about that concept.
For the side-by-side stuff, if you need these things, then you are in a more advanced scenario and know what you're after. Then you could do classic splatting to overcome this, and totally ditch our efforts and gain 100% control.
My scenario is more about being able to write a simpler and more lean script, that only works against a single organization and/or project.
To answer your question: I believe that it is easier for people to understand to run the Set-ADOParameter, than understading the proxy implementation.
from psdevops.
I'm going to assume that the rocket emoji means this issue can be closed. Please confirm.
from psdevops.
I'm going to test it tomorrow during my day job.
I'll keep you posted.
from psdevops.
I'm gonna call this "good" with Connect-ADO / Disconnect-ADO
from psdevops.
Related Issues (20)
- Get-ADOServiceHealth
- Allow Import-BuildStep to point to external ps1 file
- Add GitHub/On/Issue
- PSDevOps should use PipeScript
- PSDevOps should consolidate workflow
- PSDevOps should have a logo
- Convert-BuildStep mishandles object parameters in GitHub workflow
- /GitHub/Steps/PublishPowerShellGallery should be able to -Exclude files
- /GitHub/Steps/ReleaseModule should be able to -ReleaseAsset
- PSDevOps should use GitPub for microblogging
- New-GitHubAction should be able to -OutputPath
- New-GitHubWorkflow should be able to -OutputPath
- New-ADOPipeline should be able to -OutputPath
- PSDevOps GitHub Action should prefer local bits
- Start-ADOBuild BulkRun HOT 4
- Make More GitHub Commands
- get-adoteam doesn't return full list of teams HOT 6
- Feature Request: Get token automatically HOT 1
- Get-ADOTeam: Add -First and -Skip and support pagination
- Feature request: handle rate limiting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psdevops.