I got a list of directories like this:
root
|
- dist
|
_ fileA.js
_ fileB.js
_ folder1
|
_ file1a.js
_ folder2
|
_ file2a.js
_ folderb
|
_ file2ba.js
And I want to move the content of dist into the root folder, like this:
root
|
_ fileA.js
_ fileB.js
_ folder1
|
_ file1a.js
_ folder2
|
_ file2a.js
_ folderb
|
_ file2ba.js
I tried:
$logfiles = Get-ChildItem $(System.ArtifactsDirectory)/dist/custom -Recurse -ErrorAction SilentlyContinue | Where-Object { $_.Name -like '**/*.*' } | Select-Object FullName
ForEach ($logfile in $logfiles.FullName) {Copy-Item $logfile -Destination "$(System.ArtifactsDirectory)"}
But it didn't work.