executer commande powershell sharepoint 2013 c#
Bonjour,
J'aimerais exécuter une commande powershell sharepoint qui execute ma commande ci dessous:
Code:
1 2
|
string script = "Export-SPWeb http://******.***.**/sites/" + collection_site + "/" + sous_site + " Path \"C:\\Users\\****\\Desktop\\export_sharepoint_2013\\" + fichier + ".cmp\" -ItemURL \"" + bibliotheque + "\""; |
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = @"powershell.exe";
startInfo.Arguments = @"& 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\CONFIG\POWERSHELL\Registration\\sharepoint.ps1'";
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.UseShellExecute = false;
startInfo.CreateNoWindow = true;
Process process = new Process();
process.StartInfo = startInfo;
process.Start(); |
Merci de votre aide car la je bloque.