siva.k
siva.k

Reputation: 1344

NuGet Package Manager Console unable to load PowerShell

After performing an in place upgrade from Windows 7 Pro to 8 Pro I have been unable to get NuGet's package manager console to run in Visual Studio 2012 Pro. The error I receive is:

The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2977) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2984) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2991) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2998) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\WINDOWS\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(3005) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: The getter method should be public, non void, static, and have one parameter of type PSObject.
The term 'Get-ExecutionPolicy' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

I have searched for the last several days for ways to fix this but have been coming up completely empty. I have tried all of these with no avail:

Visual Studio has been exhibiting other odd behaviors such as consistently crashing while trying to add a Click event to XAML on a specific page as well, and because of this my gut says it's not really Power Shell or NuGet but an issue with my OS/Visual Studio.

Unless someone has a solution I think I'm down to just doing a clean install of Windows 8 and hoping that that fixes it.

Upvotes: 5

Views: 2439

Answers (1)

superkinhluan
superkinhluan

Reputation: 784

I found this issue which is very similar to yours:

Embedding Powershell v2.0 in .NET app on Windows 8 RTM

Can you try the solution on that question to see if it fixes it?

Upvotes: 4

Related Questions