Skip to content

Instantly share code, notes, and snippets.

Avatar
💖
Stay warm

Joel Sallow (/u/ta11ow) vexx32

💖
Stay warm
View GitHub Profile
@vexx32
vexx32 / PowershellLoopBehavior.md
Last active Feb 10, 2021 — forked from JustinGrote/PowershellLoopBehavior.md
Reference Table for Loop Behavior in Powershell
View PowershellLoopBehavior.md
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
@vexx32
vexx32 / Invoke-PSNotification.ps1
Last active Nov 9, 2018 — forked from TylerLeonhardt/Invoke-PSNotification.ps1
Show notifications on Linux using PowerShell! Thanks to notify-send(1)
View Invoke-PSNotification.ps1
function Invoke-PSNotification {
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Medium')]
param(
[Parameter(Position=0, Mandatory, ValueFromPipeline)]
[object[]]
$Body,
[string]
$Summary = 'PowerShell Notification',