Start-Job -scriptblock
-
2012年2月20日 上午 09:25
Hi,
I am trying to create a ps1 file that would have the Start-Job command which would run a stsadm command at the background. In this stsadm command am trying to de-activate a feature. Hence I need to pass arguments to the stsadm.exe file but not been successful.
This is the way am calling
Start-Job -scriptblock {'stsadm.exe'} -ArgumentList "-o deactivatefeature <<GUID>>......."
I think am making a mistake in passing the arguments. Please help.
所有回覆
-
2012年2月27日 上午 04:51版主
Hi Cutloo,
Did you mean that you wanted to use Stsadm in PowerShell script ?
you may want to use the code set-alias STSADM "${env:commonprogramfiles}\Microsoft Shared\Web Server Extensions\12\BIN\STSADM.EXE" in your script, here are some articles about this topic,
http://www.sharepointblues.com/2010/04/28/scripting-stsadm-with-powershell/
Thanks
Daniel Yang
TechNet Community Support
- 已標示為解答 Daniel YangMicrosoft Contingent Staff, Moderator 2012年3月2日 上午 02:07

