Skip to content

Instantly share code, notes, and snippets.

@OskarKlintrot
Last active April 30, 2020 06:33
Show Gist options
  • Save OskarKlintrot/a9dd25bec2b8b37f908c61e05202cf8e to your computer and use it in GitHub Desktop.
Save OskarKlintrot/a9dd25bec2b8b37f908c61e05202cf8e to your computer and use it in GitHub Desktop.
# Might need this later on: https://docs.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-core-60?view=powershell-6#backwards-compatibility-with-windows-powershell
# Install posh-git first with
# > PowerShellGet\Install-Module posh-git -Scope CurrentUser -AllowPrerelease -Force
Import-Module posh-git # Might want to add it to $profile.CurrentUserAllHosts instead: https://github.com/dahlbyk/posh-git#step-2-import-posh-git-from-your-powershell-profile
Set-PSReadLineOption -Colors @{ "Command"=[ConsoleColor]::DarkYellow }
Import-Module C:\_repos\tools\scripts\Eparkering-Module\EparkeringModule\EparkeringModule.psd1
CHCP 65001
$myScripts = "$PSScriptRoot\myScripts"
$files = Get-ChildItem $myScripts\*.ps1
ForEach ($file in $files) {
set-alias $file.BaseName $file.FullName -Scope Global
}
# PowerShell parameter completion shim for the dotnet CLI
Register-ArgumentCompleter -Native -CommandName dotnet -ScriptBlock {
param($commandName, $wordToComplete, $cursorPosition)
dotnet complete --position $cursorPosition "$wordToComplete" | ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
}
}
Start-Process notepad -Verb runAs -ArgumentList "$($env:SystemRoot)\system32\drivers\etc\hosts"
docker run --publish 6379:6379 redis
{
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"name": "PowerShell",
"source": "Windows.Terminal.PowershellCore",
"startingDirectory" : "C:\\_repos",
"colorScheme": "Tango Light"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment