This blog has moved to http://ThePowerShellGuy.com
Greetings /\/\o\/\/
MSH has a function Clear-host (alias CLS) for this,
only this one is a bit more colorfull ;-)
I think I had one on my Atari, that did some more modes,
like Horizontal - diagonal - square etc.
that's where the Mode param is for, also the speed and Colors could be configurable, but at second tought I stop here, leaving it parked for a while, but I'm sure I will come into a situation when I realy need them sometime in the future, so then I can quickly make those additions to the function and will post them to the blog also, but I don't know exactly when that will happen, till then feel free to let your own wipe-screen fantasies go ;-)
gr /\/\o\/\/
PS. if you think of a nice one feel free to leave it in a Comment.
#Wipe-Screen.msh
# Wipes your screen clear
#/\/\o\/\/ 2005
function Wipe-Screen{
Param ([int] $Mode = 1)
# Get some info about the window
$raw = $host.ui.rawUI
$WS = $raw.WindowSize
$pos = $raw.windowposition
# lower the curtain
$fgc = [system.consolecolor]"Gray"
$bgc = [system.consolecolor]"red"
$row = $host.ui.rawui.NewBufferCellArray($("_" * $WS.Width),$fgc,$bgc)
for($i ; $i -lt $WS.Height ; $i++ ) {
sleep -m 5
$host.ui.rawui.SetBufferContents($pos,$row)
$pos.y = $pos.y +1
}
# Raise it again
$bgc = [system.consolecolor]"Black"
$row = $host.ui.rawui.NewBufferCellArray($(" " * $WS.Width),$fgc,$bgc)
$i = $WS.Height + 1
for($i ; $i -gt 0 ; $i-- ) {
sleep -m 5
$host.ui.rawui.SetBufferContents($pos,$row)
$pos.y = $pos.y -1
}
# Cheat a little bit
cls
}
Set-Alias WS Wipe-Screen