In my eagerness to find out what variables were protected or constants, I decided to just see what ones could be removed – assuming those mentioned above would be left alone. What I didn’t realize is the removal of those variables would not be limited to the scope of this session of the ISE – but was not only PowerShell global – but system global. I’m hoping that someone can help me get the ISE working again.
My foolishness:
Remove-Variable *
…resulted in a bunch of errors reported and only a handful (10-15) remaining when I executed dir variable: afterward. Thinking it was no big deal and that a restart of the ISE would restore me to normality, I closed it — and I cannot start it anymore.
Additional Symptoms
I’ve since found that I’ve lost things like environment variables %windir% are gone – which in a most interesting twist, prevents you from opening your Advanced system settings (can’t find %windir%\system32\systempropertiesadvanced.exe) to set your ENV back up… (Yes, I can run it directly)
Update: I found an additional effect/symptom: Windows reported that I may not have a genuine version of Windows after the auto-update was not able to work correctly. I hadn’t realized that something as simple as some ENV vars being gone would kill that. Hrm.
So – anyone knows how to restore or re-create the environment needed to successfully run the ISE?
(And yes, I’ve tried removing and re-adding the Feature, combined with reboots.)
Thanks all for the assist – here’s what I did, which while I’m not sure got me back 100% everywhere, has allowed me to use the ISE, Hyper-V Manager and validate as genuine again.
I went to another Server 2008 R2 box, compared the key and manually edited the registry and added these values back to the broken machine:
I’m leaning towards the elevated Administrator privilege of the ISE as the underlying reason it affected more than the session.