Creating a PowerShell profile

If you want certain PowerCLI commands to be executed every time you start a PowerCLI session, you can put these commands in a PowerShell profile. The commands in a PowerShell profile will be executed every time you start a new PowerCLI session. There are six PowerShell profiles, two specific for the PowerShell console, two specific for the PowerShell Integrated Scripting Environment (ISE), and two used by both the PowerShell console and the PowerShell ISE. The PowerShell console and the PowerShell ISE have their own profiles for:

  • All users, current host
  • Current user, current host

The two profiles used by both the PowerShell console and the PowerShell ISE are:

  • All users, all hosts
  • Current user, all hosts

You can retrieve ...

Get Learning PowerCLI - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.