I have the following PowerShell script as a step in my automated deployment,
Write-Host "Starting"
Write-Host $OctopusParameters['Octopus.Project.Name']
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']) -force
Write-Host "First"
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\Arc') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\Items') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\category_icon') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\CommentItems') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\Content') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\crash-logs') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\DigitalSignature') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\uploads') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\EditedPages') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\expense') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\feeds') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\help-files') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\logos') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\Notification') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\pspdf_xml') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\Download') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\Upload') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\temp_pdf') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\themes') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\Waters') -force
New-Item -ItemType directory -Path ('E:\projects\'+$OctopusParameters['Octopus.Project.Name']+'\content\CommentItems') -force
Write-Host "Second"
$file = "E:\projects\"+$OctopusParameters['Octopus.Project.Name']+"\content"
Write-Host $file
$Acl = (Get-Item $file).GetAccessControl('Access')
Write-Host "Third"
$Ar = New-Object system.security.accesscontrol.filesystemaccessrule("USERS","Modify","Allow")
Write-Host "4"
$Acl.AddAccessRule($Ar)
Write-Host "5"
Set-Acl $file $Acl
Write-Host "6"
On the same server that I am deploying this step, I have the same folder with the same name but with all the data that I need to move while deploying through Octopus. The other file is at the location:
E:\Projects\Base\version1\content
Please help me modify the script to copy this folder.
Thank you,
Deepshikha