Author Posts

May 9, 2014 at 5:59 am

Hi

Using PS4. If I open PowerShell ISE as a normal user I can go to File>Open and browse to a mapped drive I have to store my scripts in. If I open PowerShell ISE as Administrator, it only shows C:.

I have a modified profile that set the location to this drive and can successfully run Get-ChildItem in both ISE's. This is set with the following:

New-PSDrive -Name T -PSProvider FileSystem -Root "\\Lincoln\Data\Tony Wainwright" | Out-Null
Set-Location T:\Scripts

Also, is there a way I can right click a file in File Explorer (Windows 8) and Edit a .PS1 file ISE with Elevated privileges?

Thanks
Tony

May 9, 2014 at 6:18 am

I'm guessing that your normal user account isn't an admin on the machine and UAC (User Access Control) is enabled. That means when you run the ISE as an admin you're prompted for the credentials of an admin on the machine and it's that account's network drives that you're seeing at that point instead of your normal user accounts mapped drives which is why you don't see any mapped drives since drive mapping are on a per user basis. You could either make your normal user a local admin on the machine or map the same drives as the user that your running PowerShell as when you're running PowerShell as an admin.

May 9, 2014 at 6:42 am

Hi Mike,

Thanks – it's sorted.