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
############################################################################################################################################################## | |
# IANA # | |
############################################################################################################################################################## | |
# | |
# Address family | |
# | |
New-Enum -ModuleBuilder $IndentedDnsMB -Name "Indented.Dns.IanaAddressFamily" -Type "UInt16" -Members @{ | |
IPv4 = 1; # IP version 4 |
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 Get-DNSDebugLog | |
{ | |
<# | |
.SYNOPSIS | |
This cmdlet parses a Windows DNS Debug log with details. | |
Author: @jarsnah12 | |
License: BSD 3-Clause | |
Required Dependencies: None | |
Optional Dependencies: None |
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
# Import-Module .\assemblies\PSHTML\PSHTML.psd1 | |
html -Content { | |
head -Content { | |
Title -Content "iCMS | Home" | |
Link -href "./../assets/css/metro.min.css" -rel "stylesheet" | |
Link -href "./../assets/css/metro-colors.min.css" -rel "stylesheet" | |
Link -href "./../assets/css/metro-rtl.min.css" -rel "stylesheet" | |
Link -href "./../assets/css/metro-icons.min.css" -rel "stylesheet" | |
script -src "./../assets/js/jquery-3.3.1.min.js" | |
script -src "./../assets/js/metro.min.js" |
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
# in module scope | |
$script:pester | |
function describe () { | |
$script:pester.EnterBlock("describe") | |
} | |
function it () { |
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
using Namespace System.Management.Automation.Language | |
Function Get-AliasTarget { | |
[cmdletbinding()] | |
param ( | |
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] | |
[Alias('PSPath', 'FullName')] | |
[string[]]$Path | |
) |
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 Save-WebCertificate { | |
param ( | |
# Attempt to acquire a certificate from the specified URI | |
[Parameter(Mandatory)] | |
[ValidateScript( { $_.Scheme -eq 'https' } )] | |
[Uri]$Uri, | |
# Save the certificate in PEM format to the specified path. | |
[Parameter(Mandatory)] | |
[String]$Path, |
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
<# | |
.SYNOPSIS | |
Get the latest Cumulative update for Windows | |
.DESCRIPTION | |
This script will return the list of Cumulative updates for Windows 10 and Windows Server 2016 from the Microsoft Update Catalog. | |
.NOTES | |
Copyright Keith Garner (KeithGa@DeploymentLive.com), All rights reserved. |
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 Get-WinEventXPathFilter | |
{ | |
<# | |
.SYNOPSIS | |
This function generates an xpath filter that can be used with the -FilterXPath | |
parameter of Get-WinEvent. It may also be used inside the <Select></Select tags | |
of a Custom View in Event Viewer. | |
.DESCRIPTION | |
This function generates an xpath filter that can be used with the -FilterXPath | |
parameter of Get-WinEvent. It may also be used inside the <Select></Select tags |