tags:

views:

62

answers:

1

Evening all,

I'd like to know how to add to the list of .NET assemblies that are loaded at start up in PowerShell.

Thanks in advance,

Dan

+5  A: 

If you're on PowerShell 2.0 use the Add-Type cmdlet to add the assemblies e.g.:

Add-Type -AssemblyName System.Windows.Forms

You can use the AssemblyName parameter to add one of the standard .NET assemblies. If you have your own custom assemblies that you want to always load use the -Path parameter e.g.:

Add-Type -Path "$home\foo.dll"

Invoke the Add-Type cmdlet from your profile to make sure the .NET types contained in the added assemblies are always available in your PowerShell sessions. For more info on profiles execute:

Get-Help about_profiles
Keith Hill