# PowerPack Global Variables

> The global variables available in PowerPack scripts, which also work in CapaOne Application Manager.

Source: https://docs.capaone.com/capainstaller/powerpacks/powerpack-global-variables/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

:::note[Also available in CapaOne]
These global variables also work in **CapaOne Application Manager** — on all brick parameters and inside the [Execute PowerShell Snippet](/capaone/application-manager/powerbricks/execute-powershell-snippet/) brick. In CapaOne there is no `kit` folder, so `$global:Packageroot` holds your files directly.
:::

### Set from the script parameters

These are set directly from the parameters CapaInstaller passes into every PowerPack script (see the `# DO NOT CHANGE THESE VARIABLES` block of the [script templates](/capainstaller/powerpacks/)) — available from the very start of the script, before `Initialize-Variables` runs.

| **Variable**            | **Data type** | **Example**                                       |
|:------------------------|:--------------|:---------------------------------------------------|
| $global:Packageroot     | string        | C:\Program Files\CapaInstaller\Client\Packages\... |
| $global:AppName         | string        | WS Ready To Use                                   |
| $global:AppRelease      | string        | 1.0                                                |
| $global:LogFile         | string        | C:\...\Logs\WS Ready To Use\Install.log            |
| $global:TempFolder      | string        | C:\...\Temp                                        |
| $global:DllPath         | string        | C:\...\CapaOne.ScriptingLibrary.dll                |
| $global:InputObject     | Object        | The Named Pipe connection back to CiBaseAgent (see below) |
| $global:PSLibVersion    | string        | 2026.04.24                                         |
| $global:Debug           | bool          | False — set `$true` to enable extra debug logging  |

:::note
`$global:InputObject` is how the script talks back to CiBaseAgent while it's running. The classic CapaInstaller Agent is VBScript and can't host a PowerShell Runspace itself, so when it hits a PowerPack it posts a job to CiBaseAgent (a .NET Framework app), which shells out to `PowerPack.exe` (.NET Core) to actually run the script. `PowerPack.exe` opens a Named Pipe back to CiBaseAgent, and that connection is what's exposed as `$InputObject` — it's what `Start-PSDownloadPackage` and `Exit-PSScript` use under the hood to report download progress, send the exit code, and request a reboot. See [How PowerPack installations work](/capainstaller/the-capainstaller-console/configuration-management/how-to-use-configuration-management/working-with-powerpacks/how-powerpack-installations-work/) for the full flow.
:::

### Configurable per package

Set in the `#### VARIABLES ####` block at the top of the script — see the [script templates](/capainstaller/powerpacks/) for the exact defaults used in the install vs. uninstall template.

| **Variable**                  | **Data type** | **Purpose**                                              |
|:-------------------------------|:--------------|:----------------------------------------------------------|
| $global:DownloadPackage        | bool          | Download the kit folder from the server before running    |
| $global:MinimumDiskspaceMB     | int           | Minimum free disk space required, in MB                   |

### Set by `Initialize-Variables`

:::note
These become available after `Initialize-Variables` runs in `#### MAIN ####`, before `PreInstall` — see [Initialize-Variables](/capainstaller/powerpacks/initialize-variables/).
:::

| **Variable**                   | **Data type**   | **Example**                                                            |
|:-------------------------------|:----------------|:-----------------------------------------------------------------------|
| $global:gsProgramFiles         | string          | C:\Program Files                                                       |
| $global:gsProgramFilesx86      | string          | C:\Program Files (x86)                                                 |
| $global:gsWindowsDir           | string          | C:\Windows                                                             |
| $global:gsWorkstationPath      | string          | C:\Program Files\CapaInstaller\Client\                                 |
| $global:gsSystemRoot           | string          | C:\Windows                                                             |
| $global:gsSystemDir            | string          | C:\Windows\System32                                                    |
| $global:gsSystemDirx86         | string          | C:\Windows\Syswow64                                                    |
| $global:gsLogDir               | string          | C:\Program Files\CapaInstaller\Client\Logs                             |
| $global:gsTempDir              | string          | C:\Program Files\CapaInstaller\Client\Logs\Temp                        |
| $global:gsOsSystem             | string          | Microsoft Windows 11 Pro N                                             |
| $global:gsOsVersion            | string          | 10.0.22631                                                             |
| $global:gsLog                  | string          | C:\Program Files\CapaInstaller\Client\Logs\WS Ready To Use\Install.log |
| $global:AppLogFolder           | string          | C:\Program Files\CapaInstaller\Client\Logs\WS Ready To Use             |
| $global:gsLogName              | string          | Install.log                                                            |
| $global:gsTask                 | string          | INSTALL                                                                |
| $global:gbDisablelog           | bool            | False                                                                  |
| $global:gbSuficientDiskSpace   | bool            | True                                                                   |
| $global:gsJobName              | string          | WS Ready To Use                                                        |
| $global:gsLibrary              | string          | C:\Program Files\CapaInstaller\Client\Lib                              |
| $global:gbx64                  | bool            | True                                                                   |
| $global:gsCommonPrograms       | string          | C:\ProgramData\Microsoft\Windows\Start Menu\Programs                   |
| $global:gsSysDrive             | string          | C:                                                                     |
| $global:gsCommonDesktop        | string          | C:\Users\Public\Desktop                                                |
| $global:gsCommonStartMenu      | string          | C:\ProgramData\Microsoft\Windows\Start Menu                            |
| $global:gsCommonStartup        | string          | C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup           |
| $global:gsCommonFilesDir       | string          | C:\Program Files\Common Files                                          |
| $global:gsCommonFilesDirx86    | string          | C:\Program Files (x86)\Common Files                                    |
| $global:gsCommonAppData        | string          | C:\ProgramData                                                         |
| $global:gsProgramData          | string          | C:\ProgramData                                                         |
| $global:gsProductid            | string          | WS Ready To Use                                                        |
| $global:gsAllusers             | string          | C:\ProgramData                                                         |
| $global:gsWorkstationName      | string          | TEST01                                                                 |
| $global:gsOsBuild              | string          | 22631                                                                  |
| $global:gsEditionId            | string          | ProfessionalN                                                          |
| $global:gsDisplayVersion       | string          | 23H2                                                                   |
| $global:gsWindowsType          | string          | WinNT                                                                  |
| $global:gsOsArchitechture      | string          | X64                                                                    |
| $global:gsWindowsVersion       | string          | 6.3                                                                    |
| $global:gsUnitName             | string          | 593F4D56-97B0-0CE5-A288-46DD2907041E                                   |
| $global:gsComputerManufacturer | string          | VMware, Inc.                                                           |
| $global:gsComputerModel        | string          | VMware20,1                                                             |
| $global:gsUUID                 | string          | 593F4D56-97B0-0CE5-A288-46DD2907041E                                   |

:::note
A few aliases pointing at the same value also exist: `$global:gsWindir` (same as `gsWindowsDir`), `$global:gsCommonFiles` and `$global:gsCommonFilesx86` (same as `gsCommonFilesDir` / `gsCommonFilesDirx86`).
:::
