Pull requests / #1568

#1568 Fix PowerShell 5.1 command shown by UPDATE.bat

open · @BonifacioCalindoro · 0 comments · View on GitHub

Windows

Description

## Fix PowerShell 5.1 compatibility of recovery instructions

`UPDATE.bat` currently prints this command when a clone needs to be moved to the new repository history:

```text
git branch pre-cleanup-backup && git stash push
```

This is valid in PowerShell 7, but not in Windows PowerShell 5.1. Windows 11 can still launch Windows PowerShell 5.1 by default, so users can encounter a parser error when copying the command from the script:

```text
The token '&&' is not a valid statement separator in this version.
```

The `.bat` itself does not need to change its use of `&&`: the problematic `&&` is inside an `echo` and is intended to be copied and executed by the user in their shell.

This change prints the two commands separately instead:

```text
git branch pre-cleanup-backup
git stash push
```

This works in both Windows PowerShell 5.1 and newer PowerShell versions, while also avoiding a shell-specific operator in instructions intended for manual execution.

No behavior of the update script itself is changed.

Fixes #1566 

Related on strata.com

Editorial links to help you install, pick models, or read release notes — not part of the upstream thread.