Search notes:

PowerShell: Pipeline Chain Operators

The pipeline chain operators are && and ||. They differ from other operators in that they connect two pipelines rather than are being used in expressions.
&& runs the next pipeline if the previous failed succeed, || runs the second pipeline if the previous one failed.
If a pipeline is considered successful is determined by the value of $? (and $lastExitCode ?).
The first pipeline is successful, the second one is not run:
write-host 'first pipeline' || write-host 'second pipeline'
The first pipeline is successful, so the seoncd on is run as well:
write-host 'first pipeline' && write-host 'second pipeline'
The first pipeline fails, so the second one is executed:
no-such-command || write-host 'second pipeline'
The first pipeline fails, so the second one is not executed. (Note, if $errorActionPreference is set to stop, the second pipeline is not run when the first pipeline fails).
no-such-command && write-host 'second pipeline'

See also

The call operator (&)

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1758193861, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/language/operator/pipeline-chain/index(58): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78