header
header Register : : Login header
header
divider
menuleft
menuright
submenu
left

[August 25th, 2008] Check the home page regarding PowerShell related news from a brand new sponsor: Idera

start-demo modification
Last Post 16 Apr 2008 04:28 PM by Jaykul. 3 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
jschussUser is Offline
New Member
New Member
Posts:9
Avatar

--
14 Apr 2008 09:44 PM  

Hi All,

I'm trying to make one small addition to Jeffrey Snover's start-demo (awesome tool to demo with) to clear the screen.

Something similar to below:

{

$_.StartsWith("c")}Write-Host -NoNewLine cls

{

 

}

That way when I'm demoing PS and I can use "c" to clear the screen and keep demo at the top so everyone can see it.

Any ideas?

TIA,

Jay

marco.shawUser is Offline
Co-Community Director
Basic Member
Basic Member
Posts:188
Avatar

--
15 Apr 2008 02:42 AM  
#1: I changed the menu like so:
...
(t) Timecheck (?) Help (c) Clear
...

#2: After this part provided in the switch statement:
...
#################### QUIT
"q"
{
Write-Host -ForeGroundColor $CommentColor ""
return
}
...

I added this:

#################### CLEAR
"c"
{
cls
}

Give that a try...
Marco

*Microsoft MVP - Windows PowerShell: http://www.microsoft.com/mvp
*PowerGadgets MVP: http://www.powergadgets.com/mvp
*Blog: http://marcoshaw.blogspot.com
jschussUser is Offline
New Member
New Member
Posts:9
Avatar

--
15 Apr 2008 05:37 PM  

Thanks Marco.
I also had to add the code from "b" otherwise I was skipping a command in the demo.txt after typing "c"
     "c"
          {
            cls
                if($_i -gt 0)
                {
                    $_i --

                    while (($_i -gt 0) -and ($_lines[$($_i)].StartsWith("#")))
                    {   $_i -= 1
                    }
                }
  #$_i --
                $_PretendTyping = $false
          }

JaykulUser is Offline
New Member
New Member
Posts:31

--
16 Apr 2008 04:28 PM  
My version of Start-Demo has this ... http://powershellcentral.com/scripts/176
You guys should be contributing these mods to the script repository ;-)
You are not authorized to post a reply.

Active Forums 4.1
right
   
footer Sponsored by Quest Software • SAPIEN Technologies • ShellTools, LLC • Microsoft Windows Server 2008 footer
footer