Coming soon - Get a detailed view of why an account is flagged as spam!
view details
8
Code review and assistance
Post Body

I am trying to test for 32 vs 64 bit and then create either one or two new keys depending upon the environment.

I would like to keep the code simple if I can and just set the Type, Name, Value, etc all at once if I can. Looking online it seems like it can be done, but whenever I try to run it, I just get prompted for a Type:

Looking for assistance / insight.

It seems pretty straightforward, here is what I am starting with:

$RegLocation1 = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_ALLOW_USER32_EXCEPTION_HANDLER_HARDENING\" $RegLocation2 = "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_ALLOW_USER32_EXCEPTION_HANDLER_HARDENING" If ([System.Environment]::Is32BitProcess) { New-Item -Path $RegLocation1 -Force New-ItemProperty -Path $RegLocation1 -Name "iexplore.exe" -Value 1 -ErrorAction SilentlyContinue -PropertyType DWord }Else { New-Item -Path $RegLocation1 -Force New-ItemProperty -Path $RegLocation1 -Name "iexplore.exe" -Value 1 -ErrorAction SilentlyContinue -PropertyType DWord New-Item -Path $RegLocation2 -Force New-ItemProperty -Path $RegLocation2 -Name "iexplore.exe" -Value 1 -ErrorAction SilentlyContinue -PropertyType DWord }

Author
Account Strength
100%
Account Age
12 years
Verified Email
Yes
Verified Flair
No
Total Karma
7,134
Link Karma
3,138
Comment Karma
3,996
Profile updated: 6 months ago
Posts updated: 1 year ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
8 years ago