Sep 06 2020 11:58 PM
Sep 07 2020 01:06 AM
SolutionHello Schulzi,
I am not aware of a cmdlet, but it’s quit easy to create the string you need by using string formatting. Take a look at this code:
$SID = (New-Object System.Security.Principal.NTAccount($env:Username)).Translate([System.Security.Principal.SecurityIdentifier]).Value
$RegPath = '"HKEY_USERS"{0}_Classes-CLSID-018D5C66-4533-4307-9B53-224DE2ED1FE6"' -f $SID
More info is here:
https://devblogs.microsoft.com/scripting/understanding-powershell-and-basic-string-formatting/
Good luck!
Manfred de Laat
Sep 07 2020 04:15 AM