external help file | Module Name | online version | schema |
---|---|---|---|
PSScriptTools-help.xml |
PSScriptTools |
2.0.0 |
Create a text border around a string.
Add-Border [-Text] <String> [-Character <String>] [-InsertBlanks] [-Tab <Int32>] [<CommonParameters>]
Add-Border [-TextBlock] <String[]> [-Character <String>] [-InsertBlanks] [-Tab <Int32>] [<CommonParameters>]
This command will create a character or text based border around a line of text. You might use this to create a formatted text report or to improve the display of information to the screen.
PS C:\> add-border "PowerShell Wins!"
********************
* PowerShell Wins! *
********************
PS C:\> add-border "PowerShell Wins!" -tab 1
********************
* PowerShell Wins! *
********************
Note that this EXAMPLE may not format properly in the console.
PS C:\> add-border "PowerShell Wins!" -character "-" -insertBlanks
--------------------
- -
- PowerShell Wins! -
- -
--------------------
PS C:\> add-border -textblock (get-service win* | out-string).trim()
**********************************************************************
* Status Name DisplayName *
* ------ ---- ----------- *
* Stopped WinDefend Windows Defender Antivirus Service *
* Running WinHttpAutoProx... WinHTTP Web Proxy Auto-Discovery Se... *
* Running Winmgmt Windows Management Instrumentation *
* Stopped WinRM Windows Remote Management (WS-Manag... *
**********************************************************************
Create a border around the output of a Get-Service command.
A single line of text that will be wrapped in a border.
Type: String
Parameter Sets: single
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
A multi-line block of text. You might want to trim blank lines from the beginning, end or both.
Type: String[]
Parameter Sets: block
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The character to use for the border. It must be a single character.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: *
Accept pipeline input: False
Accept wildcard characters: False
Insert blank lines before and after the text. The default behavior is to create a border box close to the text. See examples.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
Insert X number of tabs.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/