Domanda

Ho requisiti un po 'interessanti.Il mio cliente vuole sviluppare l'UI dell'amministrazione di SharePoint 2010 dall'applicazione Java.Quindi lo suggerisco ai servizi Web SharePoint utente.Come tutti sappiamo bene da usare.Ma vuole svolgere questo sul comando basato.Quindi suggerisco all'utente di file batch con i cmdlet PowerShell.Non sono sicuro di questa architettura.Ma qualcuno può concentrarmi, come utilizzare i comandi di shell di potenza (cmdlet) con il file BAT?

È stato utile?

Soluzione

You can execute them like any other script which you schedule in your servers Task Scheduler (if that is what you want to do on a regular basis). First, build your powershell script as you usually do and place the file in an appropriate folder. Then build your bat-file calling the powershell script - like this:

powershell .\test.ps1 arg1

You can have multiple argument while calling the script as long as you handle them in your script.

If you need to write .bat-files using powershell, you can use the Out-File command, well described in the article Using the Out-File Cmdlet. Like the following:

Get-Process | Out-File c:\scripts\test.txt

More to read: Use bat to start Powershell script

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top