Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Editing generalized registry folders

$
0
0

So I'm trying to create a powershell function to allow me to edit some registry values and folders. Editing the registry values presents no problems, however I'm having issues with the folders. I have on that I have to change the folder name but it can't seem to figure out that it does exist (i have edited some parts):

PS C:\Users\Administrator\Downloads> Test-Path "$var"

False

PS C:\Users\Administrator\Downloads> Test-Path "HKLM:\SOFTWARE\directory\this123:10117"

True

PS C:\Users\Administrator\Downloads> $var

HKEY_LOCAL_MACHINE\SOFTWARE\directory\this123:10117 

I was trying to use variables because it doesn't like when I do variables inside of the path. The thing I notice is it seems to trunkate the ":10117" for some reason. Is there a better way to do this?
Note: "this123" would be the only part that changes and ":10117" would possibly change from computer to computer so I don't want to remove it or make all computers use "10117"


Viewing all articles
Browse latest Browse all 6937

Trending Articles