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 hidden or 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
Show hidden characters
{ | |
/* | |
description: | |
Examples of different input types | |
this isn't an actual snippet file to use | |
it's an example template | |
New: Snippet variables | |
https://code.visualstudio.com/updates/v1_53#_new-snippet-variables |
This file contains hidden or 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
class ConstrainedVariableInterpolation : System.Management.Automation.Language.AstVisitor { | |
hidden [Hashtable] $Property | |
[System.Collections.Generic.List[PSCustomObject]] $Result | |
hidden [System.Management.Automation.Language.Ast] $Ast | |
[System.Management.Automation.Language.AstVisitAction] CheckForPostAction([System.Management.Automation.Language.Ast] $ast, [System.Management.Automation.Language.AstVisitAction] $action) | |
{ | |
throw 'CheckForPostAction not supported' | |
} | |
This is to try and document the behaviour around PowerShellGet/PSResourceGet code signing publisher behaviour.
The following code can be used to set up this scenario. This must be run as an administrator in Windows PowerShell.
Note: PowerShell uses implicit remoting for the New-SelfSignedCertificate
which breaks the constains serialization. You must run this on Windows PowerShell.
This file contains hidden or 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
license: mit | |
scrolling: true | |
height: 300 |
This file contains hidden or 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
# Copyright: (c) 2021, Jordan Borean (@jborean93) <[email protected]> | |
# MIT License (see LICENSE or https://opensource.org/licenses/MIT) | |
Update-TypeData -TypeName 'Shell.Metadata' -DefaultDisplayPropertySet 'Name', 'Item type' -Force | |
Function Get-ItemMetadata { | |
<# | |
.SYNOPSIS | |
Get shell explorer metadata for a file. |
This file contains hidden or 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
class ConstrainedVariableInterpolation : System.Management.Automation.Language.AstVisitor { | |
hidden [Hashtable] $Property | |
[System.Collections.Generic.List[PSCustomObject]] $Result | |
hidden [System.Management.Automation.Language.Ast] $Ast | |
[System.Management.Automation.Language.AstVisitAction] CheckForPostAction([System.Management.Automation.Language.Ast] $ast, [System.Management.Automation.Language.AstVisitAction] $action) | |
{ | |
throw 'CheckForPostAction not supported' | |
} | |
This file contains hidden or 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 "$PSScriptRoot\..\Module\WindowsPresentationFramework" -Force | |
. "$PSScriptRoot\WindowsPresentationFramework.ps1" | |
#Region ThreadSafe | |
# Bind Variables | |
[WindowsPresentationFrameworkThreadSafe()] | |
[PSObject] $Variable = "Herro World from Proxy Scope" | |
[WindowsPresentationFrameworkThreadSafe()] | |
$Sync = [hashtable]::Synchronized(@{}) |
This file contains hidden or 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
name: Auto-merge | |
on: | |
pull_request: | |
types: [opened] | |
jobs: | |
automerge: | |
runs-on: ubuntu-latest |
This file contains hidden or 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
# Copyright: (c) 2021, Jordan Borean (@jborean93) <[email protected]> | |
# MIT License (see LICENSE or https://opensource.org/licenses/MIT) | |
Function Get-Shortcut { | |
[CmdletBinding(DefaultParameterSetName='Path')] | |
param ( | |
[Parameter( | |
Mandatory = $true, | |
Position = 0, | |
ValueFromPipeline = $true, |