vista

Multiple ways to open PowerShell in the current Explorer window

These techniques are generic and can be used for other items like command prompt as well. A word of caution, everything given below involves fiddling with the registry so please backup your system’s registry or create a restore point before trying this out.

1) Adding it to Vista Explorer’s toolbar:

image

This is the most convenient one in my opinion, but requires most work to enable it.

Firstly, navigate to the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer\FolderTypes\{7d49d726-3c21-4f05-99aa-fdc2c9474656}

› Continue reading

Context sensitive auto-completion using PowerShell, PowerTab and GIT

Powertab is an Awesome PowerShell TabExpansion extension. It extends the default PowerShell autocompletion and shows the results like:

image

The best part is that it is easily customizable.

One way to customize it is by editing it Tab Expansion database file which is located in your powershell profile directory:

TabExpansion.xml

› Continue reading

Monday, October 13th, 2008 GIT, powershell, ruby, vista, windows 5 Comments

Displaying GIT Branch on your PowerShell prompt

PowerShell is a command line shell like the command prompt (cmd.exe) but with a lot more features. It can be downloaded from here.

One of the features is that you can change the default prompt. Prompt can be changed by overriding the function with name “prompt”.

This function can be declared inside the PowerShell profile file which has the path:

C:\Users\Gaurav\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

If the file does not exist then you will need to create this file. Declaring the following function inside the profile file will change the prompt.

   1: function prompt {
   2:   return "prompt> "
   3: }

to:

image

› Continue reading

Sunday, October 12th, 2008 GIT, powershell, vista, windows 6 Comments

Compiling and Installing GIT on windows under cygwin

Using GIT was one of the requirements of one of the project that I am doing. Here is how I installed GIT on Windows.

So What is GIT?

The supplied documentation of GIT says that:

Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals.

Here is the link for the wikipedia entry.

Where can I download GIT?

Here is the link.

› Continue reading

Friday, April 11th, 2008 FOSS, GIT, cygwin, open source, perl, vista, windows 3 Comments

New and Improved Sudo for Vista (now remembers credentials)

In one of my earlier blog post I shared source code for a simple utility that I had made. It could be used to launch elevated processes from the command line.

So opening a Elevated command prompt was as simple as writing

sudo cmd

Actually the code for this is very simple as it just executes a well documented system function ShellExecute.

I have made some changes to the script and now it remembers the credentials. So once you execute any command, Vista will ask you confirmation only once and any subsequent call won’t ask for the confirmation with the UAC dialog box.

› Continue reading

Wednesday, April 2nd, 2008 security, sudo, vista, vista, security, windows No Comments