PowerGUI errore script sharepoint

Se con PowerGui provate ad eseguire dello script per SharePoint e ricevete questo errore:

 Get-SPWebApplication : Microsoft SharePoint is not supported with version 4.0.30319.2012 of the Microsoft .Net Runtim
e.
At F:PowerShellScriptsGet ContentTypes.ps1:3 char:31
+ $webapp = Get-SPWebApplication <<<<  $targetWebApp
    + CategoryInfo          : InvalidData: (Microsoft.Share...tWebApplication:SpCmdletGetWebApplication) [Get-SPWebA 
   pplication], PlatformNotSupportedException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SpCmdletGetWebApplication
 

Soluzione:
Could you please try a workaround and let me know if it helps.
Close ScriptEditor
Find ScriptEditor.config file in the Installation directory.
By default it is placed in %ProgramFiles(x86)%PowerGUI folder on 64bit OS or in %ProgramFiles%PowerGUI on 32bit OS.
Comment the support of .NET 4 line:
<!–

               

–>

[adrotate banner=”4″]

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *