winfsp / sshfs-win

SSHFS For Windows
https://winfsp.dev
Other
4.78k stars 250 forks source link

The token '&&' is not a valid statement separator in this version. #423

Closed DJStompZone closed 3 months ago

DJStompZone commented 3 months ago

Summary

When attempting to run the command as shown in the readme, Windows Powershell throws an error: The token '&&' is not a valid statement separator in this version.

Additional Information

The full text of the error is as follows:

PS C:\Users\djstomp\.ssh> winget install -h -e --id "WinFsp.WinFsp" && winget install -h -e --id "SSHFS-Win.SSHFS-Win"

At line:1 char:43
+ winget install -h -e --id "WinFsp.WinFsp" && winget install -h -e --i ...
+                                           ~~
The token '&&' is not a valid statement separator in this version.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : InvalidEndOfLine

Here is some basic info regarding my powershell version, etc.

PS C:\Users\djstomp> Get-PSEnvironmentInfo -OutputType string
Powershell Env Info
  © DJ Stomp 2024
"No Rights Reserved"

Powershell Environment:
------------------------
PSVersion: 5.1.19041.4170
PSEdition: Desktop Edition
BuildVersion: 10.0.19041.4170
CLRVersion: 4.0.30319.42000
PSHOME: %WINDIR%\System32\WindowsPowerShell\v1.0
CurrentExePath: $PSHOME\powershell.exe

Proposed solution

This can be avoided by simply replacing the && with a semicolon.

PS C:\Users\djstomp\.ssh> winget install -h -e --id "WinFsp.WinFsp" ; winget install -h -e --id "SSHFS-Win.SSHFS-Win"
Successfully installed

I'll be submitting a PR to address this shortly.

Cheers!