I have started using VSCODE for editing and running scripts. If I run VSCODE as admin, I cannot access files on a network drive (mapped or otherwise). If I don't run VSCODE as admin I cannot execute the PS scripts I need to.
Has anyone experienced something similar, or found a work around?
Since the Administrator account doesn't have the drive mappings your user account has, you can try accessing the Universal Naming Convention (UNC) path to the network resources/shares directly.
\\<server-hostname-or-IP>\<share-name>\<directory-name>
\\server1\c$
\\server2\share\foo\bar
If you don't know the UNC paths for the mapped drives, run net use
from a cmd.exe
prompt under your user (not admin) account context. The UNC paths fall under the Remote column heading in the output, and should resemble the format outlined above.