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
View argument_completer
function test-arg {
[cmdletbinding()]
param(
[ArgumentCompleter({'mouse','house','goat'})]
$GreenEggs
)
$greeneggs
}
View argument_completer
function Get-Something {
param(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[ArgumentCompleter( {
@(
"keys"
"wallet"
"phone"
)
View select_property
$top50 = $community `
| Sort-Object { [int]$_.AdditionalMetadata.downloadCount } -Descending `
| Select-Object Name, @{N = "Downloads"; E = { $_.AdditionalMetadata.downloadCount } } -First 50
View ps1xml
Update-FormatData -AppendPath 'C:\ProjectName.Format.ps1xml'
# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = @(
'ProjectName.Format.ps1xml'
)
$item.PSObject.TypeNames.Insert(0, 'The.Name.Here')
View ps_random
# Get Random Stuff
-join (33..126 | %{ [char]$_ } | Get-Random -Count 16)
View suppress
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingCmdletAliases", "", Justification = "Invoke-Build is alias only")]
param ()
View keybindings
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "alt+`",
"command": "shellLauncher.launch"
},
{
"key": "ctrl+shift+c",
"command": "PowerShell.ShowAdditionalCommands",
"when": "editorLangId == 'powershell'"
@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
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
You can’t perform that action at this time.