Skip to content

Instantly share code, notes, and snippets.

View techthoughts2's full-sized avatar
🕵️‍♂️
Investigating a better artifact workflow

Jake Morrison techthoughts2

🕵️‍♂️
Investigating a better artifact workflow
View GitHub Profile
[net.httpstatuscode]404
$top50 = $community `
| Sort-Object { [int]$_.AdditionalMetadata.downloadCount } -Descending `
| Select-Object Name, @{N = "Downloads"; E = { $_.AdditionalMetadata.downloadCount } } -First 50
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')
# Get Random Stuff
-join (33..126 | %{ [char]$_ } | Get-Random -Count 16)
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingCmdletAliases", "", Justification = "Invoke-Build is alias only")]
param ()
// Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+shift+c",
"command": "PowerShell.ShowAdditionalCommands",
"when": "editorLangId == 'powershell'"
},
{
"key": "ctrl+shift+l",
"command": "shellLauncher.launch"
@techthoughts2
techthoughts2 / console_color
Created November 12, 2019 00:58
Change the color of the console output
$Host.PrivateData
$host.PrivateData.ErrorForegroundColor = [System.ConsoleColor]::Magenta
<#
(## 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
$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
@techthoughts2
techthoughts2 / vscode_basic_powershell_settings.json5
Last active May 15, 2022 19:45
Basic VSCode settings for PowerShell development
{
// editor
"editor.quickSuggestionsDelay": 1,
"editor.tabCompletion": "on",
"files.defaultLanguage": "powershell",
// powershell settings changes
// you can specify a custom location for the powershell.exe/pwsh.exe file
// not required if you just want to use the default locations