I'm having a challenge with this bit of code: $files = Get-ChildItem -Path 'S:\myFiles' -Include.
PowerShell errors and tells me that there is no S drive. The drive letter is mapped properly. If I change the path to "C:\myFiles' the code processes correctly.
Your suggestions are appreciate.
PowerShell Script to Mapped Drive
-
- GoldLounger
- Posts: 2631
- Joined: 26 Jan 2010, 16:31
- Location: Southern California
PowerShell Script to Mapped Drive
Regards,
John
John
-
- GoldLounger
- Posts: 2631
- Joined: 26 Jan 2010, 16:31
- Location: Southern California
Re: PowerShell Script to Mapped Drive
Apparently running PowerShell as an Administrator doesn't allow one to access mapped drives due to permissions.
Regards,
John
John
-
- SilverLounger
- Posts: 2069
- Joined: 25 Jan 2010, 02:12
Re: PowerShell Script to Mapped Drive
Mapped drives are per user so normally you need to be in the userid for the mapped drive to see them. To change this see Enable mapped drives in an elevated command prompt. The tutorial says for Windows 10 so may not work with Windows 11.
Joe
-
- GoldLounger
- Posts: 2631
- Joined: 26 Jan 2010, 16:31
- Location: Southern California