From 4992227614af4d6b1c037a5a68ed2e0a2bf52b44 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Fri, 14 Oct 2022 22:12:59 +0330 Subject: [PATCH] use correct order of commands to move directory --- scripts/utils.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index 1b6bff6..0b62d97 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -49,10 +49,10 @@ function Create-Archive($source, $target, $params) { # Flatten it instead 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 $moving + $child = (Get-Childitem $moving)[0] + Write-Verbose "Moving the '$child' directory to '$name'" Move-Item -Path $child -Destination $name Remove-Item -Recurse $moving }