Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying block of text

Tags:

powershell

I've done a bit of Googling and can't seem to find an effective method of displaying an entire block of text to the console. I would rather not use the Write-Host command on every line if I need to display a block of code. I'm trying to make an interactive script that's somewhat aesthetic. Is there an example that someone could give me?

like image 907
cloudnyn3 Avatar asked Jun 27 '16 16:06

cloudnyn3


People also ask

What does it mean to display block?

display: block means that the element is displayed as a block, as paragraphs and headers have always been. A block has some whitespace above and below it and tolerates no HTML elements next to it, except when ordered otherwise (by adding a float declaration to another element, for instance).

Why is display block used?

From all the above information, we came to know that, HTML display block property in HTML helps us to set our layout in proper structure. Those blocks in the layout can be put either vertical or horizontal direction one after another. It include elements like <div>, <section>, <form>.

What is display block and display inline?

Also, with display: inline-block , the top and bottom margins/paddings are respected, but with display: inline they are not. Compared to display: block , the major difference is that display: inline-block does not add a line-break after the element, so the element can sit next to other elements.

What is display block in CSS example?

The display property specifies if/how an element is displayed. Every HTML element has a default display value depending on what type of element it is. The default display value for most elements is block or inline . This panel contains a <div> element, which is hidden by default ( display: none ).


1 Answers

PowerShell supports multiline strings, either as here-strings:

Write-Host @"
Some text you
want to span
multiple lines.
"@

or regular strings:

Write-Host "Some text you
want to span
multiple lines."
like image 80
Ansgar Wiechers Avatar answered Sep 29 '22 09:09

Ansgar Wiechers