about_Continue - PowerShell command help and examples

Describes how the Continue statement immediately returns the program flow (about_Continue)

TOPIC
about_Continue
SHORT DESCRIPTION
Describes how the Continue statement immediately returns the program flow to the top of a program loop.
LONG DESCRIPTION
In a script, the Continue statement immediately returns the program flow to the top of the innermost loop that is controlled by a For, Foreach, or While statement. The Continue keyword supports labels. A label is a name you assign to a statement in a script. For information about labels, see about_Break. In the following example, program flow returns to the top of the While loop if the $ctr variable is equal to 5. As a result, all the numbers between 1 and 10 are displayed except for 5: while ($ctr -lt 10) { $ctr +=1 if ($ctr -eq 5) {continue} Write-Host $ctr } Note that in a For loop, execution continues at the first line in the loop. If the arguments of the For statement test a value that is modified by the For statement, an infinite loop may result. SEE ALSO about_Comparison_Operators C:\Windows>powershell get-help about_Core_Commands -full

Microsoft Windows [Version 10.0.19045.3693]
Copyright (c) 2023 Microsoft Corporation.

ColorConsole [Version 3.7.1000] PowerShell 2.0-Export

Windows 11, 10, 8.1, 8, 7 / Server 2022, 2019, 2016











Windows-10


... Windows 10 FAQ
... Windows 10 How To


Windows 10 How To


... Windows 11 How To
... Windows 10 FAQ



PowerShell: Describes how the Continue statement immediately returns the program flow

HTTP: ... PS_Windows/en/about_Continue.htm
0.092
16943
What are command prompt internal commands?
Über Eingabeaufforderung den Energiesparplan zurücksetzen wiederherstellen?
Latency and access time in Is-My-Memory-OK?
Create hard links and soft links under Windows via command prompt!
Sehen Sie sich Star Wars Episode IV über die Eingabeaufforderung an!
Save and Restore Wi-Fi settings in Windows (11, 10, 8.1, 7)!
Fehlerhafte Sektoren der Festplatte reparieren mit Befehlen der CMD auf Windows!
Enable / disable password protected sharing?
Is it not possible to find not safely deleted files and then delete them safely?
Files that are younger than the date can be deleted via the command line!



(0)