Powershell

A quick and dirty one for you.  There is often time I need to launch and edit a word document in Word.

And I’m lazy.   I try to work from the Command prompt as much as possible.  Type it and I’m good.  I just hate clicking that darn mouse whenever possible.   The more I live in Powershell, the better and happier I am.

I constantly open .CSV files to view and search the contents in Excel.  I find Excel (and other applications suited for that exact purpose) do the job beautifully.

I didn’t realize until just now that if I launch “START-PROCESS” and a filename.CSV or .DOC (or whatever) it would just launch the default app with the file loaded!

I like that!

But, as I said before.   I don’t like typing.  So I made an ALIAS and you can too.   Think of an ALIAS as a keyboard shortcut.   Something to make you more efficient.

The process is easy too.

 

NEW-ALIAS ALIASNAME ORIGINALCmdLet

 

So super lazy me made an ALIAS to “Open files”

NEW-ALIAS OPEN-FILE START-PROCESS

So now in Powershell I just type in “OPEN-FILE THISFILE.CSV” or “OPEN-FILE SOMETHING.DOC” and it launches the default app with the file opened.   Yes, this is good for PDF files too.

 

And yes, you could just as easily as lazily create an ALIAS call “O” to “Open a file” 😛

NEW-ALIAS O START-PROCESS

O EXCELFILE.CSV

 

Powershell.  Enjoy the sweet life.

Sean
The Energized Tech

Advertisements