New-LiquitAppSettingIncludedItem

Adds an Included Item to an existing App Setting. An Included Item defines a specific file system or registry location to capture as part of an App Setting. It is always a child of an AppSetting.

Syntax

# Via parent entity
New-LiquitAppSettingIncludedItem
    [-Parent] <AppSetting>
    -Name <string>
    -ValueType <IncludedItemValueType>
    -Root <string>
    -Value <string>
    [-Enabled <bool>]
    [-CleanBeforeRestore <bool>]
    [-WhatIf] [-Confirm]

# Via parent ID
New-LiquitAppSettingIncludedItem
    [-ID] <Guid>
    -Name <string>
    -ValueType <IncludedItemValueType>
    -Root <string>
    -Value <string>
    [-Enabled <bool>]
    [-CleanBeforeRestore <bool>]
    [-WhatIf] [-Confirm]

Parameters

Parameter Type Position Mandatory Default Description
Parent AppSetting 0 Yes (set byParentEntity) The parent AppSetting object.
ID Guid 0 Yes (set byParentId) ID of the parent AppSetting.
Name string Yes Display name for this included item.
ValueType IncludedItemValueType Yes What kind of location this item represents. See IncludedItemValueType.
Root string Yes Base path. For file-system items this is a folder path (e.g. C:\Users\%USERNAME%\AppData). For registry items this is a hive + key path (e.g. HKCU\Software\MyApp). A trailing \ is stripped automatically.
Value string Yes Path or name relative to Root. A leading \ is stripped automatically.
Enabled bool No $true Whether this included item is active.
CleanBeforeRestore bool No $true When $true, the destination is cleared before the captured content is restored.

Output: AppSettingIncludedItem

Supports: -WhatIf-Confirm

Examples

# Capture a single file
$setting = Get-LiquitAppSetting -Name 'Outlook Settings'
New-LiquitAppSettingIncludedItem `
    -Parent    $setting `
    -Name      'Outlook Profile' `
    -ValueType File `
    -Root      'C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Outlook' `
    -Value     'Outlook.xml'

# Capture a registry tree
New-LiquitAppSettingIncludedItem `
    -Parent    $setting `
    -Name      'Outlook Registry' `
    -ValueType RegistryTree `
    -Root      'HKCU\Software\Microsoft\Office' `
    -Value     '16.0\Outlook'