Welcome to MSDN Blogs Sign in | Join | Help

PowerShell Cheat Sheet

Ben Pearce was gracious enough to put together a good looking PowerShell Cheat Sheet which I've included as an attachment to this blog post.  By definition, a cheat sheet is incomplete so this contains the things that Ben has found to be the most import.   I think you'll find it useful.

Cheers!

Jeffrey Snover [MSFT]
Windows PowerShell/MMC Architect
Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell
Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

Published Wednesday, January 24, 2007 1:15 PM by PowerShellTeam
Filed under:

Attachment(s): Cheat Sheet V1.00.docx

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: PowerShell Cheat Sheet

For those of use running Office 2003 (not 2007), could you post it under a more usable format?

Wednesday, January 24, 2007 8:39 AM by Kathy Nelson

# re: PowerShell Cheat Sheet

I hope you find this useful!  I found printing this out and leaving it on my desk really useful.  There's nothing more annoying than forgetting simple things and having to search for them every time.

Enjoy.

Ben

Wednesday, January 24, 2007 8:51 AM by Ben Pearce

# re: PowerShell Cheat Sheet

You know, I realize that 2007 is now a whole 3 weeks old, but not everyone has jumped to adopt Word 2007.  Publishing this document in the .docx format really runs counter to sharing.  Why not just encrypt the dumb thing and dangle it in front of me too?

Wednesday, January 24, 2007 8:57 AM by Ron McMahon

# re: PowerShell Cheat Sheet

Any formats < Office2007 at all ???

Wednesday, January 24, 2007 9:33 AM by Ian Pender

# re: PowerShell Cheat Sheet

Some of us do not have MS Word 2007 :-(

Could you attach a small HTML/PS/PDF of this file?

Anyway, a PSH Cheat Sheet is nice idea.

Wednesday, January 24, 2007 10:22 AM by vermorel

# re: PowerShell Cheat Sheet

Do you also have this in a pre-"Open XML Format Document " format ?

would be nice for the users of "older" Office versions

Greetings /\/\o\/\/

Wednesday, January 24, 2007 10:27 AM by /\/\o\/\/

# re: PowerShell Cheat Sheet

Good idea, but a few points:

1. Why a docx file? When I downloaded it, Word 2003 crashed, taking XP with it. When I rebooted, Office needed to be reactivated by phone, then it forced me to download a 27mb converter utility, all so I could read some styled text.

2. The "Writing to Console" options are not synonymous. "$a" by itself writes the value of $a to the output pipeline, "write-host" draws it into the console's buffer.

A subtle difference but can be quite important when writing a function. Consider this:

function twice ($a) {

$b=$a*2

"twice $a is $b" # write to console like in the cheatsheet

return $b

}

$c = twice 4

$c

Wednesday, January 24, 2007 10:33 AM by Adrian Milliner

# re: PowerShell Cheat Sheet

How do I open the document?

Wednesday, January 24, 2007 11:54 AM by Sri

# re: PowerShell Cheat Sheet

For those that want to open this file you will need either Office 2007 or the Compatibility Pack

http://www.microsoft.com/downloads/details.aspx?FamilyId=941B3470-3AE9-4AEE-8F43-C6BB74CD1466&displaylang=en

Wednesday, January 24, 2007 12:08 PM by Luke

# re: PowerShell Cheat Sheet

Sorry but I think it is pretty crazy to post a document in a format used by hardly anyone.

Here is a Word 97-2003 compatible version of the document

http://homepage.ntlworld.com/deadmonkey/ps/CheatSheetV1.00.doc

Wednesday, January 24, 2007 1:31 PM by MP

# re: PowerShell Cheat Sheet

Can someone throw up a PDF format of the cheat sheet.  I tried running it in my Word 2003 after installing the compatibility pack, it was all gibberish.

Thanks:)

Wednesday, January 24, 2007 2:14 PM by SA

# re: PowerShell Cheat Sheet

Thanks Ben, good cheat sheet. Kirk

Wednesday, January 24, 2007 3:46 PM by Kirk Jackson

# re: PowerShell Cheat Sheet

Here i have converted it to PDF for those interested.

http://karlprosser.edify.us/publicdownloads/benspowershellcheatsheet.pdf

Wednesday, January 24, 2007 5:03 PM by Karl Prosser

# re: PowerShell Cheat Sheet

Wednesday, January 24, 2007 6:34 PM by MP

# re: PowerShell Cheat Sheet

Wednesday, January 24, 2007 6:34 PM by Glenn

# Powershell cheat sheet

The Windows Powershell Blog has posted a two page cheat sheet for Powershell that was put together by Ben Pearce. It&#8217;s very handy, I&#8217;ve already printed this out &amp; sent it to the rest of the development team at work....

Wednesday, January 24, 2007 7:12 PM by Development on a Shoestring

# re: PowerShell Cheat Sheet

For some reason I think Jeffery didn't meant to trouble us, it was as simple as save doc file and upload it.With so many salty comments I'm sure it won't repeat

Wednesday, January 24, 2007 8:38 PM by techstarts.spaces.live.com

# re: PowerShell Cheat Sheet

yeah the docx format was poor form, and just created needless negativity

apart from that, nice cheat sheet and thanks to those who converted it to more common formats

