Skip to content

Instantly share code, notes, and snippets.

🕵
Investigating a better artifact workflow

Jake Morrison techthoughts2

🕵
Investigating a better artifact workflow
Block or report user

Report or block techthoughts2

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@techthoughts2
techthoughts2 / console_color
Created Nov 12, 2019
Change the color of the console output
View console_color
$Host.PrivateData
$host.PrivateData.ErrorForegroundColor = [System.ConsoleColor]::Magenta
@techthoughts2
techthoughts2 / ps_Errors.ps1
Last active Oct 21, 2019
Working with PowerShell Errors
View ps_Errors.ps1
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
View mdh_multiline_examples
<#
(## EXAMPLE [^`]*)(```\r\n)([^`]*)(```\r\n)(\r\n)([^#]*)(\r\n\r\n)+([^#]+)(#)
(## EXAMPLE [^`]+?```\r\n[^`\r\n]+?\r\n)(```\r\n\r\n)([^#]+?\r\n)(\r\n)
(## EXAMPLE [^`]+?```\r\n[^`\r\n]+?\r\n)(```\r\n\r\n)([^#]+?\r\n)(\r\n)([^#]+)(#)
#>
New-MarkdownHelp -Module MyModuleToDocument -OutputFolder $OutputDir -Force
$OutputDir | Get-ChildItem -File | ForEach-Object {
# fix formatting in multiline examples
View bom_adjust
$content = Get-Content 'Get-TelegramStickerPackInfo.Tests.ps1'
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $true
$path = [System.Environment]::CurrentDirectory = (Get-Location).Path
$MyPath = "$path\Get-TelegramStickerPackInfo.Tests.ps1"
[System.IO.File]::WriteAllLines($MyPath, $content, $Utf8NoBomEncoding)
$content = Get-Content 'Send-TelegramSticker.Tests.ps1'
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $true
$path = [System.Environment]::CurrentDirectory = (Get-Location).Path
View PSProfile
#_________________________________________________________________________________________
Write-Host "Initializing the Shell..." -ForegroundColor DarkCyan -BackgroundColor White
$global:sysvars = Get-Variable | Select-Object -ExpandProperty Name
$global:sysvars += 'sysvars'
$greetings =
'Welcome back Jake',
'Glad to see you Jake!',
'Happy coding Jake!',
View Microsoft.VSCode_profile
#Microsoft.VSCode_profile.ps1
Write-Host -ForegroundColor Gray ("Loading up the EditorServicesCommandSuite...")
try {
# Place this in your VSCode profile
Import-Module EditorServicesCommandSuite
Import-EditorCommand -Module EditorServicesCommandSuite
Write-Host "EditorServicesCommandSuite loaded." -ForegroundColor Magenta
}
catch{
Write-Host "Jake, EditorServicesCommandSuite has failed." -ForegroundColor DarkRed
@techthoughts2
techthoughts2 / settings.json5
Last active Aug 27, 2019
Visual Studio Code User Settings that I currently have deployed with a heavy focus on PowerShell and AWS Cloudformation.
View settings.json5
{
//SETTINGS CHANGES
"workbench.settings.editor": "json",
//LOOK AND FEEL CHANGES
//editor
"editor.renderWhitespace": "all",
"editor.mouseWheelZoom": true,
"editor.quickSuggestionsDelay": 1,
"editor.tabCompletion": "on",
@techthoughts2
techthoughts2 / vs_code_extensions
Last active Aug 26, 2019
List of Visual Studio Code extensions that I am currently using. Heavy focus with PowerShell development and AWS CloudFormation.
View vs_code_extensions
<#
aaron-bond.better-comments
ban.spellright
bceskavich.theme-dracula-at-night
CoenraadS.bracket-pair-colorizer-2
DanielThielking.aws-cloudformation-yaml
DavidAnson.vscode-markdownlint
DotJoshJohnson.xml
dracula-theme.theme-dracula
eamodio.gitlens
@techthoughts2
techthoughts2 / vscode_basic_powershell_settings.json5
Last active Jul 21, 2019
Basic VSCode settings for PowerShell development
View vscode_basic_powershell_settings.json5
{
// editor
"editor.quickSuggestionsDelay": 1,
"editor.tabCompletion": "on",
"files.defaultLanguage": "powershell",
// default shell
// Windows
// PowerShell 6
"terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\6\\pwsh.exe",
View install_chrome
$P = $env:TEMP + '\chrome_installer.exe'; Invoke-WebRequest 'https://dl.google.com/chrome/install/latest/chrome_installer.exe' -OutFile $P; Start-Process -FilePath $P -Args '/silent /install' -Verb RunAs -Wait; Remove-Item $P
You can’t perform that action at this time.