I just got bitten by a known issue with NuGet when Reflector is added to Visual Studio 2010 as an add-in. When the package manager console was opened the following error appeared:
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\system32\WindowsPowerShell\v1.0\types.ps1xml(2943) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type". The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\system32\WindowsPowerShell\v1.0\types.ps1xml(2950) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type". The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\system32\WindowsPowerShell\v1.0\types.ps1xml(2957) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type". The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\system32\WindowsPowerShell\v1.0\types.ps1xml(2964) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type". The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\system32\WindowsPowerShell\v1.0\types.ps1xml(2971) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type". System.Management.Automation.CmdletInvocationException: Could not load file or assembly 'Scripts\nuget.psm1' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) ---> System.IO.FileLoadException: Could not load file or assembly 'Scripts\nuget.psm1' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) ---> System.ArgumentException: Illegal characters in path. at System.IO.Path.CheckInvalidPathChars(String path) at System.IO.Path.Combine(String path1, String path2) at Microsoft.VisualStudio.Platform.VsAppDomainManager.<AssemblyPaths>d__1.MoveNext() at Microsoft.VisualStudio.Platform.VsAppDomainManager.InnerResolveHandler(String name) at Microsoft.VisualStudio.Platform.VsAppDomainManager.ResolveHandler(Object sender, ResolveEventArgs args) at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName) --- End of inner exception stack trace --- at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadBinaryModule(Boolean trySnapInName, String moduleName, String fileName, Assembly assemblyToLoad, String moduleBase, SessionState ss, String prefix, Boolean loadTypes, Boolean loadFormats, Boolean& found) at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleNamedInManifest(String moduleName, String moduleBase, Boolean searchModulePath, String prefix, SessionState ss, Boolean loadTypesFiles, Boolean loadFormatFiles, Boolean& found) at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleManifest(ExternalScriptInfo scriptInfo, ManifestProcessingFlags manifestProcessingFlags, Version version) at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModule(String fileName, String moduleBase, String prefix, SessionState ss, Boolean& found) at Microsoft.PowerShell.Commands.ImportModuleCommand.ProcessRecord() at System.Management.Automation.Cmdlet.DoProcessRecord() at System.Management.Automation.CommandProcessor.ProcessRecord() --- End of inner exception stack trace --- at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.Runspaces.Pipeline.Invoke() at NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.Invoke(String command, Object input, Boolean outputResults) at NuGetConsole.Host.PowerShell.Implementation.PowerShellHostExtensions.ImportModule(PowerShellHost host, String modulePath) at NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.LoadStartupScripts() at NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.Initialize() at NuGetConsole.Implementation.Console.ConsoleDispatcher.Start() at NuGetConsole.Implementation.PowerConsoleToolWindow.MoveFocus(FrameworkElement consolePane)
Basically this error is fixed by removing Reflector as an add-in. Go to Tools > Add-in Manager and uncheck the Startup checkbox next to the .Net Reflector entry and restart Visual Studio.