< Back

New-OctopusConnection

Sat Jan 18, 2020 5:30 pm

NAME New-OctopusConnection



SYNOPSIS

Creates an endpoint to connect to an Octopus Server





SYNTAX

New-OctopusConnection [<CommonParameters>]





DESCRIPTION

Creates an endpoint to connect to an Octopus Server





PARAMETERS

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Octoposh.Model.OctopusConnection





---------- EXAMPLE 1 ----------



PS C:\\> $c = New-octopusconnection ; $c.repository.environments.findall()



Gets all the environments on the Octopus instance using the Octopus .NET client repository

---------- EXAMPLE 2 ----------



PS C:\\> $c = New-OctopusConnection ; invoke-webrequest -header $c.header -uri

http://Octopus.company.com/api/environments/all -method Get



Uses the [Header] Member of the Object returned by New-OctopusConnection as a header to call the REST API using

Invoke-WebRequest and get all the Environments of the instance



RELATED LINKS

WebSite: http://Octoposh.net

Github Project: https://github.com/Dalmirog/OctoPosh/

Wiki: http://octoposh.readthedocs.io

QA and Feature requests: https://gitter.im/Dalmirog/OctoPosh#initial