$cs.Reg_GetMultiString
Description
Section titled “Description”Reads a REG_MULTI_SZ (multi-string) registry value. Returns an empty array if the value isn’t found — never $null.
Syntax
Section titled “Syntax”$cs.Reg_GetMultiString(string registryroot, string regkey, string regvalue)
Parameters
Section titled “Parameters”registryroot (String)
Section titled “registryroot (String)”Root hive: HKLM/HKEY_LOCAL_MACHINE, HKCU/HKEY_CURRENT_USER, or HKU/HKEY_USERS.
regkey (String)
Section titled “regkey (String)”Registry key path containing the value, relative to registryroot.
regvalue (String)
Section titled “regvalue (String)”Name of the value to retrieve. Pass "" for the key’s default value.
Return value
Section titled “Return value”String array (string[]). Empty array if the value isn’t found.
Example
Section titled “Example”$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.
$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.
$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")}