Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sharepoint 在C中运行powershell命令#_Sharepoint_Powershell - Fatal编程技术网

Sharepoint 在C中运行powershell命令#

Sharepoint 在C中运行powershell命令#,sharepoint,powershell,Sharepoint,Powershell,有什么建议吗?您必须使用导入模块命令为sharepoint加载正确的模块。使用get模块查找可用的模块 要以编程方式执行此操作,请参阅我关于此主题的文章: -Oisin首先添加此命令: Add PSSnapin Microsoft.SharePoint.Powershell-EA 0还要确保您正在从Web应用程序运行“Add SPSolution”命令,该命令在IIS上运行,而不是在标准Visual Studio服务器上运行(当您按F5时)。我最近遇到了这个问题。在我的情况下,我既不能看到添加

有什么建议吗?

您必须使用导入模块命令为sharepoint加载正确的模块。使用get模块查找可用的模块

要以编程方式执行此操作,请参阅我关于此主题的文章:


-Oisin

首先添加此命令:


Add PSSnapin Microsoft.SharePoint.Powershell-EA 0

还要确保您正在从Web应用程序运行“Add SPSolution”命令,该命令在IIS上运行,而不是在标准Visual Studio服务器上运行(当您按F5时)。

我最近遇到了这个问题。在我的情况下,我既不能看到添加的解决方案,也不能添加解决方案。因此,首先我使用下面的PowerShell命令删除解决方案:

System.Management.Automation.CommandNotFoundException: The term 'add-spsolution' is not recognized as the name of a cmdlet, function, script file, or operable program.

然后我可以添加新的代码解决方案。

您找到解决方案了吗?
System.Management.Automation.CommandNotFoundException: The term 'add-spsolution' is not recognized as the name of a cmdlet, function, script file, or operable program.
(Get-SPSolution -Identity "YourSolution.wsp").Delete()