pass parameters to batch file in msdeploy runcommand

折月煮酒 提交于 2019-11-29 14:17:34

Edit You are right, the documentation states that cmd/bat files will be streamed to the destination.

It seems to me that it's simply a limitation of the feature that it can't accept arguments. It shouldn't be too difficult to create a modified version of the batch file at deploy-time with the settings hardcoded.

Something like:

REM Start of prepended script
SET SCRIPT_USERNAME=ThatGuy
REM End of prepended script

IF ("%SCRIPT_USERNAME%" == "") SET SCRIPT_USERNAME=%1

Update Having browsed the reflected source (ahem) of msdeploy, I can confirm that it's simply the way it's current designed. It determines whether to upload the file based on whether the entire path represents a file. Since adding arguments will prevent it resolving the path to a file, it doesn't upload anything.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!