Created
September 17, 2015 02:28
-
-
Save yzorg/3dac89c7dfb9489fa837 to your computer and use it in GitHub Desktop.
copy selective list of files from text file using PowerShell and xcopy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'c:\git\mycompany_prj2\Legacy\Comp1\f1.cs | |
c:\git\mycompany_prj2\Legacy\Comp2\Domain\f2.cs | |
c:\git\mycompany_prj2\Legacy\MyWeb\web.config' > files.txt | |
cd c:\git\mycompany_prj2 | |
$dest = '..\project_archive\prep_6.11_merge' | |
if (!(Test-Path $dest)) { md $dest -Verbose } | |
gc .\files.txt | %{ | |
$rel = (Resolve-Path -Relative $_) | |
xcopy $_ (Join-Path $dest $rel*) /Y | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for xcopy * trick from SO: http://stackoverflow.com/a/14488464