Adding non-string registry values

Tags:
We recently looked at adding a string string registry value to the key we had created.
https://itknowledgeexchange.techtarget.com/powershell/adding-a-registry-value/
In this post we’ll extend this to other types
001
002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 |
$HKLM = 2147483650 #HKEY_LOCAL_MACHINE
$computer = “.” #local machine $key = “SOFTWARE\ITKE PSAdmins” $name = “String Entry” $name = “Expanded String Entry” $name = “Dword Entry” $name = “Multi-string Entry” |
The pattern established for writing a string value is used across the other values. An expanded string picks up it value from an environmental variable – so if we want to access the temp folder we can use %temp% and find that folder on all machines.
A multi-string value takes a list of strings. if you change this it will overwrite so we need to read the current value, append new data and then write it back – next time
 Comment on this Post