Comments (5)
Good deal. I'll update this issue again when I've added the command to create agents/pools/queues.
from psdevops.
0.4.5 (updated in PR #49) contains Remove-ADOAgentPool, which should remove pools, queues, and agents.
I'll be adding New-ADOAgentPool, which should create pools, queues, and agents, in a future build.
Please try out Remove-ADOAgentPool and let me know how it works for you.
Please provide any more information you can about your scenarios for managing agents, as this is an area of nearterm future development.
from psdevops.
Thank you @StartAutomating for working on this. It's very much appreciated!
I have one question though. When using the following command, I still get prompted with "are you sure you want to perform this action?"
Remove-ADOAgentPool -PoolID $myAgentPoolId -Confirm
I would have expected that the -Confirm
parameter would ensure that the agent pool is removed without giving a prompt. I will be using the command non-interactively; in a pipeline or Azure Automation runbook. So the prompt will be a problem.
from psdevops.
@rwaal You can avoid the prompts by passing -Confirm:$false, an explanation of the general PowerShell behavior is below.
-WhatIf/-Confirm are actually very old PowerShell language features related to process confirmation.
If a Cmdlet SupportsShouldProcess, the Cmdlet automatically gets two parameters: -WhatIf and -Confirm
-WhatIf would preview execution but not run it. In most cases, this will print a message directly to the host. In PSDevOps, generally, it will return all of the parameters it would pass to Invoke-ADORestAPI, minus the PersonalAccessToken.
-Confirm seems a little counterintuitive, mainly because it's understood backwards and it's one of the very few times you'll often want to pass a $false to a [switch].
A Cmdlet that SupportsshouldProcess will prompt when $psCmdlet.ShouldProcess runs, if the the Cmdlet's ConfirmImpact -ge $ConfirmPreference (which defaults to 'High'). Lots of Cmdlets SupportShouldProcess but have a ConfirmImpact of Medium or Low (for instance, New-Item). So Passing -Confirm is actually saying always confirm, even if the confirm impact is low. Passing -Confirm:$false is saying never confirm, no matter what the cmdlet's ConfirmImpact is.
As a general rule, you'll find ConfirmImpact to be set to 'High' to commands you'd expect to have a high level of system impact, e.g. Remove-s, Install-s, Uninstall-s.
Almost every command in PSDevOps will act as describe above, as it is used to test aspects of REST apis without incurring cost, mocking, or using a secret value.
from psdevops.
Thanks for educating me on this. I've tried it with the -Confirm:$false
parameter, and it works like a charm.
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.