View monitor_input_switch
<# | |
.SYNOPSIS | |
Helper function to set the monitor input. | |
.DESCRIPTION | |
Uses ControlMyMonitor.exe to adjust VPCCode 60 for your monitor input. | |
.EXAMPLE | |
Set-MonitorInputSource -InputSource HDMI | |
Switched to HDMI input | |
.EXAMPLE |
View python_notes.py
""" | |
Ctrl+K Ctrl+0 Fold (collapse) all regions editor.foldAll | |
Ctrl+K Ctrl+J Unfold (uncollapse) all regions | |
Ctrl+Shift+[ Fold (collapse) region editor.fold | |
Ctrl+Shift+] Unfold (uncollapse) region editor.unfold | |
Ctrl+K Ctrl+[ Fold (collapse) all subregions editor.foldRecursively | |
Ctrl+K Ctrl+] Unfold (uncollapse) all subregions editor.unfoldRecursively | |
""" | |
# region links |
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''' |
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 http_codes
[net.httpstatuscode]404 |
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) |