﻿# Using in an Octopus Step

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](https://api.nuget.org/v3/index.json) as an [External Feed](/docs/packaging-applications/package-repositories/nuget-feeds) 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:

<details data-group="octopus-client-in-octopus-step">
<summary>PowerShell</summary>

```powershell
Add-Type -Path 'Octopus.Client/lib/netstandard2.0/Octopus.Client.dll'
```

</details>
<details data-group="octopus-client-in-octopus-step">
<summary>C#</summary>

```csharp 
#r "nuget: Octopus.Client"
using Octopus.Client;
using Octopus.Client.Model;
```

</details>

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

## Using Octopus.Client from installation folder {#using-octopus-client-from-install-folder}

Octopus Server and Tentacle both ship with a version of `Octopus.Client.dll` in the installation directory. Avoid using this in your scripts as this is considered an implementation detail of those products. As such it is subject to change at any time, and not guaranteed to work with your version of Octopus Server.
