I would like to deploy a web application on Windows 2008 R2. I know the separate PowerShell commands to do various tasks. But I would like to put this into a nice PowerShell script.
I just need the syntax, can you please help me to do the following actions:
Test if
C:\Inetpub\MyWebsitefolder exists, if not, create it.Test in IIS7 if
MyWebsiteexists, if not create it (I know how toImport-Module WebAdministrationand callNew-WebSite)Now the complicated part. I deploy a Web site from a package prepared by Visual Studio 2010. VS supplies a
.cmdfile where I just need to execute it from a DOS prompt. This means I have to leave the PS Console, open a DOS Console to run that cmd file. Is it possible to run a.cmdfile from within a PowerShell console ?