diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index 1ca2286..b1a428e 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -50,10 +50,11 @@ function Create-Archive($source, $target, $params) { function Flatten-Directory($name) { $name = Resolve-Path $name $child = (Get-Childitem $name)[0] + $moving = $($name)_moving Write-Verbose "Moving the '$child' directory's content to '$name'" - Rename-Item $name -NewName "$($name)_moving" - Move-Item -Path "$($name)_moving\$child" -Destination $name - Remove-Item -Recurse "$($name)_moving" + Rename-Item "$name" -NewName "$moving" + Move-Item -Path "$child" -Destination "$name" + Remove-Item -Recurse "$moving" } function Digest-Hash($path) {