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
/* Background */ .chroma { color: #d4d4d4; background-color: #161616; font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; } | |
/* Other */ .chroma .x { } | |
/* Error */ .chroma .err { color: #960050; background-color: #1e0010 } | |
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; } | |
/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; } | |
/* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #ffffcc } | |
/* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } | |
/* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f } | |
/* Keyword */ .chroma .k { color: #c586c0 } | |
/* KeywordConstant */ .chroma .kc { color: #66d9ef } |
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-RandomFile { | |
[CmdletBinding()] | |
param ( | |
# Where the file will be created | |
[parameter(Mandatory)] | |
$Path, | |
# Size of file (tip: use 20mb, 1gb etc.) | |
[parameter(Mandatory)] | |
[int64]$Size |
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
# This function triggers the start of a function inside an Azure Function App | |
function Start-FunctionAppFunction { | |
[CmdletBinding()] | |
param ( | |
# Enter the base url for the function app. Example: https://myappname.azurewebsites.net | |
[Parameter(Mandatory)] | |
[Uri]$FunctionAppBaseUrl, | |
# Enter the app key called _master |
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
<# | |
Requires Az module. Use Connect-AzAccount before running. | |
Creates the following: | |
Resource group | |
Key vault | |
Storage account (Standard_LRS) | |
Function app (EP1) | |
PowerShell 7 runtime | |
Assigned identity |
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
using namespace System.Management.Automation | |
class ValidCommandsGenerator : IValidateSetValuesGenerator { | |
[string[]] GetValidValues() { | |
$Values = (Get-Command).Name | |
return $Values | |
} | |
} | |
Function New-ProxyFunction { |
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
#region LabModule.psd1 | |
@{ | |
RootModule = 'LabModule.psm1' | |
ModuleVersion = '1.0' | |
GUID = 'd00578f5-fb6b-4c47-83fb-ed1c8d9a1ec2' | |
FunctionsToExport = 'Get-PublicStuff' | |
} | |
#endregion | |
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-FileEncoding { | |
[CmdletBinding()] | |
param ( | |
[ValidateScript({Test-Path -Path $_})] | |
[string]$Path | |
) | |
$fullpath = (Resolve-Path -Path $Path).Path | |
$file = [System.IO.FileStream]::new($fullpath,[System.IO.FileMode]::Open) |
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 ConvertSecureToString | |
{ | |
[CmdletBinding()] | |
[OutputType([String])] | |
param ( | |
[Parameter(Mandatory=$true, | |
ValueFromPipeline=$true, | |
Position=0)] | |
[ValidateNotNull()] | |
[SecureString] |
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 Play-JingleBells { | |
[System.Console]::Beep(659, 300); | |
[System.Console]::Beep(659, 300); | |
[System.Console]::Beep(659, 300); | |
[System.Threading.Thread]::Sleep(300); | |
[System.Console]::Beep(659, 300); | |
[System.Console]::Beep(659, 300); | |
[System.Console]::Beep(659, 300); | |
[System.Threading.Thread]::Sleep(300); | |
[System.Console]::Beep(659, 300); |
NewerOlder