Chapter 2. PowerShell hosts

 

This chapter covers

  • The purpose of PowerShell hosts
  • The PowerShell console and ISE hosts
  • The differences between 64-bit and 32-bit hosts
  • PowerShell transcripts

PowerShell can be confusing to use because it behaves differently in different situations. Here’s an example from PowerShell v2: When you run the Read-Host command in the PowerShell.exe console, it behaves differently than if you run that same command in the PowerShell Integrated Scripting Editor (ISE). The reason you encounter these differences has to do with the fact that you don’t interact directly with PowerShell. Instead, you give commands to the PowerShell engine by means of a host. It’s up to the host to determine how to interact with the Power-Shell engine.

Note

The difference in the response of Read-Host between the console and the ISE has been eliminated in PowerShell v3.

2.1. 32-bit vs. 64-bit, and administrator vs. not

2.2. The console

2.3. The PowerShell ISE

2.4. Command history buffer vs. PowerShell’s history

2.5. Transcripts

2.6. Summary