IIS 7 and Above
New-psdrive is not working from Powershell Web Access
Last post Aug 28, 2018 05:09 AM by deepakpanchal10
Aug 23, 2018 05:14 PM|Manusan|LINK
I am trying to map the network drive while executing the script from Powershell Web Access but getting the below error.
$servername is valid name and the script is working fine on poweshell ISE. Please help
New-PSDrive -Name "r" -PSProvider FileSystem -Root "\\$servername\c$\ ...
+ CategoryInfo : InvalidOperation: (r:PSDriveInfo) [New-PSDrive], Win32Exception
+ FullyQualifiedErrorId : CouldNotMapNetworkDrive,Microsoft.PowerShell.Commands.NewPSDriveCommand
Aug 24, 2018 03:24 AM|deepakpanchal10|LINK
Try like below.
New-PSDrive -Name "P" -PSProvider "FileSystem" -Root "\\Server01\Public"
Aug 27, 2018 04:57 PM|Manusan|LINK
Please check my script , I have used same command and it is working in Powershell ISE but it not working in Powershell WebAccess
New-PSDrive -Name "r" -PSProvider FileSystem -Root "\\$servername\c$\
Aug 28, 2018 05:09 AM|deepakpanchal10|LINK
As we know, Command is correct but there is some other issue.
I suggest you to post the issue in forum below.
Windows PowerShell Forum
This forum is more suitable for specific Powershell issue, Where as this forum handles some general issues of Powershell with IIS.
Thanks for your understanding.