New and Improved Start-Demo

New and Improved Start-Demo

  • Comments 8

Attached is a new and improved Start-Demo script. Here is a brief list of the differences:

  • Fix bug for demo files that have a single line
  • Intro text explains that this is a REAL demo
  • Cleaned up HELP and added some usage notes
  • Now emulates TYPING by introducing a random pause between key output
    • You can control the pause interval
    • Entering a key during the command typing will cause it to cancel the pauses
    • The command to be entered is displayed on the window title before the typing starts so you can see what is coming.
  • Colors are control via variables (so you can easily change them for your environment)
  • I added a few more comments
  • Timecheck now tells you where you are in the demo: You are at line 10 of 29


Jeffrey Snover [MSFT]
Windows Management Partner Architect
Visit the Windows PowerShell Team blog at:
Visit the Windows PowerShell ScriptCenter at:

Attachment: start-demo.ps1
Leave a Comment
  • Please add 5 and 1 and type the answer here:
  • Post
  • Would you like to comment the following line:

    Invoke-Expression $(".{" + $_lines[$_i] + "}| out-host")

    Why not just writing:

    Invoke-Expression $_lines[$_i]

    It guess it has something to do with output formatting so you 'split' the output of each command by wrapping it in a separate scope so it gets its own formatting applied. But I'm not entirely sure what's going on here, especially the surrounding $() confuses me.

    Oh, nice script by the way! ;-)


  • PingBack from

  • I've used the older versions in a number of demos and they've been really useful.  I like the idea of being able to preview the commands - very useful.  Thanks

  • For Maximilian Hanel - Check this post for an explanation of that line of code.  You're correct in that it's related to the variable scope.

  • Thank you to those of you who attended the Powershell session at the December 2007 Premier Briefing event

  • Hi, thanks for superb script. I am using it a lot and it's my favourite one :)

    I only changed one small thing. Because it leaves title unchanged after the end of presentation (with time and command) I added  few lines of code to the begin ($originalWinTitle = $Host.UI.RawUI.WindowTitle) and the end/q ($Host.UI.RawUI.WindowTitle = $originalWinTitle)

  • I have isntalled powershell on 3.0 on WSS 3.0, but I cannot use any WSS 3.0 that is availble with stsadm. Do I need to do something more after PowerShell 2.0 installation?

  • This demo script is great, thanks

    Please browse for sharepoint 2010 features:

Page 1 of 1 (8 items)