When I enter "ri" PowerShells default set-up thinks it is an alias for "Remove-Item" - how do I use the ri command to invoke the "R"uby "I"ndex?
I tried cd'ing to the C:\Ruby22 and entering:
rdoc --all --ri
gem install rdoc rdoc-data
If your PowerShell has script execution disabled, there's a couple steps involved in getting PShell set-up to launch with "ri" as the command to start the Ruby Index instead of as an alias for Remove-Item.
1) Skip this step if you already have a PowerShell profile:
New-Item $profile -force -itemtype file
...if you don't, this file will get generated in your docs directory: C:\Users\User_Name\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
2) Then open your profile to edit it:
...if it's new, it should be blank.
3) Add the following line to it:
del alias:ri -force
4) Save the file, close notepad and load up the new profile settings with the command below:
... or simply close and open Powershell to apply the profile.
NOTE: This, of course, is insufficient if Powershell has script execution disabled... and only members of the Administrators group on the computer can change the execution policy, so:
1) Launch PowerShell with the "Run as Administrator" option (I only know how to do this from the PowerShell icon sub-menu in the Start Menu...)
2) Enable running unsigned scripts by entering:
This will allow running unsigned scripts that you write on your local computer and signed scripts from Internet. NOTE: from what little I understand of PowerShell, setting the execution policy to "unrestricted" is strongly advised against. Njoy!