RegistryKey (RegKey)

Aus Wiki-WebPerfect
Version vom 6. Mai 2020, 08:40 Uhr von Admin (Diskussion | Beiträge)

(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
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