Skip to content

Instantly share code, notes, and snippets.

@JamesGreenAU
Last active October 14, 2015 07:14
Show Gist options
  • Save JamesGreenAU/4b107c998243aa3aa782 to your computer and use it in GitHub Desktop.
Save JamesGreenAU/4b107c998243aa3aa782 to your computer and use it in GitHub Desktop.
Post deploy step for migrating media from one Umbraco web root to another.
#
# Copies the Media folder from the previous release folder to the newly deployed folder.
#
cd $OctopusOriginalPackageDirectoryPath
cd ..
Write-Host "Moving media folder for release " $OctopusParameters["Octopus.Release.Number"]
$R = Get-ChildItem | Sort-Object Name | select -last 2
$old = $R[0]
$new = $R[1]
Copy-Item -recurse $old\media $new -Force
Write-Host "Copied \media\ from" $old.FullName " to " $new.FullName
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment