Git PowerShell setup
- First install git: http://git-scm.com/download/win
- Then, you may follow instructions from: https://github.com/dahlbyk/posh-git or just execute:
Install-Module posh-git
Note: this is an untrusted module per some corporate setups. Therefore, you may need to install per: http://psget.net/ Execute from within PowerShell:
(new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex
Note: you must modify the default install script if you use the last method above. If you get an error stating that you must upgrade to PowerShell 3 or greater, this guide and installation may be helpful for Windows 7 and 8 users: https://www.linkedin.com/pulse/getting-powershell-5-running-windows-7-server-2008-r2-darwin-sanoy. - Customize the Microsoft.PowerShell_profile.ps1 in this directory to your liking. Typically, it is installed in the ~\Documents\WindowsPowerShell or, in my case, ~\source\PS-Git directories.
- You can see if you have an existing $PROFILE by executing:
Get-Item $PROFILE
You can then add the customized Microsoft.PowerShell_profile.ps1 to that file or replace it. You may need to do:New-Item -Path $PROFILE -ItemType "file" -Force
if one does not already exist - In corporate environments you may not have the proper execution policy to run scripts. You can determine this by running
Get-ExecutionPolicy
and then setting the policy viaSet-ExecutionPolicy RemoteSigned
. See: https://technet.microsoft.com/en-us/library/ee176961.aspx - The default PS-Readline script is used for colorization and better command line history along with bash style command completion. You must execute:
Install-Module PSReadline
from an elevated shell to install it. TheSet-PSReadlineKeyHandler -Key Tab -Function Complete
sets up bash style completion. Change it to your liking or read the instructions at https://github.com/lzybkr/PSReadLine for more customization options. - There is also command completion for
npm
in the profile. You must execute, from an elevated shell:
Find-Module TabExpansionPlusPlus -repository PsGallery | Install-Module -Scope AllUsers
Find-Module NPMTabCompletion -repository PsGallery | Install-Module -Scope AllUsers
to enable.
Other Useful Utilities:
(Find-Package pscx | Install-Package
)
- https://github.com/bmatzelle/gow -- a lighter weight set of bash/unix style utilities than Cygwin
ps1.vim for Syntax Highlight PowerShell ps1 files:
git clone https://github.com/PProvost/vim-ps1 ~/vimfiles/bundle/vim-ps1