API Reference
Command
Set-CxRegistryValue
Writes a registry value on the local or a remote computer.
Examples
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
- Registry key path that contains the value to write.
- Name string
- Name of the registry value to write. Leave this empty only when writing the default unnamed value.
- Value object
- Value payload to write to the registry.
- Kind RegistryValueKind
- 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
- Target computer name. Use . for the local machine or provide a DNS/NetBIOS name. When omitted, the local computer is queried.
- WhatIfOnly SwitchParameter
- Returns the expanded write plan without applying changes.