🕵️♂️
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
""" | |
Ctrl+K Ctrl+0 Fold (collapse) all regions editor.foldAll | |
Ctrl+K Ctrl+J Unfold (uncollapse) all regions | |
Ctrl+Shift+[ Fold (collapse) region editor.fold | |
Ctrl+Shift+] Unfold (uncollapse) region editor.unfold | |
Ctrl+K Ctrl+[ Fold (collapse) all subregions editor.foldRecursively | |
Ctrl+K Ctrl+] Unfold (uncollapse) all subregions editor.unfoldRecursively | |
""" | |
# region links |
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
#Jake Morrison - @jakemorrison - http://techthoughts.info | |
$results = [PSCustomObject]@{ | |
HypTotal = $hyptotal | |
MgmtVMTotal = $mgmtVMTotal | |
UniqueCustomerCount = $customerTotal | |
TotalComputerObjects = $allCompsTotal | |
TotalUserObjects = $userTotal | |
} |
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
cron(Minutes | Hours | Day-of-month | Month | Day-of-week | Year) | |
cron(0 0/4 * * ? *) Every 4 hours | |
cron(0 10 * * ? *) 10:00AM UTC everyday | |
cron(15 12 * * ? *) 12:15PM UTC everyday | |
cron(0 18 ? * MON-FRI *) 6:00PM UTC every Mon-Fri | |
cron(0 8 1 * ? *) 8:00AM UTC every first day of the month | |
cron(0/10 * ? * MON-FRI *) Every 10 min Mon-Fri | |
cron(0/5 8-17 ? * MON-FRI *)Every 5 minutes Mon-Fri between 8:00AM - 5:55PM UTC | |
cron(0 9 ? * 2#1 *) 9:00AM UTC first Monday of each month |
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
git config --global -e | |
git config --list --show-origin | |
git config --global user.name | |
git config --global user.email | |
git config --global core.editor "code --wait" | |
Windows creds | |
git config --global credential.helper wincred | |
git clone |
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
$NumberOfLogicalProcessors = Get-CimInstance win32_processor | Select-Object -ExpandProperty NumberOfLogicalProcessors | |
ForEach ($core in 1..$NumberOfLogicalProcessors) { | |
start-job -ScriptBlock { | |
$result = 1; | |
foreach ($loopnumber in 1..2147483647) { | |
$result = 1; | |
foreach ($loopnumber1 in 1..2147483647) { | |
$result = 1; |
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 Reset-Errors { | |
$Global:Error.Clear() | |
$psISE.Options.ErrorForegroundColor = '#FFFF0000' | |
$Global:ErrorView = 'NormalView' | |
} | |
Reset-Errors | |
#generate an error | |
function Show-Error { | |
Get-Item c:\doesnotexist.txt |
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
#Download the .NET Core 2.1 SDK from https://www.microsoft.com/net/download | |
Install-Module AWSPowerShell.NetCore | |
Install-Module AWSLambdaPSCore | |
Import-Module AWSPowerShell.NetCore | |
Import-Module AWSLambdaPSCore | |
Get-Command -Module AWSLambdaPSCore | |
New-Item PSLambda -ItemType Directory |
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 | |
Sends Telegram text message via Bot API | |
.DESCRIPTION | |
Uses Telegram Bot API to send text message to specified Telegram chat. Several options can be specified to adjust message parameters. | |
.EXAMPLE | |
$bot = "#########:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
$chat = "-#########" | |
Send-TelegramTextMessage -BotToken $bot -ChatID $chat -Message "Hello" | |
.EXAMPLE |
NewerOlder