You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.WG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.
Set-Location : Cannot process argument because the value of argument "path" is not valid. Change the value of the "path" argument and run the operation again. At line:1 char:1
+ Set-Location \\wsl$\Ubuntu
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-Location], PSArgumentException
+ FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.SetLocationCommand
Environment data
Name Value
---- -----
PSVersion 6.2.2
PSEdition Core
GitCommitId 6.2.2
OS Microsoft Windows 10.0.18956
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Note: Same behavior on 7.0.0-preview.2, but everything is working on Windows Powershell 5.1
Because $ is used to denote a variable in PowerShell, try Set-Location '\\wsl$\Ubuntu' or Set-Location \\wsl`$\Ubuntuor Set-Location --% \\wsl$\Ubuntu.
First one should work, I typo'd were the ' should be but I updated/fixed it above. The second one is interesting - would have expected that to work. Retracted the third one, --% is primarily for native exes.
The same behaviour occurs if you try to set the path as a PSDrive (in Powershell Core 6.2.3):
PS C:\Users\yabea>New-PSDrive-Name WSL -PSProvider "FileSystem"-Root "\\wsl$\Ubuntu-18.04"
Name Used (GB) Free (GB) Provider Root CurrentLocation
-------------------------------------------------
WSL FileSystem \\wsl$\Ubuntu-18.04
PS C:\Users\yabea> cd WSL:
cd : Cannot process argument because the value of argument "path" is not valid. Change the value of the "path" argument At line:1 char:1+ cd WSL:
+ ~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-Location], PSArgumentException
+ FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.SetLocationCommand
PS C:\Users\yabea>$PSVersionTable
Name Value
---------
PSVersion 6.2.3
PSEdition Core
GitCommitId 6.2.3
OS Microsoft Windows 10.0.18985
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
While it works as expected in Powershell as part of Windows Insider Preview build 18985.1:
C:\Users\yabea>New-PSDrive-Name WSL -PSProvider "FileSystem"-Root "\\wsl$\Ubuntu-18.04"
Name Used (GB) Free (GB) Provider Root CurrentLocation
-------------------------------------------------
WSL FileSystem \\wsl$\Ubuntu-18.04
C:\Users\yabea> cd WSL:
WSL:\> ls
Directory: \\wsl$\Ubuntu-18.04---------------------------
d-----17/09/201909:34 home
d-----21/05/201915:39 srv
d-----24/09/201922:49 etc
d-----21/05/201915:39 opt
d-----23/09/201900:00 root
d-----18/09/201914:36 lib
d-----18/09/201913:34 mnt
d-----21/05/201915:39 usr
d-----24/09/201922:49 media
d-----21/05/201915:39 lib64
d-----24/09/201922:49 sys
d-----24/09/201922:49 dev
d-----17/09/201914:36 sbin
d-----21/05/201915:42 boot
d-----17/09/201914:36 bin
d-----24/09/201922:49 run
d-----24/09/201922:49 proc
d-----23/09/201923:02 snap
d-----24/09/201922:49 tmp
d-----21/05/201915:42var
d-----10/04/201917:35 lost+found
------01/01/197000:000 init
WSL:\>$PSVersionTable
Name Value
---------
PSVersion 5.1.18985.1
PSEdition Desktop
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
BuildVersion 10.0.18985.1
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
I just checked and it can't Set-Location into directory, but Get-ChildItem works.
Get-ChildItem does not work for me, on 7.0.0-preview.2 or 7.0.0-preview.3.
It does work for me on 6.2.1, however (and 5.1, as described by others).
IMO this is a painful regression because it prevents you from using pwsh with the fancy new WSL2 feature that everybody wants to try out. We should really get it fixed for PSv7.
It's very easy to set up a repro for this--if you search for WSL2, there are lots of people talking about it and sharing the instructions to set it up. Here are the official instructions.
I'm trying to repro this. Got WSL setup following the instructions by Dan Thompson (@jazzdelightsme), although the switches for wsl.exe have changed. Installed Ubuntu. \\wsl$\ubuntu doesn't work in WinPS 5.1. Need a working example in WinPS 5.1 to debug why it's not working in PS7.
I believe the $ is specifically so that the name does not conform to netbios conventions. The wsl filesystem handler is not SMB and so trying to look up the name via netbios will cause issues. The wsl filesystem is internally routed through a 9p server handled by the init processes. There is no network-accessible name as everything is within a single PC.
Issue-BugIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.WG-Engine-Providersbuilt-in PowerShell providers such as FileSystem, Certificates, Registry, etc.
Activity
rkeithhill commentedon Aug 15, 2019
Because
$is used to denote a variable in PowerShell, trySet-Location '\\wsl$\Ubuntu'orSet-Location \\wsl`$\Ubuntuor.Set-Location --% \\wsl$\Ubuntuarchilkarchava commentedon Aug 15, 2019
Didn't work unfortunately.
archilkarchava commentedon Aug 15, 2019
Set-Location "\wsl$\Ubuntu" also doesn't work
rkeithhill commentedon Aug 15, 2019
First one should work, I typo'd were the
'should be but I updated/fixed it above. The second one is interesting - would have expected that to work. Retracted the third one,--%is primarily for native exes.archilkarchava commentedon Aug 15, 2019
Still throws an error.
rkeithhill commentedon Aug 15, 2019
Well, perhaps a real issue then. If you bring up cmd.exe, I assume you can cd to this dir, right?
rkeithhill commentedon Aug 15, 2019
It also seems that PowerShell is smart about not interpreting
$as the start of a variable if the next character is invalid in a variable name.archilkarchava commentedon Aug 15, 2019
Cmd doesn't support UNC paths as far as i know. But powershell.exe (5.1) works.
iSazonov commentedon Aug 17, 2019
Look like we can not parse UNC path if a computer name ends with
$vexx32 commentedon Aug 17, 2019
Is it a computername, or is it a drive name? That syntax is usually UNC syntax for a drive... maybe try
\\localhost\wsl$\...instead?archilkarchava commentedon Aug 19, 2019
archilkarchava commentedon Aug 21, 2019
I just checked and it can't Set-Location into directory, but Get-ChildItem works.
lucyllewy commentedon Sep 24, 2019
The same behaviour occurs if you try to set the path as a PSDrive (in Powershell Core 6.2.3):
While it works as expected in Powershell as part of Windows Insider Preview build 18985.1:
jazzdelightsme commentedon Sep 27, 2019
Get-ChildItem does not work for me, on 7.0.0-preview.2 or 7.0.0-preview.3.
It does work for me on 6.2.1, however (and 5.1, as described by others).
IMO this is a painful regression because it prevents you from using pwsh with the fancy new WSL2 feature that everybody wants to try out. We should really get it fixed for PSv7.
It's very easy to set up a repro for this--if you search for WSL2, there are lots of people talking about it and sharing the instructions to set it up. Here are the official instructions.
iSazonov commentedon Sep 27, 2019
/cc Steve Lee (@SteveL-MSFT) for information.
SteveL-MSFT commentedon Sep 28, 2019
I'm trying to repro this. Got WSL setup following the instructions by Dan Thompson (@jazzdelightsme), although the switches for wsl.exe have changed. Installed Ubuntu.
\\wsl$\ubuntudoesn't work in WinPS 5.1. Need a working example in WinPS 5.1 to debug why it's not working in PS7.iSazonov commentedon Sep 29, 2019
I am very wonder why the format
\\wsl$\ubuntuis used. It looks like \servername\share but naming convention does not allow "$" in DNS names and allow in NetBIOS names. https://support.microsoft.com/en-gb/help/909264/naming-conventions-in-active-directory-for-computers-domains-sites-andIt seems NetBIOS deprecated. Steve Lee (@SteveL-MSFT) Can you ask WSL team about the strange name format?
Also the format assumes that PoweerShell will use remoting?
lucyllewy commentedon Sep 30, 2019
I believe the
$is specifically so that the name does not conform to netbios conventions. The wsl filesystem handler is not SMB and so trying to look up the name via netbios will cause issues. The wsl filesystem is internally routed through a 9p server handled by the init processes. There is no network-accessible name as everything is within a single PC.SteveL-MSFT commentedon Oct 1, 2019
Still waiting on a repro where that path works.
SteveL-MSFT commentedon Oct 1, 2019
Looks like my version of Windows isn't new enough. Upgrading to newer version.
SteveL-MSFT commentedon Oct 1, 2019
Ok, can repro this