Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 1.35 KB

using-client-in-octopus.mdx

File metadata and controls

34 lines (26 loc) · 1.35 KB
layout pubDate modDate title description navOrder
src/layouts/Default.astro
2023-01-01
2023-01-01
Using in an Octopus Step
How to use the Octopus.Client library from inside Octopus, for example within a script step.
50

import OctopusClientShippedWithServerAndTentacle from 'src/shared-content/octopus-rest-api/octopus-client-shipped-with-server-and-tentacle.include.md';

You can use Octopus.Client from inside Octopus (for example in a script step or a package install script) by referencing it as a package. You can configure nuget.org as an External Feed that provides this package. Octopus will automatically extract this package for you, allowing your script to reference the .dll file it contains using a relative path. For example:

PowerShell
Add-Type -Path 'Octopus.Client/lib/netstandard2.0/Octopus.Client.dll'
C#
#r "Octopus.Client/lib/netstandard2.0/Octopus.Client.dll"
using Octopus.Client;
using Octopus.Client.Model;

The credentials would still need to be supplied to establish the connection.