Wednesday, January 24, 2007 10:14 PM by SJB

# re: PowerShell Cheat Sheet

Nice cheat sheet. Just try to avoid using a bleeding-edge data format next time.

Thursday, January 25, 2007 3:45 AM by Cronan

# re: PowerShell Cheat Sheet

Hey Guys

Apologies for the confusion in providing a docx file.  Completeley thoughtless on my part, and thanks to Jeff for rectifying this.  A lesson now learnt :)

Cheers

Ben

Thursday, January 25, 2007 4:15 AM by benp

# PowerShell Cheat Sheet

Here&#39;s a must-have cheat sheet for PowerShell. Jeffrey Snover has put together an excellent doc that

Thursday, January 25, 2007 4:52 PM by Scott Forsyth's WebLog

# re: PowerShell Cheat Sheet

I was able to open the .docx file just fine in Word 2003 SP2.

Thanks, this is great!

Thursday, January 25, 2007 8:32 PM by Jeremy

# PowerShell Cheat Sheet – Now in XPS

I originally published Ben Pearce's PowerShell Cheat sheet in Word 2007 format . Given that I posted

Wednesday, January 31, 2007 12:01 AM by Windows PowerShell

# Cosas Interesantes 31/01/2007

Hoy en cosas interesantes: Expression Blend Beta2 y Design Beta 1, Referencia rapida de powershell, Entrevista

Wednesday, January 31, 2007 2:02 AM by Be Geek My Friend

# PowerShell for Vista has shipped!

Wednesday, January 31, 2007 7:51 AM by .NET (Never Explain Twice...or something like that)

# re: PowerShell Cheat Sheet

I posted another PowerShell cheat sheet a while ago as well, that has a lot of commands listed with equivalents in the old shell and the new shell.. I find it useful.

http://blog.stevex.net/index.php/powershell-cheatsheet/

No XPS available, sorry.  :)

Wednesday, January 31, 2007 7:53 AM by Steve Tibbett

# Developers Cheat Sheets

Developers Cheat Sheets

Friday, February 09, 2007 10:29 AM by Bite my bytes

# re: PowerShell Cheat Sheet

I have stumbled across an apparent bug in powershell (or shoddy documentation).

I am working on some scripts to copy and append/rename files based on the current date-time after moving to a backup location however when working with the get-date command I was confused over the output.

The help file for get-date, 'get-help get-date -full', indicates that I should be able to display the month in two digit numerical format (06) using 'get-date -uformat %M' I get the minutes and when using the lower case 'm' which should be minutes I get the two-digit month.

I have confirmed this behavior running powershell on Windows XP SP2 x86 and Windows 2003 SP1 x64.

Thursday, February 15, 2007 5:29 PM by Zamo

# A Cheat sheet of Cheat sheets

Here is a list of cheat sheets for the Windows and .NET platform that I frequently use and I think are of great interest. Visual Studio 2005 Keyboard Shortcut References Visual C# 2005 - PDF grayscal...

Monday, February 26, 2007 9:33 AM by Wictor Wilen

# re: PowerShell Cheat Sheet

I guess , we should have this in the doc too.

Lets say, we want to access property of object or do assing  some value to it.

it is possible to do

someObject | %{ $_.someProperty = someValue}

Just an idea :-)

Friday, March 16, 2007 1:49 PM by Mehfuz Hossain

# NetCmdlets Cheat Sheet (PowerShell)

NetCmdlets Cheat Sheet (PowerShell)

Friday, August 31, 2007 6:09 PM by textBox1

# re: PowerShell Cheat Sheet

Microsoft guys trying to force their formats upon the world as usual. =[

Wednesday, January 09, 2008 2:06 PM by Yeorwned

# re: PowerShell Cheat Sheet

What the hell !?!?!?!?!?!?!?!?!?

Um ... hello?  How am I supposed to view this doc(x)?

Could you, maybe, post in a format that businesses actually use?  Why don't you just post a Stuff-It compressed archive.

Seriously.

Jerk.

Monday, February 25, 2008 9:46 PM by remi

# re: PowerShell Cheat Sheet

> Jerk.

Are you calling me a name or is that your signature?

Jeffrey Snover [MSFT]

Windows Management Partner Architect

Visit the Windows PowerShell Team blog at:    http://blogs.msdn.com/PowerShell

Visit the Windows PowerShell ScriptCenter at:  http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

Monday, February 25, 2008 10:07 PM by PowerShellTeam

# re: PowerShell Cheat Sheet

I've never heard such wingeing

Monday, March 24, 2008 9:57 PM by Sorcha

# re: PowerShell Cheat Sheet

Wow. You'd think people wanting to download a Powershell cheat sheet would be early adopters or at least open to the possibility of early adoption or compatibility with new formats. Geez...

Sunday, March 15, 2009 7:37 AM by Wayne Hoggett

# re: PowerShell Cheat Sheet

I want to thank you for posting at all, you think someone would think of that.

Thank you,

from some of us that enjoy the bleeding edge.

Thursday, June 18, 2009 1:41 PM by Randy Baxter

# re: PowerShell Cheat Sheet

I would like to download but at best I get a 0 byte file on WIn7 or Vista.Is this supposed to still work? Thanks, Dave

Wednesday, June 24, 2009 5:44 PM by Dave

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker