PowerShell Cheat Sheet

PowerShell Cheat Sheet

  • Comments 42

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

Attachment: Cheat Sheet V1.00.docx
Leave a Comment
  • Please add 1 and 4 and type the answer here:
  • Post
  • For those of use running Office 2003 (not 2007), could you post it under a more usable format?

  • 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

  • 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?

  • Any formats < Office2007 at all ???

  • 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.

  • 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\/\/

  • 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

  • How do I open the document?

  • 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

  • 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

  • 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:)

  • Thanks Ben, good cheat sheet. Kirk

  • Here i have converted it to PDF for those interested.

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

  • PDF version as requested -

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

    Courtesy of PDFCreator (http://sourceforge.net/projects/pdfcreator/)

  • I've got a PDF version if anyone wants it: http://blog.slaven.net.au/archives/2007/01/25/powershell-cheat-sheet/

Page 1 of 3 (42 items) 123