---
title: "Set-CatInstance"
description: "Set-CatInstance — set or remove the license key. Works without sign-in."
url: "https://docs.justcat.it/reference/powershell-module/set-catinstance/"
---
# Set-CatInstance

## Synopsis

```powershell
Set-CatInstance [[-LicenseKey] <string>] [[-LoggingLevel] <string>] [[-LoggingPath] <string>]
```

## Parameters

| Parameter | Type | Position | Default | Meaning |
|-----------|------|----------|---------|---------|
| `-LicenseKey` | string | 0 |  | The key to store. Empty or omitted **removes** the stored key. |
| `-LoggingLevel` | string | 1 | `None` | `None` · `Fatal` · `Error` · `Warning` · `Information` · `Debug` · `Verbose`. |
| `-LoggingPath` | string | 2 | `Documents\CAT\Logs\cat-log.log` | Log file, when logging is on. |

## What it does

Writes the key to `%APPDATA%\CAT\.catconfig` (`~/.config/CAT/.catconfig` on Linux), the file that identifies this installation and is shared by every CAT tool on the machine. It does **not** sign in — a key can be installed on a machine that has no portal access and no token. Setting a key is how the **Enterprise** plan is activated; once a valid key is stored, every cmdlet works offline and `CAT_PORTAL_TOKEN` is no longer read. The key takes effect immediately for the next cmdlet; no restart is needed.

The key is checked before it is stored: a genuine CAT key is stored even when it is expired or not yet valid (what it unlocks is decided at every use, and a future key starts working the day its window opens); anything that is not a CAT key — a typo, a truncated paste — is refused and the stored key is left unchanged.

## Output

Nothing. With `-Verbose`, the steps.

## Errors

Terminating error `LicenseKeyNotSet` — `The license key was not set. <reason>` — when the key is not a CAT key. Removing a key never fails.

## Examples

```powershell
# activate the Enterprise plan on this machine
Set-CatInstance -LicenseKey 'your-license-key'
Get-CatInstance | Select-Object LicenseKey

# go back to no key (sign-in with CAT_PORTAL_TOKEN applies again)
Set-CatInstance -LicenseKey ''
```

## Related

- [Introduction](https://docs.justcat.it/reference/powershell-module/introduction/ "Introduction") — session model, logging, errors, sign-in. (sign-in, plans and the license key)
- [`Get-CatInstance`](https://docs.justcat.it/reference/powershell-module/get-catinstance/ "Get-CatInstance") — see what is stored.
- [Get CAT license](https://docs.justcat.it/how-to-guides/licensing-and-admin/get-license/ "Get CAT license") · [Apply a license key](https://docs.justcat.it/how-to-guides/licensing-and-admin/apply-license-key/ "Apply a license key") · [Compare plans](https://docs.justcat.it/compare-plans/ "Compare plans").

