$RegistryPath = "HKLM:\Software\Policies\Microsoft" $RegistryKey = "PassportForWork" $Name = "Enabled" $value = "0" New-Item -Path $RegistryPath -Name $RegistryKey -ErrorAction Ignore New-ItemProperty -Path $RegistryPath\$RegistryKey -Name $name -Value $value -PropertyType DWORD -Force | Out-Null