{"id":13566770,"url":"https://github.com/dsccommunity/xRobocopy","last_synced_at":"2025-04-04T00:32:12.228Z","repository":{"id":32389192,"uuid":"35965654","full_name":"dsccommunity/xRobocopy","owner":"dsccommunity","description":"DSC Module to automate Robocopy transfers","archived":false,"fork":false,"pushed_at":"2019-03-15T05:32:22.000Z","size":64,"stargazers_count":53,"open_issues_count":8,"forks_count":14,"subscribers_count":25,"default_branch":"dev","last_synced_at":"2024-04-07T23:34:06.233Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsccommunity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-20T18:15:39.000Z","updated_at":"2024-01-09T13:13:59.000Z","dependencies_parsed_at":"2022-07-30T06:17:53.637Z","dependency_job_id":null,"html_url":"https://github.com/dsccommunity/xRobocopy","commit_stats":null,"previous_names":["powershell/xrobocopy"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsccommunity%2FxRobocopy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsccommunity%2FxRobocopy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsccommunity%2FxRobocopy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsccommunity%2FxRobocopy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsccommunity","download_url":"https://codeload.github.com/dsccommunity/xRobocopy/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247103290,"owners_count":20884023,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:02:16.449Z","updated_at":"2025-04-04T00:32:11.990Z","avatar_url":"https://github.com/dsccommunity.png","language":"PowerShell","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"readme":"[![Build status](https://ci.appveyor.com/api/projects/status/gooo7e8b374v45j6/branch/master?svg=true)](https://ci.appveyor.com/project/PowerShell/xrobocopy/branch/master)\r\n\r\n# xRobocopy\r\n\r\nThe **xRobocopy** module is a part of the Windows PowerShell Desired State Configuration (DSC) Resource Kit, which is a collection of DSC Resources. This module is used to facilitate large file copies with complex requirements such as multithreading, restarts, and exclusions when recursing content., with simple declarative language.\r\n\r\n**All of the resources in the DSC Resource Kit are provided AS IS, and are not supported through any Microsoft standard support program or service. The \"x\" in xRobocopy stands for experimental**, which means that these resources will be **fix forward** and monitored by the module owner(s).\r\n\r\nPlease leave comments, feature requests, and bug reports in the Q \u0026 A tab for\r\nthis module.\r\n\r\nIf you would like to modify the **xRobocopy** module, feel free. When modifying, please update the module name, resource friendly name, and MOF class name (instructions below). As specified in the license, you may copy or modify this resource as long as they are used on the Windows Platform.\r\n\r\nFor more information about Windows PowerShell Desired State Configuration, check out the blog posts on the [PowerShell Blog](http://blogs.msdn.com/b/powershell/) ([this](http://blogs.msdn.com/b/powershell/archive/2013/11/01/configuration-in-a-devops-world-windows-powershell-desired-state-configuration.aspx) is a good starting point). There are also great community resources, such as [PowerShell.org](http://powershell.org/wp/tag/dsc/), or [PowerShell Magazine](http://www.powershellmagazine.com/tag/dsc/). For more information on the DSC Resource Kit, checkout [this blog post](http://go.microsoft.com/fwlink/?LinkID=389546).\r\n\r\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\r\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\r\n\r\nInstallation\r\n------------\r\n\r\nTo install **xRobocopy** module\r\n\r\n-   If you are using WMF4 / PowerShell Version 4: Unzip the content under the C:\\Program Files\\WindowsPowerShell\\Modules folder\r\n\r\n-   If you are using WMF5 Preview: From an elevated PowerShell session run \"Install-Module xRobocopy\"\r\n\r\nTo confirm installation\r\n\r\n-   Run Get-DSCResource to see that the resources listed above are among the DSC Resources displayed\r\n\r\nRequirements\r\n------------\r\n\r\nThis module requires the latest version of PowerShell (v4.0, which ships in\r\nWindows 8.1 or Windows Server 2012R2). To easily use PowerShell 4.0 on older\r\noperating systems, install WMF 4.0. Please read the installation instructions\r\nthat are present on both the download page and the release notes for WMF 4.0.\r\n\r\nDetails\r\n-------\r\n**xRobocopy** resource has following properties\r\n- **Source**: Source Directory, Drive or UNC path.\r\n- **Destination**: Destination Dir, Drive or UNC path.\r\n- **Files**: File(s) to copy  (names/wildcards: default is all files).\r\n- **Retry**: Number of Retries on failed copies: default 1 million.\r\n- **Wait**: Wait time between retries: default is 30 seconds.\r\n- **SubdirectoriesIncludingEmpty**: Copy subdirectories, including Empty ones.\r\n- **Restartable**: Copy files in restartable mode.\r\n- **MultiThreaded**: Do multi-threaded copies with n threads (default 8). N must be at least 1 and not greater than 128. This option is incompatible with the /IPG and /EFSRAW options. Redirect output using /LOG option for better performance.\r\n- **ExcludeFiles**: Exclude Files matching given names/paths/wildcards.\r\n- **LogOutput**: Output status to LOG file.\r\n- **AppendLog**: Determine whether to overwrite log file or append.\r\n- **AdditionalArgs**: Robocopy has MANY configuration options. Too many to present them all as DSC parameters effectively. Use this option to set additional parameters. Each parameter should be a separate array member. This array will be combined with main argument array. For a list of options run Robocopy /??? in a shell window.\r\n- **Ensure**: (Readonly). Will indicate whether Destination is in sync with Source.\r\n\r\nRenaming Requirements\r\n---------------------\r\n\r\nWhen making changes to these resources, we suggest the following practice\r\n\r\n1. Update the following names by replacing MSFT with your company/community name\r\nand replacing the **\"x\" with **\"c\" (short for \"Community\") or another prefix of your\r\nchoice\r\n -    Module name (ex: xModule becomes cModule)\r\n -    Resource folder (ex: MSFT\\_xResource becomes Contoso\\_xResource)\r\n -    Resource Name (ex: MSFT\\_xResource becomes Contoso\\_cResource)\r\n -    Resource Friendly Name (ex: xResource becomes cResource)\r\n -    MOF class name (ex: MSFT\\_xResource becomes Contoso\\_cResource)\r\n -    Filename for the \u003cresource\\\u003e.schema.mof (ex: MSFT\\_xResource.schema.mof becomes Contoso\\_cResource.schema.mof)\r\n\r\n2. Update module and metadata information in the module manifest\r\n3. Update any configuration that use these resources\r\n\r\nWe reserve resource and module names without prefixes (\"x\" or \"c\") for future use (e.g. \"MSFT_Resource\"). If the next version of Windows Server ships with a \"WindowsEventForwarding\" resource, we don't want to break any configurations that use any community modifications. Please keep a prefix such as \"c\" on all community modifications.\r\n\r\n## Versions\r\n\r\n### Unreleased\r\n\r\n* Update appveyor.yml to use the default template.\r\n* Activated the GitHub App Stale on the GitHub repository.\r\n* Fixed new line in example xRobocopy.NetworkAndCredentials.ps1 that failed tests.\r\n* Added .gitignore file.\r\n* Added default template files .codecov.yml, .gitattributes, and .gitignore, and\r\n  .vscode folder.\r\n\r\n### 2.0.0.0\r\n\r\n* Improved Test-TargetResource method to run robocopy with the same parameters as in Set-TargetResource\r\n* Bug fix in Test-TargetResource when evaluating return code from robocopy\r\n* Updated example to use correct PsDscRunAsCredential parameter\r\n* **Breaking Change:** Changed AditionalArgs parameter to Array of String\r\n* Added additional examples with different copy options.\r\n\r\n### 1.2.0.0\r\n\r\n* Improvements in error handling\r\n\r\n### 1.1.0.0\r\n\r\n* Updated Get-TargetResource function\r\n\r\n### 1.0.0.0\r\n\r\n* Initial public release of xRobocopy module with following resources:\r\n    * xRobocopy\r\n\r\nExamples\r\n--------\r\n\r\n**Example 1**:  Copy a directory from one location to another with multithreading and restartable mode.  Note that this example is using PSRunAsCredential which is a common parameter only available in WMF5 and later.\r\n```powershell\r\n    configuration DeployContent\r\n    {\r\n        param (\r\n            [Parameter(Mandatory=$true)]\r\n            [ValidateNotNullorEmpty()]\r\n            [PsCredential] $Credential\r\n            )\r\n\r\n        Import-DscResource -ModuleName xRobocopy\r\n        Node 'localhost'\r\n        {\r\n            xRobocopy Content\r\n            {\r\n                Source                = '\\\\server\\share\\ReleaseVersion'\r\n                Destination           = 'C:\\inetpub\\wwwroot\\sitename'\r\n                MultiThreaded         = $true\r\n                Restartable           = $true\r\n                PsDscRunAsCredential  = $Credential\r\n            }\r\n        }\r\n    }\r\n    $configData = @{\r\n        AllNodes = @(\r\n            @{\r\n                NodeName                    = 'localhost';\r\n                CertificateId               = 'Your Certificate thumbprint here'\r\n                }\r\n            )\r\n        }\r\n    DeployContent -ConfigurationData $configData -Credential (get-credential) -OutputPath 'c:\\DSC'\r\n    Start-DscConfiguration -Wait -Force -Verbose -Path 'c:\\DSC'\r\n\r\n    # Validate results\r\n    Get-ChildItem C:\\inetpub\\wwwroot\\sitename\r\n```\r\n\r\n## Contributing\r\nPlease check out common DSC Resources [contributing guidelines](https://github.com/PowerShell/DscResource.Kit/blob/master/CONTRIBUTING.md).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsccommunity%2FxRobocopy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsccommunity%2FxRobocopy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsccommunity%2FxRobocopy/lists"}