PS> ConvertFrom-CidrToIPvNetwork -vlsm "10.202.84.0/25"
IpAddress : 10.202.84.0
AddressFamily : InterNetwork
Prefix : 25
Network : 10.202.84.0
SubnetMask : 255.255.255.128
BroadcastAddress : 255.255.255.255
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
if ($ExecutionContext.SessionState.LanguageMode -ne 'FullLanguage') { | |
throw "This script requires `$ExecutionContext.SessionState.LanguageMode to be FullLanguageMode but got '$($ExecutionContext.SessionState.LanguageMode )'" | |
} | |
$global:PSPreCommandLookupAction += @{ | |
Name = "ApplockerSignedScriptRestrictions" | |
Description = "This will bypass Applocker's Signed Script Restrictions by loading the script directly into memory as if it was dot sourced" | |
Filter = { $command -like "*.ps1" } | |
Priority = -1 | |
StopSearch = $true |
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
function Get-PSBoundParameters { | |
<# | |
.SYNOPSIS | |
Get-PSBoundParameters | |
.DESCRIPTION | |
Get the bound parameters of the current command | |
.PARAMETER ParameterSetName | |
Filter the bound parameters by the specified ParameterSetName |
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 FrameBuffer : IDisposable { | |
[System.Int32] $Width | |
[System.Int32] $Height | |
[System.Boolean] $Disposed | |
hidden [System.Int32[]] $buffer | |
hidden [System.Runtime.InteropServices.GCHandle] $bufferHandle | |
hidden [System.Drawing.Image] $bitmap | |
FrameBuffer([System.Int32]$w, [System.Int32]$h) { |
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
function Invoke-RemoteDesktopAppInstaller | |
{ | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory)] | |
[System.Management.Automation.Runspaces.PSSession] $Session | |
) | |
$installShortcutDirectory = "$($env:USERPROFILE)\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Remote App\" | |
$installResourceDirectory = "$($env:USERPROFILE)\AppData\Roaming\Microsoft\Workspaces\" |
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
function Import-ModuleManually { | |
param( | |
[Parameter(Mandatory=$true)] | |
[string]$Module, | |
[Parameter(Mandatory=$false)] | |
[switch]$Force | |
) | |
$moduleExists = Get-Module -Name $Module -All |
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
function Invoke-ForEachObjectWithProgress { | |
[CmdletBinding()] | |
[Alias("ForEachWP")] | |
param( | |
[Parameter(Mandatory, ValueFromPipeline)] | |
[object] $InputObject, | |
[Parameter()] | |
[string] $Activity = "Processing items", |
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
function New-NamedPipeServer { | |
param( | |
[Parameter(Mandatory)] | |
[string] $PipeName, | |
[Parameter(Mandatory)] | |
[scriptblock] $ScriptBlock | |
) | |
Start-Job -Name $PipeName -ScriptBlock { |
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
[ | |
{ | |
"S": [ | |
{ | |
"N": "G0", | |
"T": 1, | |
"DN": "D0" | |
}, | |
{ | |
"N": "G1", |
NewerOlder