Banners

Home  >>  Cool  >>  Banners

Banners

On January 19, 2007, Posted by , In Cool,PowerShell,Utility, With Comments Off on Banners

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.