Set-Location \\wsl$\Ubuntu throws an error
See original GitHub issueSteps to reproduce
- execute when wsl2 is up and running
Set-Location \\wsl$\Ubuntu
Expected behavior
- successfully changes directory
PS Microsoft.PowerShell.Core\FileSystem::\\wsl$\Ubuntu>
Actual behavior
- throws an error
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
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:22 (7 by maintainers)
Top Results From Across the Web
WSL2 stopped working with error The system cannot find ...
All other wsl command hangs or throws error as shown below like wsl -l command throws this error The system cannot find the...
Read more >Ubuntu crashes on windows: 0x80040326 Wsl error
I have Ubuntu 22.04 app installed on top of Windows. It worked fine until one day it crashed and now all I get...
Read more >WSL not working after update from Microsoft store
While you can enter a username and password here, we're just going to throw this "installation" away anyway. Exit the Ubuntu distribution.
Read more >If/Else in shell script throws errors in Ubuntu for Windows
There are two problems here. First, while you have a shebang line calling bash, you are executing the script as sh script.sh ....
Read more >WSL 2 Input/Output Error
I've freed some memory and tried re-installing via apt-get, but an error message dpkg was interrupted, you must manually run 'sudo dpkg -- ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Cmd doesn’t support UNC paths as far as i know. But powershell.exe (5.1) works.
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.