📜 ⬆️ ⬇️

Drawing a snowman in PowerShell

Who said PowerShell must be serious? Ed Wilkinson, blog author Hey, Scripting Guy! , I definitely do not agree with this and offers to draw a snowman in PowerShell!


You can draw an ASCII image in PowerShell using the internal string (here-string). For this, ASCII graphics must be stored in a here-string as a variable. Under the cut script is a drawing for a snowman.

Script
$snowowerson = @" ________ * [________] . * * . |________| / . * | |/ * ========= * ______________ * |||||| / \ ||> || ( 0 0 ) . . ||- | | O | |||||| \ {---} / * * \====/ [~~~~~~~~~] \\// _/====||=====\_ _||-'`/ || \`'-._ * * .-` )| ; || ; '. / `--.| || | `\ | \ || |-, \ . * \ .; \/ ; |_, | `'''||` ,\ 0 /, `.__/ ||.` '. 0 .' `. * * || ` ' ' ` \ || ; . * || | . || | * @ || | @ .__.-""-.__.-"""|| ;.-"""-.__.-""-.__. || / ||'. .' || '-._ _ _ _ _.-' "@ Clear-Host $snowowerson 



In fact, the use of the inner string is not limited to such drawings.
It allows you to enter information and format the output, without worrying about the rules of quotes, which simplifies working with text in PowerShell.
Useful information about here-string and working with text in PowerShell in the Vadims Podāns blog .

')

Source: https://habr.com/ru/post/161805/


All Articles