Last active
September 17, 2018 17:56
-
-
Save whoisj/881911fc7a0f57be3cd64f6e15cf1a20 to your computer and use it in GitHub Desktop.
PowerShell profile (global)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$host.DebuggerEnabled = $false | |
$host.PrivateData.ErrorBackgroundColor = $host.Ui.RawUi.BackgroundColor | |
$host.PrivateData.ErrorForegroundColor = $host.Ui.RawUi.ForegroundColor | |
$host.PrivateData.WarningBackgroundColor = $host.Ui.RawUi.BackgroundColor | |
$host.PrivateData.WarningForegroundColor = $host.Ui.RawUi.ForegroundColor | |
$host.PrivateData.DebugBackgroundColor = $host.Ui.RawUi.BackgroundColor | |
$host.PrivateData.DebugForegroundColor = $host.Ui.RawUi.ForegroundColor | |
$host.PrivateData.VerboseBackgroundColor = $host.Ui.RawUi.BackgroundColor | |
$host.PrivateData.VerboseForegroundColor = $host.Ui.RawUi.ForegroundColor | |
$host.PrivateData.ProgressBackgroundColor = $host.Ui.RawUi.BackgroundColor | |
$host.PrivateData.ProgressForegroundColor = $host.Ui.RawUi.ForegroundColor | |
Set-PsReadlineOption -TokenKind Type -ForegroundColor $host.Ui.RawUi.ForegroundColor | |
Set-PsReadlineOption -TokenKind Operator -ForegroundColor $host.Ui.RawUi.ForegroundColor | |
Set-PsReadlineOption -TokenKind Parameter -ForegroundColor $host.Ui.RawUi.ForegroundColor | |
function global:OpenGitHub { | |
start-process 'https://github.com/gistofj' | |
} | |
set-alias -name 'github' -scope 'global' -value global:OpenGitHub | |
function global:PushDFunc { pushd "$args[0]" } | |
set-alias -name 'go' -scope 'global' -value global:PushDFunc | |
function global:PopDFunc { | |
popd | |
if ($args.Length -gt 0) { | |
for ($i=1; $i -lt $args[0]; $i++) { popd } | |
} | |
} | |
set-alias -name 'up' -scope 'global' -value global:PopDFunc | |
function global:RecursiveDelete { | |
if ($args.Length -gt 0) { | |
if ($args[1] -eq '-f' -or $args[1] -eq '--force') | |
{ | |
gci -re -fi $args[0] | ri | |
} else { | |
gci -re -fi $args[0] | ri -whatif | |
} | |
} | |
} | |
set-alias -name 'clean' -scope 'global' -value global:RecursiveDelete | |
function DisableStrongSignValidation | |
{ | |
reg DELETE "HKLM\Software\Microsoft\StrongName\Verification" /f | |
reg ADD "HKLM\Software\Microsoft\StrongName\Verification\*,*" /f | |
if ($env:PROCESSOR_ARCHITECTURE -eq "AMD64") | |
{ | |
reg DELETE "HKLM\Software\Wow6432Node\Microsoft\StrongName\Verification" /f | |
reg ADD "HKLM\Software\Wow6432Node\Microsoft\StrongName\Verification\*,*" /f | |
} | |
restart-service msiserver | |
} | |
set-alias -name 'unsafe' -scope 'global' -value global:DisableStrongSignValidation -force -option allscope |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment