如何使用 MSDeploy API 定义 setParamFile
如何使用 MSDeploy API 从 MSDeploy.exe 定义 -setParamFile 参数?
我正在尝试在 powerShell 中编写与以下内容等效的内容:
msdeploy -verb:sync -source:package="c:\MyZip.zip" -dest:auto -setParamFile="c:\StagingParameters.xml"
这是迄今为止我所拥有的:
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Deployment")
$destBaseOptions = new-object Microsoft.Web.Deployment.DeploymentBaseOptions
$syncOptions = new-object Microsoft.Web.Deployment.DeploymentSyncOptions
$deploymentObject = [Microsoft.Web.Deployment.DeploymentManager]::CreateObject("package","C:\MyZip.zip")
#TODO -setParamFile="c:\StagingParameters.xml"
$deploymentObject.SyncTo("auto","",$destBaseOptions,$syncOptions);
How do I define the -setParamFile parameter from MSDeploy.exe using the MSDeploy API?
I'm trying to write the equivalent of the following in powerShell:
msdeploy -verb:sync -source:package="c:\MyZip.zip" -dest:auto -setParamFile="c:\StagingParameters.xml"
Here's what I have so far:
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Deployment")
$destBaseOptions = new-object Microsoft.Web.Deployment.DeploymentBaseOptions
$syncOptions = new-object Microsoft.Web.Deployment.DeploymentSyncOptions
$deploymentObject = [Microsoft.Web.Deployment.DeploymentManager]::CreateObject("package","C:\MyZip.zip")
#TODO -setParamFile="c:\StagingParameters.xml"
$deploymentObject.SyncTo("auto","",$destBaseOptions,$syncOptions);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一定要喜欢反光板!
Gotta love reflector!