0
votes

Trying to get an Azure fileshare (in 'ResourceGroup1') mapped to a drive letter using powershell: New-PSDrive –Name 'Z' –PSProvider FileSystem –Root '\\sa1.file.core.windows.net\solutionfiles'.

I keep getting error "New-PSDrive : The specified drive root "\\sa1.file.core.windows.net\solutionfiles" either does not exist, or it is not a folder". But is exists!

'New-PSDrive' gives an unwanted pop-up when adding a '-Credential' parameter even if I provide a PSCredential object. When I enter SAName and SAKey manually then the mapping works. However, for an automation I cannot use a pop-up. What to do?

1

1 Answers

0
votes

Just used the following feeling lucky:

Invoke-Expression -Command "cmdkey /add:SA1.file.core.windows.net /user:Azure\sbl266aucy3e2sa01 /pass:SAKey

No idea yet what this is doing ('cmdkey'???), but it hands over the credentials somehow to ??? so that the original cmdlet to map a drive now works:

New-PSDrive -Name Z -PSProvider FileSystem -Root "\\sbl266aucy3e2sa01.file.core.windows.net\solutionfiles"

//