PowerShell script for deploy packages(.Zip) files to IIS(local server)

  • Thread starter Thread starter Santosh kumar Ippili
  • Start date Start date
S

Santosh kumar Ippili

Guest
Hi All,

As a part of deployment, I am using "WebDeployPackage" method for all projects in my solution. By using this method VisualStudio(using VS2012) provides 5files for every project when we publish that project.

By using Web DepoyV3 tool we will publish .zip files to the IIS server using deploy.cmd files. So, I wrote one batch file for this. Below is the batch file code.(working well)

cd C:\Solutions\FXA.RIC\DeployPackages @echo Deploy all packages in the directory FOR %%f in (*.cmd) DO %%f /Y

I want to write powershell script instead of batch file. I am unable to execute deploy.cmd file .Below is the powershell script



$path = Get-Location $exepath = "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" ForEach ($file in Get-Childitem $path) { if($file.extension -eq ".cmd") { & Invoke-Command '$file /Y' -----> Here I got only .cmd files in the directory but i don't know how to invoke deploy.cmd files. facing error at this statement } }

Below is the usage of deploy.cmd files

=========================== Usage: -------------------------- DeviceManagement.deploy.cmd [/T|/Y] [/M:ComputerName] [/U:UserName] [/P:Password] [/G:UseTempAgent] [Additional msdeploy.exe flags ...]

Any help would be appreciable.

Thanks,

Santosh Ippili

Continue reading...
 
Back
Top