Adding Registry Keys and Values with PowerShell

By | 2021-Feb-25

This script interrogates the registry to determine if the user-defined subkey exists. If the key does not exist, it will be created.

$PSParentPath = "HKLM:\SOFTWARE\Wow6432Node"
$PSChildName = "OneZeroOne"

It will then create or update values according to a user-defined array containing lists of value names, values, and types:

$RegVals = @(
  ("InstallationDirectory","C:\Program Files\One Zero One\","SZ"),

Obtain this script by cloning or downloading from GitHub where it is licensed under the GPL 2.0.

Relevant Links