PowerShell for Windows Admins

Mar 24 2014   12:30PM GMT

A little bit of community

Richard Siddaway Richard Siddaway Profile: Richard Siddaway

One thing I really like about the PowerShell community is the number of people who share information and the way that allows us to incrementally increase our knowledge and skills. This can lead to the situation where you can take ideas from two very separate people, from two different times and put them together to get something different.

I was reading my friend Jason’s blog post – http://powershell.org/wp/2014/03/23/new-tools-in-my-toolbox/ and when I got to the bit about using PowerShell to start Internet Explorer:

PS> Start iexplore www.bing.com

Start is an alias for Start-Process and I remembered something Ed Wilson (The Scripting Guy) once told me about using single letter aliases for his common activities.

Many people are aware of aliases within PowerShell and how they can cut down typing when you are working interactively. What isn’t so widely realised is that you can define aliases for non-PowerShell commands.

So in the interests of absolute brevity let define a new alias S that provides an even shorter way to use Start-Process:

New-Alias -Name S -Value Start-Process

You can test it by trying

s notepad

You should get an instance of notepad started.  This makes starting Internet Explorer as simple as:

s iexplore www.bing.com

Alternatively, you can cut out the use of Start-Process. Define an alias for Internet Explorer

New-Alias -Name I -Value ‘C:\Program Files (x86)\Internet Explorer\IEXPLORE.EXE’

Try it using

i

And a new instance of IE will start

This means that you can start IE in a particular web site very quickly for example:

i www.bing.com i amazon.co.uk

Single letter aliases are a great way to minimise your typing. If you want them to be always available then add them to your profile

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: