Welcome to MSDN Blogs Sign in | Join | Help

New and Improved Start-Demo

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

Enjoy!

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

Published Sunday, June 03, 2007 8:36 PM by PowerShellTeam

Attachment(s): start-demo.ps1

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: New and Improved Start-Demo

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! ;-)

tia

Sunday, June 03, 2007 6:19 PM by Maximilian Hänel

# leedesmond’s blog » Blog Archive » Start-Demo - New & Improved

# re: New and Improved Start-Demo

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

Monday, June 04, 2007 2:56 AM by Richard Siddaway

# re: New and Improved Start-Demo

For Maximilian Hanel - Check this post http://blogs.msdn.com/powershell/archive/2007/03/07/invoke-expression.aspx for an explanation of that line of code.  You're correct in that it's related to the variable scope.

Monday, June 04, 2007 1:39 PM by JR

# Presentation and demo material - An Introduction to PowerShell

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

Sunday, December 16, 2007 8:10 PM by Chris Green's Blah(g)

# re: New and Improved Start-Demo

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)

Wednesday, October 29, 2008 2:24 PM by David Moravec

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker