Tools for managing and automating your Azure DevOps Agents.
Перейти к файлу
Josh Wittner d48661ed26
Merge pull request #43 from tristanbarcelon/develop
Add support for installing pipelines-agent binaries, but default to installing vsts-agent binaries
2023-08-15 14:20:08 -07:00
VSTSAgent Detect presence of agentfolder and support overwrite confirmation 2023-08-05 07:36:40 -04:00
.gitignore VSTSAgent Cmdlets and DSC Resource 2018-05-10 15:50:47 -07:00
LICENSE VSTSAgent Cmdlets and DSC Resource 2018-05-10 15:50:47 -07:00
README.md Link to project issues in README.md 2020-11-12 09:43:14 -05:00
SECURITY.md Microsoft mandatory file 2023-06-02 19:08:20 +00:00
appveyor.yml Appveyor driver and build docs 2018-05-10 16:24:31 -07:00
build.ps1 VSTSAgent Cmdlets and DSC Resource 2018-05-10 15:50:47 -07:00

README.md

VSTS Agent Powershell Module

Tools for managing and automating your Visual Studio Team Services Agents.

Builds

Master

Build status

The master branch is automatically built and deployed to the PowerShell Gallery.

Develop

Build status

The develop branch is automatically built and deployed as a prerelease module to the PowerShell Gallery.

Installation

Install-Module VSTSAgent -Scope CurrentUser

Using

Cmdlets

Get all of your installed VSTS Agents:

Get-VSTSAgent | Format-Table -AutoSize

# Sample Output
# Id Name    PoolId ServerUrl                          Work                             Service                    Version Path
# -- ----    ------ ---------                          ----                             -------                    ------- ----
# 54 Agent01      1 https://account.visualstudio.com/  file:///D:/VSTSAgentWork/Agent01 vstsagent.account.Agent01  2.138.0 file:///C:/VSTSAgents/Agent01

Install the latest VSTS Agent:

$pat = Read-Host -AsSecureString
Install-VSTSAgent -ServerUrl 'https://account.visualstudio.com' -PAT $pat -Name 'Agent01'

Uninstall any VSTS Agents:

Uninstall-VSTSAgent

Find available VSTS Agents for installation:

Find-VSTSAgent

Start and Stop installed Agents:

Stop-VSTSAgent
Start-VSTSAgent

DSC

VSTSAgent includes the xVSTSAgent DSC Resource. An example configuration might look like:

Configuration Sample_xVSTSAgent_Install {
    param 
    (   
        [parameter(Mandatory = $true)] 
        [PSCredential]$AccountCredential
    )
    Import-DscResource -ModuleName VSTSAgent

    Node 'localhost' {

        xVSTSAgent VSTSAgent {
            Name              = 'Agent01'
            ServerUrl         = 'https://account.visualstudio.com'
            AccountCredential = $AccountCredential
            AgentDirectory    = 'C:\VSTSAgents'
            Work              = 'D:\VSTSAgentsWork\Agent01'
            Ensure            = 'Present'
        }
    }
}

Feedback

To file issues or suggestions, please use the Issues page for this project on GitHub.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Reporting Security Issues

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) at secure@microsoft.com. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.