Skip to content

Instantly share code, notes, and snippets.

@inedo-builds
Created May 30, 2019 02:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inedo-builds/b788c15b20d6c948097da0de53af75c0 to your computer and use it in GitHub Desktop.
Save inedo-builds/b788c15b20d6c948097da0de53af75c0 to your computer and use it in GitHub Desktop.
Copy and flatten package files into single directory
$sourceDir = '<Feed Storage Path>'
$targetDir = '<Target Drop Folder Path>'
$packageIndex = 1
Get-ChildItem $sourceDir *.* -Recurse | foreach($_) {
if (-not $_.PSIsContainer) {
$ext = [System.IO.Path]::GetExtension($_.Name)
Copy-Item -Path $_.FullName -Destination (Join-Path -Path $targetDir -ChildPath "$packageIndex$ext")
$packageIndex = $packageIndex + 1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment