Search code examples
powershellpowershell-2.0powershell-4.0

Unable to load System.Windows.Controls Assembly in powershell


I have been trying to load an assembly in powershell using command as follows:

[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Controls")

It's not working.

enter image description here


Solution

  • Wells its already loaded.

    Try running this.

    $ExportedTypes = [appdomain]::CurrentDomain.GetAssemblies() | select ExportedTypes
    Foreach($ExportedType in $ExportedTypes){
        $ExportedType.ExportedTypes | ?{$_.FullName -like "system.windows.controls*"} | select FullName, Module
    }
    

    If you get any results it is already loaded.

    The Assembly you are loading is actually part of PresentationFramework.dll