Manipulate Registry with Powershell

# Set variables to indicate value and key to set
$RegistryPath = 'HKLM:\Software\Microsoft\MSRDC\Policies'
$Name         = 'AutomaticUpdates'
$Value        = '0'
# Create the key if it does not exist
If (-NOT (Test-Path $RegistryPath)) {
  New-Item -Path $RegistryPath -Force | Out-Null
}  
# Now set the value
New-ItemProperty -Path $RegistryPath -Name $Name -PropertyType DWORD -Value $Value -Force