How to convert an IIS folder to an application?

4

When I want to convert a folder to an application, I proceed as below screenshot.

I'm looking for script to do this from a batch-command/.bat-file. Is it possible?

If it is, please share. Thank you!

enter image description here

Nam G VU

Posted 2011-04-12T09:30:09.440

Reputation: 10 255

Answers

2

You can use the ConvertTo-WebApplication PowerShell cmdlet. The graphic interface executes the same command.

paradroid

Posted 2011-04-12T09:30:09.440

Reputation: 20 970

@Paradroid How can we run a .bat file via PowerShell by double click it ? – Nam G VU – 2011-04-12T10:14:12.883

@Nam: you can probably use a .bat file that runs the PowerShell command, but that seems silly. You can execute the PowerShell .ps1 script from the Run box or make a shortcut for it. – paradroid – 2011-04-12T10:47:38.033

@Paradroid Calling ConvertTo-WebApplication failed on my PowerShell. Trying to call add-pssnapin WebAdministration also failed. What should I do now? – Nam G VU – 2011-04-12T11:13:33.110

@Nam: Make sure you have the IIS admin tools installed and try Import-Module WebAdministration – paradroid – 2011-04-12T11:27:09.933

@Nam: So did you sort it out in the end? – paradroid – 2011-04-13T14:48:52.857

@Paradroid I'll let you know and pick up yours as selected answer when I tried. At the moment I'm looking at NAnt script, seems to be much simpler to me. – Nam G VU – 2011-04-14T07:39:43.427