TestimoX

API Reference

Command

Set-CxRegistryValue

Namespace ComputerX.PowerShell

Writes a registry value on the local or a remote computer.

Examples

Authored help example

Example 1: Sets a local policy value that disables the Windows consumer experience.

PS>


Set-CxRegistryValue -Path 'HKLM\SOFTWARE\Policies\Microsoft\Windows\CloudContent' -Name DisableWindowsConsumerFeatures -Value 1 -Kind DWord
        

Example 2: Previews a remote REG_EXPAND_SZ write without applying it yet.

PS>


Set-CxRegistryValue -ComputerName APP01 -Path 'HKLM\SOFTWARE\Contoso\App' -Name InstallPath -Value '%ProgramFiles%\Contoso\App' -Kind ExpandString -WhatIfOnly
        

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

Set-CxRegistryValue -Path <string> [-Name <string>] -Value <object> -Kind <String> [-ComputerName <string>] [-WhatIfOnly] [<CommonParameters>]
#

Parameters

Path string requiredposition: 0pipeline: false
Registry key path that contains the value to write.
Name string optionalposition: 1pipeline: false
Name of the registry value to write. Leave this empty only when writing the default unnamed value.
Value object requiredposition: 2pipeline: false
Value payload to write to the registry.
Kind RegistryValueKind requiredposition: 3pipeline: falsevalues: 7
Registry value kind that determines how Value is serialized. Possible values: String, ExpandString, Binary, DWord, MultiString, QWord, Unknown, None
Possible values: String, ExpandString, Binary, DWord, MultiString, QWord, Unknown
ComputerName string optionalposition: 4pipeline: false
Target computer name. Use . for the local machine or provide a DNS/NetBIOS name. When omitted, the local computer is queried.
WhatIfOnly SwitchParameter optionalposition: namedpipeline: false
Returns the expanded write plan without applying changes.