Improved Start-Demo Script

Improved Start-Demo Script

  • Comments 7

I showed my Start-Demo script to my wife and she wasn't impressed J. She gave me some good ideas about how to make it better so I've updated the script and attached it to this entry. The changes are:

  1. If you typed anything other than <CR>, it added that text to the end of the command that would have been executed and ended up looking very strange. The script now:
    1. Adds a couple of space between the end of the command to be typed and the INPUT field.
    2. Changes the Foreground color to RED during input.
  2. Adds a (B) Backup command which allows you to backup the demo one command at a time.

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: start-demo.ps1
Leave a Comment
  • Please add 7 and 1 and type the answer here:
  • Post
  • so.... when's your wife going to start writing some of these blogs :P

  • During my webcast on 5/3/2007 I used jeffrey's start-demo script to run my powershell demos. Lot of folks

  • PS C:\temp>.\start-demo.ps1 .\someotherdemo.txt

    Get-Content : Cannot find path 'C:\temp\demo.txt' because it does not exist.

    At C:\temp\start-demo.ps1:6 char:24

    +   $_lines = Get-Content  <<<< $file

    <Demo [.\demo.txt] Started>

    <Demo Complete 0 Minutes and 0 Seconds>

    03.06.2007 14:47:00

    Apparently it does not accept the command line parameter to take another file as input. Did I miss something important?

    Thanks Jeffrey!

    (Feedback: the old Start-Demo.ps1 did not call Start-Demo at the end of the script hence did not work as expected for those who like to call it on the fly instead of loading from profile)

  • I most be doing something wrong or don't understand how to run the cmdlet.  First, I have to set the function (can't run it from the ps> as an *.ps1) then I can do anything else except executing the cmdlet. What are the requierement to run the cmdlet?

  • A while ago I wrote a script START-DEMO which I use to give demos (You can get the latest/greatest copy

  • Does each command in the demo file have to be on a separate line?  I tried with the following in demo.txt, but it leads to errors:

    "starting"

    1, 2, 3 | foreach {

     $_

    }

    "done"

  • Welcome to CTP3! There are just an amazing amount of really important features in V2 but the one I want

Page 1 of 1 (7 items)