# $cs.Reg_GetMultiString

> Reads a REG_MULTI_SZ (multi-string) registry value. Returns an empty array if the value isn't found — never $null.

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

### Description

Reads a `REG_MULTI_SZ` (multi-string) registry value. Returns an empty array if the value isn't found — never `$null`.

### Syntax

$cs.Reg_GetMultiString(string registryroot, string regkey, string regvalue)

### Parameters

#### registryroot (String)

Root hive: `HKLM`/`HKEY_LOCAL_MACHINE`, `HKCU`/`HKEY_CURRENT_USER`, or `HKU`/`HKEY_USERS`.

#### regkey (String)

Registry key path containing the value, relative to `registryroot`.

#### regvalue (String)

Name of the value to retrieve. Pass `""` for the key's default value.

### Return value

String array (`string[]`). Empty array if the value isn't found.

### Example

**PowerShell**

```powershell
$dependencies = $cs.Reg_GetMultiString('HKLM', 'SYSTEM\CurrentControlSet\Services\W3SVC', 'DependOnService')
foreach ($dependency in $dependencies) {
    $cs.Job_WriteLog("W3SVC depends on service: $dependency")
}
```

Reading a list of installed components written by a previous install so the uninstaller knows which per-component keys to remove.

```powershell
$installedComponents = $cs.Reg_GetMultiString('HKLM', 'SOFTWARE\Contoso\AppSuite', 'InstalledComponents')
if ($installedComponents.Length -eq 0)
{
    $cs.Job_WriteLog("No component list found, nothing to uninstall")
}
foreach ($component in $installedComponents) {
    $cs.Job_WriteLog("Removing component: $component")
    $cs.Reg_DelTree('HKLM', "SOFTWARE\Contoso\AppSuite\Components\$component")
}
```

Checking whether a specific dependency was recorded in a multi-string list of prerequisites before continuing.

```powershell
$prereqs = $cs.Reg_GetMultiString('HKLM', 'SOFTWARE\Contoso\AppSuite', 'Prerequisites')
if ($prereqs -contains 'VCRedist2015-2022-x64')
{
    $cs.Job_WriteLog("Required VC++ Redistributable is already recorded as installed")
}
```

### Related functions

[$cs.Reg_GetString](/capainstaller/powerpacks/cs-reg-getstring/) [$cs.Reg_GetInteger](/capainstaller/powerpacks/cs-reg-getinteger/)
