Link to home
Start Free TrialLog in
Avatar of Albert Widjaja
Albert WidjajaFlag for Australia

asked on

Unable to find type [ordered]: make sure that the assembly containing this type is loaded.

Folks,

I'm trying to run a Powershell script which used the ordered list, but somehow it failed on my Windows 7 laptop with the below error message:

Unable to find type [ordered]: make sure that the assembly containing this type is loaded.


I'm using PowerGUI to execute all powershell and the below is the output of the versions:

Code:
gci 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' | sort pschildname -des | foreach-object {$_.name; $_.GetValue("Version");}

Open in new window


Result:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4.0
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5
3.5.30729.5420
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0
3.0.30729.5420
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727
2.0.50727.5420
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\CDF

PS C:\Users\Administrator\Documents> $PSVersionTable

Open in new window

Name                           Value
----                           -----
PSVersion                      2.0
PSCompatibleVersions           {1.0, 2.0}
BuildVersion                   6.1.7601.17514
PSRemotingProtocolVersion      2.1
WSManStackVersion              2.0
CLRVersion                     4.0.30319.1026
SerializationVersion           1.1.0.1

PS C:\Users\Administrator\Documents> Get-PowerCLIVersion

Open in new window

PowerCLI Version
----------------
VMware vSphere PowerCLI 5.8 Release 1 build 2057893
---------------
Snapin Versions
---------------
VMWare AutoDeploy PowerCLI Component 5.5 build 1983942
VMWare ImageBuilder PowerCLI Component 5.5 build 1983942
VMware License PowerCLI Component 5.5 build 1265954
VMware Storage PowerCLI Component 5.8 build 2057894
VMware VDS PowerCLI Component 5.8 build 2031581
VMware vSphere PowerCLI Component 5.8 build 2031581

I'm sure that I have installed the .NET Framework 4.0 (Windows6.1-KB2819745-x64-MultiPkg.msu) but somehow the code is still stuck with no chance to get it running for the first time.

Any help would be greatly appreciated.

Thanks.
SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Albert Widjaja

ASKER

Yeah, I know:


Name                           Value
  ----                                -----
PSVersion                      2.0

But I cannot install the powershell 3.0 because it would break my Exchange Server management console in my Windows 7.

I have already installed the Windows6.1-KB2819745-x64-MultiPkg.msu, but somehow it is still showing as PS version 2.0

what can I do to run it under PS 4.0 ?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Exchange Server 2010, for all types of server deployment including workstation with Exchange Management Console.

So I'm skipping .NET Fx 3.0 but somehow I still don;t understand as to why I cannot use or install .NET Fx 4.0 ?

I have rebooted my laptop couple of times already but it is still showing as PS 2.0 not yet 4.0 ?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok, after installing the .NET Fx 4.5.2 NDP452-KB2901907-x86-x64-AllOS-ENU.exe, now my Exchange management console broke with the following error:

Cannot load Windows PowerShell snap-in Microsoft.Exchange.Management.PowerShell.E2010 because of the following error: The type initializer for 'Microsoft.Exchange.Data.Directory.Globals' threw an exception.

as per this website: http://www.powershellserver.com/powershell-server-cannot-load-windows-powershell-snap-in-microsoft-exchange-management-powershell-e2010/

it says I have to uninstall the .NET Fx
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial