🕵️♂️
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
# test a command that should be called with certain parameters | |
#------------------------------------------------------------------------------ | |
It 'should call the API with the expected parameters' { | |
Mock -CommandName Invoke-RestMethod { | |
} -Verifiable -ParameterFilter { $Uri -like 'https://api.telegram.org/bot*getStickerSet*' } | |
# "https://api.telegram.org/bot$BotToken/getStickerSet" | |
$getTelegramStickerPackInfoSplat = @{ | |
BotToken = $token | |
StickerSetName = 'STPicard' | |
} |
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
# use generic list to add objects in a performant way | |
$starTrekShowInfo = New-Object System.Collections.Generic.List[string] | |
$starTrekShowInfo.Add('Star Trek: The Next Generation') | |
# use custom objects for high performance adds of custom object | |
$choiceArray = New-Object System.Collections.Generic.List[PSCustomObject] | |
#------------------------------------------------------------------------------ | |
# old method which should no longer be used IAW: | |
# https://docs.microsoft.com/en-us/dotnet/api/system.collections.arraylist?view=net-6.0 | |
# adding stuff to emtpy array objects quickly |
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
$GetVM={Get-VM | Select-Object -ExpandProperty Name} | |
$AutoCompleteVM = @{ | |
CommandName = 'New-Foo' | |
ParameterName = 'VMName' | |
ScriptBlock = $GetVM | |
} | |
Register-ArgumentCompleter @AutoCompleteVM |
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
[string[]]('222.1.3.4','1.2.3.4' | % {[Version]$PSItem} | sort) |
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
iex "& { $(irm https://aka.ms/install-powershell.ps1) } -UseMSI" |
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
// This file was initially generated by Windows Terminal 0.11.1333.0 | |
// It should still be usable in newer versions, but newer versions might have additional | |
// settings, help text, or changes that you will not see unless you clear this file | |
// and let us generate a new one for you. | |
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
// C:\Users\user\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\RoamingState | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", |
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
{ | |
"if": { | |
"prefix": "if", | |
"body": ["if ${1:expression}:", "\t${2:pass}"], | |
"description": "Code snippet for an if statement" | |
}, | |
"if/else": { | |
"prefix": "if/else", | |
"body": ["if ${1:condition}:", "\t${2:pass}", "else:", "\t${3:pass}"], | |
"description": "Code snippet for an if statement with else" |
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
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"type": "prompt", | |
"alignment": "left", | |
"segments": [ | |
// { | |
// "type": "text", | |
// "style": "plain", |
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
#region installs | |
# core tech choco installs | |
$script:chocoCoreTech = @( | |
# 'vscode' # visual studio code | |
# 'python' # python | |
# '7zip' # file archiver with good compression ratio | |
# 'git' # git for windows | |
# 'firefox' # firefox browser | |
) |
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
Connect-AzAccount |