/\/\o\/\/ PowerShelled

This blog has moved to http://ThePowerShellGuy.com Greetings /\/\o\/\/
$AtomFeed = ("Atom.xml")
$PreviousItems = (" getting an Inputbox in MOnad "," Get AD info into a nested HashTable from MSH "," Logging your MSH session "," MSH get-dateFormat function "," Working with a Path in MSH "," MSH MSN Instant messenger project (broken off) "," Running (Un-block) a downloaded script in MSH "," Timing the loading of your profile in MSH "," Tuning MSH in your Profile "," Einstein 2 + subtopic. "," ")

Saturday, December 03, 2005

 


Let monad "drop" some chars



this script is not very usefull, it's Just to annoy someone,
when you start this script, Monad will start dropping letters at random, after every command, messing up the output.

It keeps pretending it's the "normal" shell, by getting the input from the user and starting it with invoke-command.

also it will "hide" it's starting line so that you can invoke it without being seen (on the console that is).

if your "target" call's for help let him press Ctrl-C, and MSH will act normal again.

gr /\/\o\/\/

# DropChars.msh
# just lets MSH "drop" some characters at random
# and hides startupline for more suprise
# /\/\o\/\/ 2005

$raw = $host.ui.rawUI
$WS = $raw.WindowSize

# Remove startup line
$pos = $host.ui.rawui.CursorPosition 
$pos.y--
$fgc = $host.ui.rawUI.ForegroundColor
$bgc = $host.ui.rawUI.BackgroundColor
$row = $host.ui.rawui.NewBufferCellArray($(" " * $WS.Width),$fgc,$bgc)
$host.ui.rawui.SetBufferContents($pos,$row)
$host.ui.rawui.CursorPosition = $pos
$times = 0

while ($true) {
  $pos  = $raw.windowposition
  for ($time  = 0 ; $time -lt $Times ; $time++) {
    $r = new random
    for($i = 0 ; $i -lt $WS.Height ; $i++ ) {
      $x = $r.next($ws.width)
      $O++
      [system.console]::MoveBufferArea($x,$pos.y,1,1,$x,$pos.y + 1)  
      $pos.y = $pos.y +1
    }
  }
  write-host -no (prompt)
  $line = [console]::readline()
  if ($line.Length -gt 0 ) {invoke-command $line}
  if ($times -lt 5) {$times++}
}



Comments:
Blogger Sung Meister
Wouldn't it be also fun to change back/foreground colors of randomly inserted characters?

Or, it would be fun if you could just drop one of those invisible characters(char where fore & background colors are the same :))

Now, the latter case will be REALLY annoying :)
 
Blogger /\/\o\/\/
>Wouldn't it be also fun to change back/foreground colors of randomly inserted characters?

Yes it would ;-)

feel free to leave a script with your favorite annoyances in the Comments or on your blog ;-)

gr /\/\o\/\/
 
Post a Comment



<< Home

Archives

October 2005   November 2005   December 2005   January 2006   February 2006   March 2006   April 2006   May 2006   June 2006   July 2006   August 2006   September 2006   October 2006   November 2006   December 2006  

$Links = ("PowerShell RC1 Docs"," PowerShell RC1 X86"," PowerShell RC1 X64"," Monad GettingStarted guide"," Monad Progamming Guide"," Monad SDK"," Monad videos on Channel 9"," MSH Community Workspace"," scripts.readify.net "," MonadSource"," www.reskit.net"," PowerShell Blog"," Under The Stairs"," computerperformance powershell Home"," proudlyserving"," MSH on wikipedia"," MSHWiki Channel 9"," Keith Hill's Blog"," Precision Computing"," PowerShell for fun"," MSH Memo (Japanese)"," monadblog")

find-blog -about "PowerShell","Monad" | out-Technorati.
find-blog -contains "","" | out-Technorati.
Google
 
Web mow001.blogspot.com

This page is powered by Blogger. Isn't yours?