question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set-Location \\wsl$\Ubuntu throws an error

See original GitHub issue

Steps 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:22 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
archilkarchavacommented, Aug 15, 2019

Cmd doesn’t support UNC paths as far as i know. But powershell.exe (5.1) works.

2reactions
rkeithhillcommented, 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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found