start | find | index | login or register | edit
2014-07-24
by earl, 942 days ago
Some PowerShell essentials:

0. Activate the "RemoteSigned" execution policy for yourself:
PS> Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
1. Install PsGet: http://psget.net/
2. Install PSReadline:
PS> Import-Module PsGet
PS> Install-Module PSReadline
3. Activate PsGet and PSReadline in your profile for interactive use, and add some additional Linux/Bash-like keybindings. Create $env:USERPROFILE\Documents\WindowsPowerShell\profile.ps1:
if ($host.Name -eq 'ConsoleHost') {
Import-Module PsGet

Import-Module PSReadline
Set-PSReadlineOption -EditMode Emacs
Set-PSReadlineKeyHandler -Chord 'Shift+PageUp' `
-Function ScrollDisplayUp
Set-PSReadlineKeyHandler -Chord 'Shift+PageDown' `
-Function ScrollDisplayDown
Set-PSReadlineKeyHandler -Chord 'Ctrl+LeftArrow' `
-Function ShellBackwardWord
Set-PSReadlineKeyHandler -Chord 'Ctrl+RightArrow' `
-Function ShellForwardWord
}
Note, though, that the presence of even just an empty profile.ps1 significantly slows down PowerShell startup for me. (But it's still much faster than the ISE.)
powered by vanilla
echo earlZstrainYat|tr ZY @.
earl.strain.at • esa3 • online for 5832 days • c'est un vanilla site