How to Create a Windows PowerShell Host Application

Windows PowerShell operates within a hosting application (with the default hosting application being powershell.exe) that exposes a command line to the user. To communicate with Windows PowerShell, the hosting application uses its Main function for primary access to the Windows PowerShell runtime through a host interface. In turn, the host interface is accessible to commands through the $Host variable, and is accessible to cmdlets that derive from the PSCmdlet base class through their Host property.

Be aware that a hosting application can run in a separate process or even on a separate computer from Windows PowerShell. The default hosting application (powershell.exe), however, always runs in a separate process on the same computer as the Windows PowerShell runtime.

noteNote:
For more information about how hosting applications and hosts works with other Windows PowerShell components, see How Windows PowerShell Works.

In This Section

 

Topic Definition

Creating Applications That Use the Default Host

This section describes how to write hosting applications that manipulate a runspace in various ways, using the default host.

Creating Applications That Use a Custom Host

This section describes how to write hosting applications that implement their own custom host using the PSHost class and its related user interfaces.

See Also

Mots clés :


Page view tracker