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.

`Split-Path /` should not throw error

See original GitHub issue

Steps to reproduce

Split-Path /

Expected behavior

Empty string, like Split-Path C:

Actual behavior

Split-Path : 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
+ Split-Path /
+ ~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (:) [Split-Path], PSArgumentException
+ FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.SplitPathCommand

Environment data

Name                           Value
----                           -----
PSVersion                      7.0.0-preview.1
PSEdition                      Core
GitCommitId                    7.0.0-preview.1
OS                             Darwin 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
bpayettecommented, Jul 11, 2019

@vors How strange. This only seems to happen in *nix systems. On Windows, (core or desktop) it quietly returns an empty string. This does seem like a bug.

1reaction
iSazonovcommented, Oct 2, 2019

The same on Windows:

 Split-Path C:
Split-Path : 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
+ Split-Path C:
+ ~~~~~~~~~~~~~
+ CategoryInfo          : InvalidArgument: (:) [Split-Path], PSArgumentException
+ FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.SplitPathCommand

@TylerLeonhardt It seems ok for hackathon because we see the same behavior on all platforms for root.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Uncaught TypeError: path.split is not a function in ...
I'm trying to do validations for my form in react. I chose "react-hook-form" library. But I'm constantly getting error "Path.split is not a ......
Read more >
Error with PCLauncher - RLDLL.splitPath - Exception ...
Hi All, having some problems setting up the PCLauncher with a LNK shortcut file. File runs fine when double clicked but I cannot...
Read more >
Split-Path - PowerShell
The Split-Path cmdlet returns only the specified part of a path, such as the parent folder ... It does not return FileInfo objects...
Read more >
How to Split Paths with the PowerShell Split-Path Cmdlet
Learn how to split and return different elements of a path using the PowerShell Split-Path cmdlet in this tutorial.
Read more >
SplitPath - Syntax & Usage
The SplitPath command separates a file name or URL into its name, directory, extension, and drive.
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