Save (and Load) Current PowerShell Configuration

PowerShell can be configured in a multitude of ways. Most often, you use Add-PSSnapin to load additional snap-ins with more cmdlets and providers. You should use Export-Console to save your current configuration to file. This is also a great way of looking at the configuration details:

Export-Console $home\console.psc1
Get-Content $home\console.psc1

The result is XML. If you have loaded any additional snap-ins, they appear in the <PSSnapins> section.

The primary advantage of console configuration files is that you can use them to load back the original configuration. Simply launch PowerShell with the parameter -psconsolefile and specify the path to your .psc1 file.


Posted Apr 14 2009, 08:00 AM by ps1
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.