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