mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-13 22:38:46 +02:00
Added write-centered.ps1
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Writes text as headline
|
||||
Writes a headline
|
||||
.DESCRIPTION
|
||||
This PowerShell script writes the given text as a headline.
|
||||
.PARAMETER text
|
||||
Specifies the headline text
|
||||
Specifies the text to write
|
||||
.EXAMPLE
|
||||
PS> ./write-headline.ps1 "Hello World"
|
||||
|
||||
@ -17,8 +17,9 @@
|
||||
#>
|
||||
|
||||
param([string]$text = "")
|
||||
|
||||
try {
|
||||
if ($text -eq "") { $text = Read-Host "Enter the headline text" }
|
||||
if ($text -eq "") { $text = Read-Host "Enter the text to write" }
|
||||
|
||||
Write-Host "`n* $text *" -foregroundColor green
|
||||
[int]$len = $text.Length
|
||||
|
Reference in New Issue
Block a user