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);
Gotta love reflector!
[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")
#-setParamFile
$deploymentObject.SyncParameters.Load("c:\StagingParameters.xml");
$deploymentObject.SyncTo("auto","",$destBaseOptions,$syncOptions);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With