< Back

Get-Cowsay

Mon Jan 13, 2020 5:41 am

NAME Get-Cowsay



SYNOPSIS

This cmdlet generates ASCII pictures of a cow with a message.





SYNTAX

Get-Cowsay [-mode <String>] [-list <SwitchParameter>] [-figlet <SwitchParameter>] [-eyes <String>] [-tongue

<String>] [-cowfile <String>] [-wrapcolumn <Int32>] [-think <SwitchParameter>] [[-message] <String>]

[<CommonParameters>]





DESCRIPTION







PARAMETERS

-mode <String>

Preset faces to select for the cow.



Will override any eyes or tongue settings set manually.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-list [<SwitchParameter>]

List available cow files in module cows folder.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-figlet [<SwitchParameter>]

Enable figlet mode for your message.



Must escape special characters in order to work properly.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-eyes <String>

Eyes for the cow, cannot be more than 2 characters long. If more than 2 characters long, will be cut off.



Overridden by the mode parameter.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-tongue <String>

Tongue for the cow, cannot be more than 2 characters long. If more than 2 characters long, will be cut off.



Overridden by the mode parameter.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-cowfile <String>

Specify either a specific cowfile found under the Module cows folder or a specific cowfile in a specific

directory.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-wrapcolumn <Int32>

Change the width of the speech bubble. Cannot be less than 10 characters or more than 76 characters.



Required? false

Position? named

Default value 40

Accept pipeline input? false

Accept wildcard characters? false



-think [<SwitchParameter>]

Make the cow think.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-message <String>

What the cow says.



Required? false

Position? 0

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

String







OUTPUTS

String







NOTES









-------------------------- Example 1 --------------------------



$message = 'Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in

Liberty, and dedicated to the proposition that all men are created equal.'



Get-Cowsay -message $message



If you only speicfy the message parameter you will get a cow with a speech bubble 40 characters wide.







# _______________________________________

# / Four score and seven years ago our \\

# | fathers brought forth on this |

# | continent, a new nation, conceived in |

# | Liberty, and dedicated to the |

# | proposition that all men are created |

# \\ equal. /

# ---------------------------------------

#

# \\ ^__^

# \\ (oo)\\_______

# (__)\\ )\\/\\

# ||----w |

# || ||



-------------------------- Example 2 --------------------------



$message = 'Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in

Liberty, and dedicated to the proposition that all men are created equal.'



Get-Cowsay -wrapcolumn 20 -message $message



If you call the wrapcolumn paramter with a value less than 40 along with the message parameter you will get a cow

with a speech bubble n characters in width.







# ___________________

# / Four score and \\

# | seven years ago |

# | our fathers |

# | brought forth on |

# | this continent, a |

# | new nation, |

# | conceived in |

# | Liberty, and |

# | dedicated to the |

# | proposition that |

# | all men are |

# \\ created equal. /

# -------------------

#

# \\ ^__^

# \\ (oo)\\_______

# (__)\\ )\\/\\

# ||----w |

# || ||



-------------------------- Example 3 --------------------------



$message = 'Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in

Liberty, and dedicated to the proposition that all men are created equal.'



Get-Cowsay -wrapcolumn 60 -message $message



If you call the wrapcolumn paramter with a value greater than 40 along with the message parameter you will get a

cow with a speech bubble n characters in width.







# _____________________________________________________________

# / Four score and seven years ago our fathers brought forth on \\

# | this continent, a new nation, conceived in Liberty, and |

# | dedicated to the proposition that all men are created |

# \\ equal. /

# -------------------------------------------------------------

#

# \\ ^__^

# \\ (oo)\\_______

# (__)\\ )\\/\\

# ||----w |

# || ||



-------------------------- Example 4 --------------------------



$message = 'What was I thinking!?'



Get-Cowsay -think -message $message



If you call the think paramter along with the message parameter you will get a cow with a think bubble instead of

a speech bubble.







# _______________________

# ( What was I thinking!? )

# -----------------------

# o ^__^

# o (oo)\\_______

# (__)\\ )\\/\\

# ||----w |

# || ||



-------------------------- Example 5 --------------------------



$message = 'Resistance is Mootile!'



Get-Cowsay -mode borg -message $message



If you call the mode paramter, with a value, along with the message parameter your cows Eyes and Tongue will

change according to the mode you speicfied.







# ________________________

# < Resistance is Mootile! >

# ------------------------

