Writes customized output to a host. (Write-Host)

   

# NAME
Write-Host

# SYNOPSIS
Writes customized output to a host.

# SYNTAX
Write-Host [[-Object] <Object>] [-BackgroundColor {Black | DarkBlue | DarkGreen | DarkCyan | DarkRed | DarkMagenta | DarkYellow | Gray | DarkGray | Blue | Green | Cyan | Red | Magenta | Yellow | White}] [-ForegroundColor {Black | DarkBlue | DarkGreen | DarkCyan | DarkRed | DarkMagenta | DarkYellow | Gray | DarkGray | Blue | Green | Cyan | Red | Magenta | Yellow | White}] [-NoNewline] [-Separator <Object>] [<CommonParameters>]

# DESCRIPTION
The Write-Host cmdlet customizes output. You can specify the color of text by using the ForegroundColor parameter, and you can specify the background color by using the BackgroundColor parameter. The Separator parameter lets you specify a string to use to separate displayed objects. The particular result depends on the program that is hosting Windows PowerShell.

# PARAMETERS
-BackgroundColor <ConsoleColor>
Specifies the background color. There is no default.

Required? false
Position? named
Default value None
Accept pipeline input? false
Accept wildcard characters? false

-ForegroundColor <ConsoleColor>
Specifies the text color. There is no default.

Required? false
Position? named
Default value None
Accept pipeline input? false
Accept wildcard characters? false

-NoNewline [<SwitchParameter>]
Specifies that the content displayed in the console does not end with a newline character.

Required? false
Position? named
Default value None
Accept pipeline input? false
Accept wildcard characters? false

-Object <Object>
Objects to display in the console.

Required? false
Position? 1
Default value None
Accept pipeline input? true (ByValue)
Accept wildcard characters? false

-Separator <Object>
String to the output between objects displayed on the console.

Required? false
Position? named
Default value None
Accept pipeline input? false
Accept wildcard characters? false

<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

# INPUTS
System.Object
You can pipe objects to be written to the host.

# OUTPUTS
None
Write-Host sends the objects to the host. It does not return any objects. However, the host might display the objects that Write-Host sends to it.

# NOTES

# EXAMPLE 1

C:\PS>write-host "no newline test " -nonewline

no newline test C:\PS>

# Description
-----------
This command displays the input to the console, but because of the NoNewline parameter, the output is followed directly by the prompt.

# EXAMPLE 2

C:\PS>write-host (2,4,6,8,10,12) -Separator ", +2= "

2, +2= 4, +2= 6, +2= 8, +2= 10, +2= 12

# Description
-----------
This command displays the even numbers from 2 through 12. The Separator parameter is used to add the string , +2= (comma, space, +, 2, =, space).

# EXAMPLE 3

C:\PS>write-host (2,4,6,8,10,12) -Separator ", -> " -foregroundcolor DarkGreen -backgroundcolor white

# Description
-----------
This command displays the even numbers from 2 through 12. It uses the ForegroundColor parameter to output dark green text and the BackgroundColor parameter to display a white background.

# EXAMPLE 4

C:\PS>write-host "Red on white text." -ForegroundColor red -BackgroundColor white

Red on white text.

# Description
-----------
This command displays the string "Red on white text." The text is red, as defined by the ForegroundColor parameter. The background is white, as defined by the BackgroundColor parameter.

RELATED LINKS
Online version: http://go.microsoft.com/fwlink/?LinkID=113426
Write-Verbose
Write-Error
Write-Progress
Write-Debug
Write-Output
Write-Warning
Out-Host

C:\Windows>powershell get-help Write-Progress -full

ColorConsole [Version 1.7.1000] PowerShell 2.0-Export
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2014 Microsoft Corporation.

OS: Windows-10 / Windows-8.1 & 8 / Windows-7 & Vista / Windows Server 2008-2016
»»»» ColorConsole



 


... Home  
... Impressum
... ColorConsole

... CMD
... Netsh-XP
... Netsh-7
... Netsh-Vista
... Powershell





;-)









Download the Windows 7 Starter, Home (Basic Premium), Professional und Ultimate!

... facebook.de
0.077
Kann man den USB-Laufwerksbuchstabe bei Windows-7 ändern?  / Can i Enter/use the IP address in Q-Dir address-bar on Windows-8?  / Wie kann ich mich bei www.facebook.de registrieren bzw. anmelden?  / Disable auto expand folder in Windows 7 Explorer?  / Run Command Prompt and activate Opacity Mode on Windows 10!  / Microsoft Office 2013 downloaden und Testversionen verlängern!  / Bei Windows 7 funktionieren die Lautsprecher nicht, es kommt kein Ton?  / Computer per USB verbinden, oder ein Netzwerk realisieren, aber wie?  / Ich denke, was noch fehlt, ist die Auswahl-umkehren Option?  / How to set custom color for windows border in Win-8 and 8.1?  / Den Dateimanager Titel in der Titelleiste ändern?  / How to view and use the fonts without installing the windows font file?  /