The only option to run something before and then after a deployment would be a Custom Action. You could use a batch file to kick off the Powershell script.
More information on how to use a Custom Action:
Let me know if you have questions.
1 of 1 people found this helpful
You could call a batch file and include something similar: (this is guidance only, we can't support a customer script)
Runs the 32 bit version of PowerShell
if /i %PROCESSOR_ARCHITECTURE% == AMD64 (
"%argPowershellDir%\Powershell" "%FilePath%\PowershellScript.ps1" –var1 "Var1Value" –var2 "Var2Value" –var3 "Var3Value"
In theory, you can have one run before and after the patch deployment.
I have a feeling what I want to do is unfortunately, not possible. Essentially (now that I've dug into the product more), what I'm looking to do is in the custom actions of a deployment template, execute an ITScript. I don't think a bat file will do it, as I won't have access to the machine variables (specifically, "$ST_ComputerName"), which is a show stopper.
You're right, I can't come up with a solution to the variable issue, it's a limitation we can't workaround.
No worries. The best I came up with was copy powershell & bat file to the client computer and have the client execute the bat. The bat would then call a powershell script which would invoke a web request that would execute the actions I need run. I'll be passing the $env:computername from the powershell script to the web service. That's the best I could come up with.
Thanks for all your help!