5
I have Windows 10 and run some PowerShell commands through the Outlook COM object. This requires PowerShell to be running the same level of access (running as admin or user) as Outlook.
As I need PowerShell to be running as administrator for other pieces I set Outlook to always run as admin too, no problem. The issue is when I open the ISE I now can't access the Outlook objects.
There doesn't appear to be any way to set the ISE to always run as admin. The Compatibility tab is missing (though not on PowerShell itself?) and the registry keys in ...Windows NT\AppCompatibility
did nothing. I'd disable UAC completely but of course it's not possible in Windows 10 without screwing over a bunch of other stuff.
Any ideas? And no I don't particularly feel like right clicking the icon each time as I often open scripts directly.
UPDATE: Outlook complains it can't index as admin and the ISE doesn't recognise my network drives as admin so the lesser of two evils is just run both as a user. Incidentally, the Compatibility tab has disappeared from the PowerShell exe now too, thanks Microsoft...
No, it's 2 different options. – bentek – 2015-10-29T16:29:23.210
Updated answer to clarify that. – bentek – 2015-10-29T16:32:07.983
I Appreciate the effort to improve the answer. – Ramhound – 2015-10-29T16:33:16.700
1This does not resolve the issue as if I open the ISE by double clicking a script the ISE opens as a restricted user. I would need to open the ISE from the shortcut every time. Seems that's the direction Microsoft are going though: You can do it this way and it does work, but not as well as it did in Windows 7 / Server 2008 – Deadly-Bagel – 2015-10-30T15:47:15.000
Can you set the script properties to run as admin then? – bentek – 2015-10-30T17:53:00.753
No, the script is just a file so it doesn't "run". Additionally I have discovered that if the ISE is run as admin you cannot open scripts on network drives. It just doesn't recognise the path. Windows 10 has its advantages (esp. running four screens) but I keep running into junk like this and it's getting annoying. – Deadly-Bagel – 2015-11-16T15:07:31.637
Option 1 is (or is now) available on Windows server 2012 R2 using Classic Shell. The Windows 10 start menu doesn't seem to give you shortcut properties, but you can access them when the program is running via its icon. – YetAnotherRandomUser – 2017-08-09T12:51:49.030