CmdID

CmdID / PowerShell / Cmdlets / Get

Get-Host

Gets an object that represents the current host program. PowerShell reference

From the PowerShell reference

Opens CmdID with your command, read as PowerShell. It is read in your browser and sent nowhere.

What it does

from the PowerShell reference, CC BY 4.0

Gets an object that represents the current host program. The Get-Host cmdlet gets an object that represents the program that is hosting Windows PowerShell. The default display includes the Windows PowerShell version number and the current region and language settings that the host is using, but the host object contains a wealth of information, including detailed information about the version of Windows PowerShell that is currently running and the current culture and UI culture of Windows PowerShell. You can also use this cmdlet to customize features of the host program user interface, such as the text and background colors.

Get-Host [<CommonParameters>]

Get information about the PowerShell console host

Get-HostIdentify

Resize the PowerShell window

$H = Get-Host $Win = $H.UI.RawUI.WindowSize $Win.Height = 10 $Win.Width = 10 $H.UI.RawUI.Set_WindowSize($Win)Identify

Get the PowerShell version for the host

(Get-Host).VersionIdentify

Get the current culture for the host

(Get-Host).CurrentCulture | Format-ListIdentify

Get the DateTimeFormat for the current culture

(Get-Host).CurrentCulture.DateTimeFormat | Format-ListIdentify

Get the RawUI property for the host

(Get-Host).UI.RawUIIdentify

Set the background color for the PowerShell console

(Get-Host).UI.RawUI.BackgroundColor = "Black" Clear-HostIdentify

Set the background color for error messages

$Host.PrivateData.ErrorBackgroundColor = "white"Identify

Its page in the reference: Get-Host.