PackageDeployment Module Help

Package Deployment Module

Copy-RegistryKey Cmdlet

Version 4.0.0.5

Copy-RegistryKey

Synopsis

Copy Registry Key

Syntax

Copy-RegistryKey [-SourceKeyPath] <String> [-TargetKeyPath] <String> [[-Context] <String>] [-ContinueOnError] [-Recurse] [-Wow64] [<CommonParameters>]

Description

Use this command to copy everything below the specified registry sub-tree to another sub-tree.
If the key you want to copy to does not exist, it will be created. In case an error occurs when running this command, you can specify the option Stop script on error in the Script Editor. If the error actually occurs, the script stops, thus preventing subsequent errors, and the associated policy is shown as not compliant.
This also applies if you set the package property Error handling to Always terminate script on error (a default setting for new packages).

Parameters

-Context <String>

User: Execution under user account; logging in HKEY_CURRENT_USER, i.e. for the user.
UserPerService: User-related command, execution in Service context.
Computer: Execution under user account; logging in HKEY_CURRENT_MACHINE, i.e. for the computer.
ComputerPerService: Execution in service context; logging in HKEY_LOCAL_MACHINE, i.e. for the computer.

Required

False

Position

2

Accepts pipeline input

False

-ContinueOnError <SwitchParameter>

Continues script execution in spite of errors in the respective command

Required

False

Position

Named

Accepts pipeline input

False

-Recurse <SwitchParameter>

If you click this check box, all subkeys will be copied as well.

Required

False

Position

Named

Accepts pipeline input

False

-SourceKeyPath <String>

Please select the key you want to copy.

Required

True

Position

0

Accepts pipeline input

False

-TargetKeyPath <String>

Please select the key you want to copy to.

Required

True

Position

1

Accepts pipeline input

False

-Wow64 <SwitchParameter>

Use WOW64 on x64 computers.

Required

False

Position

Named

Accepts pipeline input

False

<CommonParameters>

For more information about common parameters, type "Get-Help about_CommonParameters".