# Start-PSDownloadPackage

> Triggers the download of the package's kit folder from CiBaseAgent, then polls the download progress once per second, logging it, until it reaches 100%.

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

### Description

Triggers the download of the package's kit folder from CiBaseAgent, then polls the download progress once per second, logging it, until it reaches 100%.

:::note
This is part of the fixed `#### MAIN ####` scaffolding — it's called automatically as `if ($global:DownloadPackage -and $global:InputObject) { Start-PSDownloadPackage }`, right after `PreInstall` and before `Install` runs. You don't call this yourself; whether it runs at all is controlled by the `$global:DownloadPackage` variable in the `#### VARIABLES ####` block (see the [script templates](/capainstaller/powerpacks/)).
:::

### Syntax

Start-PSDownloadPackage

### Parameters

None. Uses the script-scoped `$InputObject`, `$cs` and `$AppName` variables — it only does anything when `$InputObject` (the Named Pipe connection to CiBaseAgent, see [PowerPack Global Variables](/capainstaller/powerpacks/powerpack-global-variables/)) is present.

### Return value

None. If the download fails, the whole script is terminated via `Exit-PSScript 3322`.

### Example

**PowerShell**

```powershell
# From the MAIN section of the script template — shown for reference only:
PreInstall
if ($global:DownloadPackage -and $global:InputObject) { Start-PSDownloadPackage }
Install
```

### Related functions

[Add-PSDll](/capainstaller/powerpacks/add-psdll/)
