Skip to content

Instantly share code, notes, and snippets.

Investigating a better artifact workflow

Jake Morrison techthoughts2

Investigating a better artifact workflow
View GitHub Profile
techthoughts2 / Send-TelegramTextMessage
Last active Jun 18, 2021
This PowerShell function will send a Telegram message via the Telegram Bot API. Specify your Bot token and chat ID and send text messages to the specified Telegram chat via PowerShell.
View Send-TelegramTextMessage
Sends Telegram text message via Bot API
Uses Telegram Bot API to send text message to specified Telegram chat. Several options can be specified to adjust message parameters.
$bot = "#########:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-#########"
Send-TelegramTextMessage -BotToken $bot -ChatID $chat -Message "Hello"
techthoughts2 / CustomPSObject
Last active Jun 16, 2021
Several examples of creating and working with custom PowerShell objects and hash tables. Examples include creating customer Powershell objects that contain multiple values.
View CustomPSObject
#Jake Morrison - @jakemorrison -
$results = [PSCustomObject]@{
HypTotal = $hyptotal
MgmtVMTotal = $mgmtVMTotal
UniqueCustomerCount = $customerTotal
TotalComputerObjects = $allCompsTotal
TotalUserObjects = $userTotal
View powershell_array
# adding stuff to emtpy array objects quickly
$myarray = [System.Collections.ArrayList]::new()
techthoughts2 / settings.json
Last active May 17, 2021
Visual Studio Code User Settings that I currently use. Heavy focus on PowerShell, Python, AWS, and Azure.
View settings.json
"breadcrumbs.enabled": false,
"explorer.confirmDragAndDrop": false,
"omnisharp.projectLoadTimeout": 120,
"workbench.settings.editor": "json",
"workbench.tree.indent": 15,
"workbench.editor.titleScrollbarSizing": "large",
techthoughts2 / ws_setup.ps1
Last active May 13, 2021
This PowerShell script will setup a fresh workstation with everything needed to sucessfully work and be a DevOps Master day-to-day.
View ws_setup.ps1
#region installs
# basic choco installs
$script:chocoInstalls = @(
# 'ytmdesktop' #
'vscode' # visual studio code
'powershell-core' # powershell 7+
'python' # python
'cacher' # code snippet organizer
'winscp' # Open source free SFTP client, SCP client, FTPS client and FTP client
View autoCompletion.ps1
$GetVM={Get-VM | Select-Object -ExpandProperty Name}
$AutoCompleteVM = @{
CommandName = 'New-Foo'
ParameterName = 'VMName'
ScriptBlock = $GetVM
Register-ArgumentCompleter @AutoCompleteVM
View sort_ips.ps1
[string[]]('','' | % {[Version]$PSItem} | sort)
View cpu_stress
$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;
View profile.ps1
#region functions
Returns weather report information.
Console-oriented weather forecast that returns weather information for specified parameters.
Returns full weather information based on the location of your IP with all defaults.
techthoughts2 / powershell.json
Last active Apr 11, 2021
Collection of PowerShell Snippets for VSCode
View powershell.json
"Help": {
"prefix": "help",
"body": [
"\tShort description",
"\tLong description",