Loop | Return | Continue | Break |
---|---|---|---|
Normal Expectation | Exit Scope | Next Item | Exit Loop |
.foreach{} | Next Item | Break Scopes / Next Item of Parent Loop | Break Scopes / Exit Parent Loop |
foreach ($y in $x) | Exit Scope | Next Item | Exit Loop |
for ($i;$i -lt 5;$i++) | Exit Scope | Next Item | Exit Loop |
Foreach-Object -InputObject @() | Next Item | Break Scopes / Next Item of Parent Loop | Break Scopes / Exit Parent Loop |
Switch | Exit Scope | Next Item | Exit Switch |
While |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-PSNotification { | |
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Medium')] | |
param( | |
[Parameter(Position=0, Mandatory, ValueFromPipeline)] | |
[object[]] | |
$Body, | |
[string] | |
$Summary = 'PowerShell Notification', |