Powershell wrapper around octoclient.dll to help interacting with any octopus instance. Cloud or on-premise
This module will let you use the octoclient in a more 'PowerShelly' way. This module is "as is" and there can be breaking changes in future versions.
Install-Module -Name OctopusDeploy
Connect-Octopus -OctopusServerURL https://octopus.instance.com -ApiKey $env:OctoApiKey
Save configuration by using Set-ConnectionConfiguration
Set-ConnectionConfiguration -OctopusServerURL https://octopus.instance.com -ApiKey ("API-XXXXXXXXXXXXXX" | ConvertTo-SecureString -AsPlainText -Force)
Using Connect-Octopus is not necessary. Module will connect automatically to the server as soon as the module is used
Get-Machine -Tenant Tenantname -Environment QA | Select name, roles
Name Roles
---- -----
Machine1 {default, fax.service, RISDatabaseServer, UpdateAgent.service}
Machine2 {default}
Machine3 {default}
$allTenants = Get-Tenant
$allTenants | Get-TenantMachine -Environment Production -MachineRole RISDatabaseServer | Sort-Object count -Descending
Tenant Machines Count
------ -------- -----
TenantName1 Octopus.Client.Model.MachineResource 1
TenantName2 Octopus.Client.Model.MachineResource 1
TenantName3 Octopus.Client.Model.MachineResource 1
TenantName4 Octopus.Client.Model.MachineResource 1
TenantName5 Octopus.Client.Model.MachineResource 1
TenantName6 Octopus.Client.Model.MachineResource 1
TenantName7 Octopus.Client.Model.MachineResource 1
Get-TagSet -CanonicalTagName -Name Rolloutgroups
Get-Tenant -TenantTag Rolloutgroups/DB-1