# Execute PowerShell Snippet

> Execute a piece of custom PowerShell code.

Source: https://docs.capaone.com/capaone/application-manager/powerbricks/execute-powershell-snippet/  
Product: CapaOne — a separate CapaSystems product; do not apply this page to any other.

Execute a piece of custom PowerShell code

:::note[Using the PowerShell Scripting Library]
Inside this snippet you have the full CapaSystems PowerShell Scripting Library available — the `$cs.*` helper functions and cmdlets documented under [CapaInstaller PowerPacks](/capainstaller/powerpacks/). It is the same `CapaOne.ScriptingLibrary.dll` that powers PowerPacks, and the [PowerPack global variables](/capainstaller/powerpacks/powerpack-global-variables/) (for example `$global:Packageroot`) are available too.

Unlike CapaInstaller PowerPacks, CapaOne has no `kit` folder — every file you reference lives directly in `$global:Packageroot`.
:::

## Parameters

#### PowerShell Snippet
*Required* — Default: `#Your PowerShell Code starts here`

The PowerShell code to execute

## Details

- **Category:** Power brick
- **Brick ID:** `PowerShell-Snippet`

## Raw JSON definition

**JSON**

```json
{
  "category": "powerBrick",
  "description": "Execute a piece of custom PowerShell code",
  "developerVendor": "CapaSystems A/S",
  "displayName": null,
  "id": "PowerShell-Snippet",
  "name": "Execute PowerShell Snippet",
  "parameters": [
    {
      "allowManualInput": null,
      "defaultValue": "#Your PowerShell Code starts here\r\n",
      "defaultValueObject": null,
      "description": "The PowerShell code to execute",
      "id": "powershell",
      "name": "PowerShell Snippet",
      "regExValidation": "",
      "required": true,
      "type": "Powershell",
      "value": null,
      "values": null,
      "valuesObject": null
    }
  ],
  "powershell": {
    "base64Encoded": false,
    "function": ""
  },
  "type": "powerbrick",
  "version": "1.0.0.0"
}
```
