PS C:\Users\Example> echo Hello && echo World!
At line:1 char:12
+ echo Hello && echo World!
+ ~~
The token '&&' is not a valid statement separator in this version.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidEndOfLine
PS C:\Users\Example> echo "Hello"; if($?) {echo "World!"}
Hello
World!
Note: Since PowerShell Core v7, && and || can be used directly.
