RegistryKey (RegKey)

Aus Wiki-WebPerfect
Wechseln zu: Navigation, Suche


Add or update a MultiString "REG_MULTI_SZ" RegKey

For example: Add an MultiString-RegKey Named Environment with the following Value:

ClusterName = Cluster01
Environment = Test

Under the Reg-Path HKLM:\SYSTEM\CurrentControlSet\Services\telegraf. (Environment Variables for the Service "Telegraf")

$RegKeyValue =@(
"ClusterName=Cluster01",
"Environment=Test"
)
 
# Create or update the RegKey "Environment" with the Variables
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\telegraf" -Name "Environment" -Value $RegKeyValue -PropertyType "MultiString" -Force