How do I add to the types originally loaded in PowerShell?

How do I add to the list of .NET Collections loaded at startup in PowerShell?

+2


source to share


1 answer


If you are using PowerShell 2.0, use the Add-Type cmdlet to add assemblies, for example:

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, for example:



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

      

Call the Add-Type cmdlet from your profile to ensure that the .NET types contained in the added assemblies are always available in your PowerShell sessions. For more information about profiles, run:

Get-Help about_profiles

      

+7


source







All Articles