ps1.soapyfrog.com

doing inappropriate things with powershell

Pages

  • About
  • Downloads
  • Archives

Search

Popular Posts

  • Grrr 1.1 and Big Invaders
  • Space Invaders
  • Convert images to text (ASCII art)
  • Cmdlet clashes
  • Console screen grabs in html

Recent Posts

  • Grrr source code, including Invaders
  • Google going down the pan
  • Cmdlet clashes
  • Grrr 1.1 and Big Invaders
  • Grrr, Cmdlets and PSInvaders revival

Categories

  • Announce (7)
  • Cmdlets (2)
  • Cool (16)
  • Grrr (6)
  • Hint (2)
  • Invaders (5)
  • Odd (2)
  • PowerShell (27)
  • Quiz (3)
  • Rant (7)
  • Uncategorized (1)
  • Utility (5)

Months

  • August 2007 (1)
  • April 2007 (1)
  • March 2007 (1)
  • February 2007 (3)
  • January 2007 (25)
  • December 2006 (1)

Bookmarks

  • Blogroll
    • $script Fanatics
    • blog.soapyfrog.com
    • Brian Long
    • Lee Holmes
    • Nik Crabtree
    • PowerShell-Scripting (French)
    • Richy Rich
    • The PowerShell Guy
    • Windows PowerShell
  • Links
    • Carbon-neutral web hosting!

Meta

  • Log in
  • Posts RSS
  • Comments RSS
  • Valid XHTML
  • Valid CSS
« Alternate Data Streams
Running pipelines in the background »
 

Banners

19 Jan 2007 02:37 pm// Cool, PowerShell, Utility    

In the old days, when you printed something out, you’d have to wander down to the print room and find your output in a stack of fanfold with the job name printed as a large banner on the top. I miss those days so I wrote a banner script to do this:

banner screenshot

It’s a script, so execute it directly. It takes a string (or array of strings) as the first argument and two optional parameters, -fg char to set the foreground character and -bg char for the background character. The defaults are a solid block and a space. For example:

PS> banner "hello","world" -fg "/"
/   / ///// /     /      ///
/   / /     /     /     /   /
///// ///   /     /     /   /
/   / /     /     /     /   /
/   / ///// ///// /////  ///

/   /  ///  ////  /     ////
/   / /   / /   / /     /   /
/ / / /   / ////  /     /   /
// // /   / /   / /     /   /
/   /  ///  /   / ///// ////

PS>

You can download the script here: banner.ps1.

Don’t copy/paste this - save it directly from the above link. It contains formatted text that may get corrupted.

Enjoy!

[Update] The script will also take input from the pipeline so you can do things like:

[enum]::getnames([consolecolor]) | where { $_ -notlike “dark*”} | banner -fg “#”

to get this:

####  #      ###   ###  #   #
#   # #     #   # #   # #  #
####  #     ##### #     ###
#   # #     #   # #   # #  #
####  ##### #   #  ###  #   #                                                                             

 ###  ####   ###  #   #
#     #   # #   #  # #
#  ## ####  #####   #
#   # #   # #   #   #
 ###  #   # #   #   #                                                                                     

####  #     #   # #####
#   # #     #   # #
####  #     #   # ###
#   # #     #   # #
####  #####  ###  #####                                                                                   

 ###  ####  ##### ##### #   #
#     #   # #     #     ##  #
#  ## ####  ###   ###   # # #
#   # #   # #     #     #  ##
 ###  #   # ##### ##### #   #                                                                             

 ###  #   #  ###  #   #
#   #  # #  #   # ##  #
#       #   ##### # # #
#   #   #   #   # #  ##
 ###    #   #   # #   #                                                                                   

####  ##### ####
#   # #     #   #
####  ###   #   #
#   # #     #   #
#   # ##### ####                                                                                          

#   #  ###   ###  ##### #   # #####  ###
## ## #   # #     #     ##  #   #   #   #
# # # ##### #  ## ###   # # #   #   #####
#   # #   # #   # #     #  ##   #   #   #
#   # #   #  ###  ##### #   #   #   #   #                                                                 

#   # ##### #     #      ###  #   #
 # #  #     #     #     #   # #   #
  #   ###   #     #     #   # # # #
  #   #     #     #     #   # ## ##
  #   ##### ##### #####  ###  #   #                                                                       

#   # #   #  ###  ##### #####
#   # #   #   #     #   #
# # # #####   #     #   ###
## ## #   #   #     #   #
#   # #   #  ###    #   #####                                                                             

Comments are closed.

Copyright © 2006-2008 Adrian Milliner

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 License.