New-PSDrive : Cannot find a provider with the name '\\server\share'. The name is not in the proper format . A provider name may only be alpha-numeric characters or a Windows PowerShell snap-in name followed by a single '\' followed by alpha-numeric characters. At line:1 char:6 + mount <<<< z: "\\server\share" + CategoryInfo : ObjectNotFound: (\\server\share:String) [New-PSDrive], ProviderNotFoundException + FullyQualifiedErrorId : ProviderNotFoundBadFormat,Microsoft.PowerShell.Commands.NewPSDriveCommand
Sorry if the paste is fail. Y'know, Windows command shells 'n all that.
Y'know, I didn't do that. But it wouldn't make sense for me to try that since neither PowerShell nor cmd recognize paths with spaces in them if you don't have them in quotes.
I shall. Though it's odd that various PowerShell commands would be perfectly alright using "\\server\spaced path\" and one particular command would not be alright with it. Though that does line up with the way many other commands operate in cmd and PowerShell.
My intuition, which is inchoate and ill-founded, is that by quotifying an argument, you render it a string rather than an object name.
This is a little like me saying: "I am not 'Chuck Hardin'. That is a sequence of phonemes. I am a person whose name happens to sound like 'Chuck Hardin' in an oral rendition." Then you hit me in the face.
In short, if the command is doing this, you should hit it. In the face.
Removing the " does avoid the particular error I was having. Trying to use a caret, however, doesn't seem to escape the space as I'm getting a network path not found. But that's being thrown by the net set of commands itself rather than powershell getting it's icky, mucky, filthy hands all over the error message.
Reply
New-PSDrive : Cannot find a provider with the name '\\server\share'. The name is not in the proper format
. A provider name may only be alpha-numeric characters or a Windows PowerShell snap-in name followed by a single '\' followed by alpha-numeric characters.
At line:1 char:6
+ mount <<<< z: "\\server\share"
+ CategoryInfo : ObjectNotFound: (\\server\share:String) [New-PSDrive], ProviderNotFoundException
+ FullyQualifiedErrorId : ProviderNotFoundBadFormat,Microsoft.PowerShell.Commands.NewPSDriveCommand
Sorry if the paste is fail. Y'know, Windows command shells 'n all that.
Reply
Reply
Reply
Reply
mount z: \\server\spaced/ path\
That didn't work either.
Reply
Reply
Reply
This is a little like me saying: "I am not 'Chuck Hardin'. That is a sequence of phonemes. I am a person whose name happens to sound like 'Chuck Hardin' in an oral rendition." Then you hit me in the face.
In short, if the command is doing this, you should hit it. In the face.
Reply
Removing the " does avoid the particular error I was having. Trying to use a caret, however, doesn't seem to escape the space as I'm getting a network path not found. But that's being thrown by the net set of commands itself rather than powershell getting it's icky, mucky, filthy hands all over the error message.
Reply
Reply
Leave a comment