PowerTip: View PowerShell Console Host Information

Summary: View Windows PowerShell console host information.

Hey, Scripting Guy! Question How can I easily find information about the Windows PowerShell console host?

Hey, Scripting Guy! Answer Use the Get-Host cmdlet, and select the RawUI property from the InterhostUserInterface object:


Comments (2)

  1. There is also a built-in $host variable that contains the same information.

    So $host.ui.rawUI is another way to access that data.

    From the help:

    The $host automatic variable contains the same object that Get-Host

    returns, and you can use it in the same way.  Similarly, the

    $PSCulture and $PSUICulture automatic variables contain the same

    objects that the CurrentCulture and CurrentUICulture properties of the

    host object contain. You can use these features interchangeably.

  2. Ed Wilson says:

    @G. Samuel Hayes you are absolutely correct. Personally, I kind of go between the two methods. But most of the time, I probably actually do $host. Thank for sharing.