0

So I'm trying to use powershell and psake for my build and deployment. I've tried without any success to call the following psake task.

Exec { msdeploy.exe "-verb:sync"
"-source:package="D:\path-to-package\zip-file-name.zip"
"-dest:auto,computername=http://my-server-name-here:8090/MsDeployAgentService2/" -setparam:Name="IIS Web Application Name,Value=iis-web-app-name-here" "-allowUntrusted" }

So in an effort to get things moving I removed the offending setparam:Name="IIS Web Application Name,Value=iis-web-app-name-here". It worked but took the IIS Web Application Name parameter from the ..SetParameters.xml as expected.

<setParameter name="IIS Web Application Name" value="Default Web Site/project.name_deploy" />

There's clearly something wrong with the syntax of setparam:Name="IIS Web Application Name,Value=iis-web-app-name-here" but I've tried a dozen (or more) variations including

-setparam:"IIS Web Application Name=iis-web-app-name-here" > omitting the name,value

-setparam:"IIS` Web` Application` Name=iis-web-app-name-here" > using back ticks

I really can't work out what I'm doing wrong and may have to resort back to using an msbuild file to get things moving.

The error I receive is : > all arguments must begin with -

Cœur
  • 37,241
  • 25
  • 195
  • 267
Tim Butterfield
  • 565
  • 5
  • 24

1 Answers1

0

I believe you need to quote the parameters as follows:

setparam:Name="IIS Web Application Name",Value="iis-web-app-name-here"

Note the additional quotes before the comma and after the equals sign following Value.

David Martin
  • 11,764
  • 1
  • 61
  • 74