Deployment mit Powershell – Schritt 2: Kopieren der Dateien

by robert 8. May 2009 20:23

Das Script wächst:

5-8-2009 8-17-44 PM

Hier die Funktion “CopyTemplateToTarget”:

   1: ##################################################
   2: # FILE SYSTEM: DATA SECTION
   3: ###################################################
   4: function CopyTemplateToTarget
   5: {
   6:     if ((Test-Path $path_targetDeployment) -eq $false ){
   7:         New-Item $path_targetDeployment -Force -ItemType directory;
   8:     }
   9:         
  10:     copy-item $path_sourceDeploymenPackage* $path_targetDeployment  -recurse -force 
  11:     
  12:     PrintElapsedTime
  13: }

Die Variable $path_targetDeployment beinhaltet den Ordner, in den kopiert werden soll. Existiert dieser Ordner nicht, so wird er erstellt.

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

About Oliver

shades-of-orange.com code blog logo I build web applications using ASP.NET and have a passion for javascript. Enjoy MVC 4 and Orchard CMS, and I do TDD whenever I can. I like clean code. Love to spend time with my wife and our children. My profile on Stack Exchange, a network of free, community-driven Q&A sites

About Anton

shades-of-orange.com code blog logo I'm a software developer at teamaton. I code in C# and work with MVC, Orchard, SpecFlow, Coypu and NHibernate. I enjoy beach volleyball, board games and Coke.