Windows PowerShell allows both \ and / be path delimiters.
Consider
# Full PS on Windows
PS C:\> 'foo' > bar
PS C:\> cat ./bar
foo
PS C:\> cat .\bar
foo
Versus
# Linux version
PSL /Users/vors/dev/PowerShell-Linux> 'foo' > bar
PSL /Users/vors/dev/PowerShell-Linux> cat ./bar
foo
PSL /Users/vors/dev/PowerShell-Linux> cat .\bar
cat : Cannot find path '/Users/vors/dev/PowerShell-Linux/.\bar' because it does not exist.
It's a problem for porting: there are scripts that could run as-is, but don't because of the wrong path delimiters.
On the other hand, on Linux you can create a folder foo\bar, so adding \ as alternative path separator would make this corner case harder.
This problem can be solved with additional escaping
Sidenote: 'Set-Location' (cd) currently fails for it, but Get-ChildItem (ls) works
PSL /Users/vors/dev/PowerShell-Linux> ls ./foo\bar/
Directory: /Users/vors/dev/PowerShell-Linux/foo\bar
Mode LastWriteTime Length Name
---- ------------- ------ ----
------ 2/20/16 9:38 PM 6 1
PSL /Users/vors/dev/PowerShell-Linux> cd ./foo\bar/
cd : An object at the specified path /Users/vors/dev/PowerShell-Linux/foo\bar does not exist.
Windows PowerShell allows both
\and/be path delimiters.Consider
Versus
It's a problem for porting: there are scripts that could run as-is, but don't because of the wrong path delimiters.
On the other hand, on Linux you can create a folder
foo\bar, so adding\as alternative path separator would make this corner case harder.This problem can be solved with additional escaping
Sidenote: 'Set-Location' (
cd) currently fails for it, butGet-ChildItem(ls) works