小编Ram*_*nik的帖子

在C#中运行powershell命令

RunspaceConfiguration psConfig = RunspaceConfiguration.Create();
Runspace psRunspace = RunspaceFactory.CreateRunspace(psConfig);
psRunspace.Open();
using (Pipeline psPipeline = psRunspace.CreatePipeline())
            {

            // Define the command to be executed in this pipeline
            Command command = new Command("Add-spsolution");

            // Add a parameter to this command
            command.Parameters.Add("literalpath", @"c:\project3.wsp");

            // Add this command to the pipeline 
            psPipeline.Commands.Add(command);


                // Invoke the cmdlet
            try
            {
                Collection<PSObject> results = psPipeline.Invoke();
                Label1.Text = "hi"+results.ToString();
                // Process the results
            }
            catch (Exception exception)
            {
                Label1.Text = exception.ToString();// Process the exception here
            }

        }
Run Code Online (Sandbox Code Playgroud)

它抛出异常:

System.Management.Automation.CommandNotFoundException: …
Run Code Online (Sandbox Code Playgroud)

powershell sharepoint

11
推荐指数
2
解决办法
5229
查看次数

在SPList中查询日期时间字段

你能告诉我如何使用CAML查询将存储在SPList中的日期和时间作为DateTime字段与当前系统时间进行比较吗?

sharepoint caml splist

0
推荐指数
1
解决办法
1696
查看次数

标签 统计

sharepoint ×2

caml ×1

powershell ×1

splist ×1