# encoding: ascii
# api: powershell
# title: Draw
# description: Turns a here-string with characters, spaces, and new lines into an image with blocks of color, spaces, and new lines.
# version: 0.1
# type: function
# author: Nathan Estell
# license: CC0
# x-poshcode-id: 6383
# x-archived: 2016-06-17T09:15:30
# x-published: 2016-06-14T18:08:00
#
#
function Draw
{
param
(
$text=@"
q   
 q  
  q 
   q
"@
)
$CharArray=$text.tochararray()
foreach ($character in $CharArray)
{
if ($character -match "\S" )
{
write-host " " -BackgroundColor "Green" -NoNewLine
#"Character"
}
if ($character -match "[^\S\r\n]")
{
write-host " " -BackgroundColor "Black" -NoNewLine
#"Space"
}
if ($character -match "\n" )
{
write-host "" 
#"New Line"
}
}
}
