Learn about Windows PowerShell
Summary: View Windows PowerShell console host information.
How can I easily find information about the Windows PowerShell console host?
Use the Get-Host cmdlet, and select the RawUI property from the InterhostUserInterface object:
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.
@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.