Created
May 30, 2019 02:47
-
-
Save inedo-builds/b788c15b20d6c948097da0de53af75c0 to your computer and use it in GitHub Desktop.
Copy and flatten package files into single directory
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
$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