{
  "Id": "ActionTemplates-158",
  "Name": "File System - Restore Directory",
  "Description": "Restores a folder and it's contents (files and sub-folders).",
  "ActionType": "Octopus.Script",
  "Version": 1,
  "Properties": {
    "Octopus.Action.Script.ScriptBody": "$source = $OctopusParameters['Source']\r\n$destination = $OctopusParameters['Destination']\r\n\r\nif(Test-Path $destination)\r\n{\r\n    ## Clean the destination folder\r\n    Write-Host \"Cleaning $destination\"\r\n    Remove-Item $destination -Recurse\r\n}\r\n\r\n## Copy recursively\r\nWrite-Host \"Copying from $source to $destination\"\r\nCopy-Item $source $destination -Recurse",
    "Octopus.Action.Script.Syntax": "PowerShell"
  },
  "SensitiveProperties": {},
  "Parameters": [
    {
      "Name": "Source",
      "Label": "Source",
      "HelpText": "The source directory where files and folders will be copied from",
      "DefaultValue": null,
      "DisplaySettings": {}
    },
    {
      "Name": "Destination",
      "Label": "Destination folder",
      "HelpText": "The Destination where the files will be copied to.",
      "DefaultValue": null,
      "DisplaySettings": {}
    }
  ],
  "$Meta": {
    "LastModifiedBy": "joaoasrosa",
    "Type": "ActionTemplate"
  }
}

Add a Octopus Template to restore a directory recursively
Add a Octopus Template to restore a directory recursively

Add a Octopus Template to restore a directory recursively
