# Initialize-Variables

> Populates the $global:gs* variables (program paths, Windows directories, disk space status, OS version/build/edition, computer hardware info, job configuration — see.

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

### Description

Populates the `$global:gs*` variables (program paths, Windows directories, disk space status, OS version/build/edition, computer hardware info, job configuration — see [PowerPack Global Variables](/capainstaller/powerpacks/powerpack-global-variables/)) from the `$cs` object, and sets `$global:AppLogFolder`.

:::note
This is part of the fixed `#### MAIN ####` scaffolding — it's called once, right after `Add-PSDll`, before `PreInstall` runs. You don't call this yourself; it's documented here so it's clear where the `$global:gs*` variables come from.
:::

### Syntax

Initialize-Variables

### Parameters

None. Uses the script-scoped `$cs`, `$DllPath` and `$LogFile` variables.

### Return value

Boolean. `$true` if the loaded `ScriptingLibrary` DLL version is `0.2.0.0` or higher (meaning the full variable set is supported), `$false` otherwise.

### Example

**PowerShell**

```powershell
# From the MAIN section of the script template — shown for reference only:
$cs = Add-PSDll
Initialize-Variables
```

### Related functions

[Add-PSDll](/capainstaller/powerpacks/add-psdll/)
[PowerPack Global Variables](/capainstaller/powerpacks/powerpack-global-variables/)
