Skip to content

Instantly share code, notes, and snippets.

Avatar
🕵️‍♂️
Investigating a better artifact workflow

Jake Morrison techthoughts2

🕵️‍♂️
Investigating a better artifact workflow
View GitHub Profile
View bs-powershell
- dotnet tool install --global PowerShell --version 7.0.3
- powershell -command '.\configure_aws_credential.ps1'
# - aws s3 cp s3://ps-invoke-modules/PowerShell-7.0.3-win-x64.msi PowerShell-7.0.3-win-x64.msi --quiet
- powershell -command '[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;$url = """https://github.com/PowerShell/PowerShell/releases/download/v7.0.3/PowerShell-7.0.3-win-x64.msi""";$output = """$env:CODEBUILD_SRC_DIR\PowerShell-7.0.3-win-x64.msi""";Invoke-WebRequest -Uri $url -OutFile $output -ErrorAction Stop;if (-not(Test-Path $output)) {throw """PSCore failed to DL"""}'
- powershell -command "Start-Process $env:CODEBUILD_SRC_DIR\PowerShell-7.0.3-win-x64.msi -ArgumentList '/qn /norestart' -Wait"
- '& "C:\Program Files\PowerShell\7\pwsh.exe" -command ''.\install_modules.ps1'''
@techthoughts2
techthoughts2 / ps_reddit
Last active Jul 3, 2020
PowerShell based interactive reddit browser. Browse your favorite subreddits using PowerShell!
View ps_reddit
<#
.SYNOPSIS
Launches the default browser to display reddit pictures.
.DESCRIPTION
Long description
.EXAMPLE
Show-Pics -URL https://i.imgur.com/fcuRqwl.jpg
Launches default browser to provided link.
.EXAMPLE
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 defaults
[
{
"key": "ctrl+shift+c",
"command": "PowerShell.ShowAdditionalCommands",
"when": "editorLangId == 'powershell'"
},
{
"key": "ctrl+shift+t",
"command": "shellLauncher.launch"
You can’t perform that action at this time.