# \\ ^__^

# \\ (==)\\_______

# (__)\\ )\\/\\

# ||----w |

# || ||



-------------------------- Example 6 --------------------------



$message = 'Stars in my eyes!'



Get-Cowsay -eyes ** -tongue ' U' -message $message



If you call the Eyes and/or Tongue paramter(s), with a value, along with the message parameter your cows Eyes and

Tongue will change according to the values you specified.







# ___________________

# < Stars in my eyes! >

# -------------------

# \\ ^__^

# \\ (**)\\_______

# (__)\\ )\\/\\

# U ||----w |

# || ||



-------------------------- Example 7 --------------------------



$message = 'Brrrrrrr!'



Get-Cowsay -cowfile tux -message $message



If you call the cowfile paramter, with a value, along with the message parameter you will get the ascii art

associated with that value.



To see a list of available cowfile values use Get-Cowsay -list.







# ___________

# < Brrrrrrr! >

# -----------

# \\

# \\

# .--.

# |o_o |

# |:_/ |

# // \\ \\

# (| | )

# /'\\_ _/`\\

# \\___)=(___/



-------------------------- Example 8 --------------------------



$directory = (get-location).path

$message = 'Hippity Hoppity Easter is on the way!'



Get-Cowsay -cowfile $directory\\bunny -message $message



If you call the cowfile paramter, with a full path to a cowfile, along with the message parameter you will get the

ascii art associated with that cowfile.







# _______________________________________

# < Hippity Hoppity Easter is on the way! >

# ---------------------------------------

# \\

# \\ \\

# \\ /\\

# ( )

# .( o ).



-------------------------- Example 9 --------------------------



$message = @"

_ _ _ _ _ _

| (_) | _____ | |_| |__ (_)___

| | | |/ / _ \\ | __| '_ \\| / __|

| | | < __/ | |_| | | | \\__ \\

|_|_|_|\\_\\___| \\__|_| |_|_|___/

"@



Get-Cowsay -figlet -message $message



If you call the figlet paramter you can specify a figlet for your message.



It is recommended you store your figlet in a Here-String variable and pass that variable to your message.







# __________________________________

# / _ _ _ _ _ _ \\

# | | (_) | _____ | |_| |__ (_)___ |

# | | | | |/ / _ \\ | __| '_ \\| / __| |

# | | | | < __/ | |_| | | | \\__ \\ |

# \\ |_|_|_|\\_\\___| \\__|_| |_|_|___/ /

# ----------------------------------

#

# \\ ^__^

# \\ (oo)\\_______

# (__)\\ )\\/\\

# ||----w |

# || ||



-------------------------- Example 10 --------------------------



$message = @"

. oooo o8o

.o8 ``888 ``"'

.ooooo. oooo d8b .o888oo 888 .oo. oooo .oooo.o

d88' ``88b ``888""8P 888 888P"Y88b ``888 d88( "8

888 888 888 888 888 888 888 ``"Y88b.

888 888 888 888 . 888 888 888 o. )88b

``Y8bod8P' d888b "888" o888o o888o o888o 8""888P'

"@



Get-Cowsay -figlet -message $message



If you call the figlet paramter you can specify a figlet for your message.



It is recommended you store your figlet in a Here-String variable and pass that variable to your message.



If your figlet has special characters, such as the tick(`) character, you must escape the special character as

seen in the example.







# ___________________________________________________________

# / . oooo o8o \\

# | .o8 `888 `"' |

# | .ooooo. oooo d8b .o888oo 888 .oo. oooo .oooo.o |

# | d88' `88b `888""8P 888 888P"Y88b `888 d88( "8 |

# | 888 888 888 888 888 888 888 `"Y88b. |

# | 888 888 888 888 . 888 888 888 o. )88b |

# \\ `Y8bod8P' d888b "888" o888o o888o o888o 8""888P' /

# -----------------------------------------------------------

#

# \\ ^__^

# \\ (oo)\\_______

# (__)\\ )\\/\\

# ||----w |

# || ||





RELATED LINKS

PowerShell Gallery - CowsaySharp https://www.powershellgallery.com/packages/CowsaySharp/

CodePlex Project - CowsaySharp https://cowsaysharp.codeplex.com/

GitHub Project - CowsaySharp https://github.com/terrytrent/CowsaySharp

GitHub Project - Original Cowsay https://github.com/piuccio/cowsay