Fix: Installer - Powershell file functions #135

This commit is contained in:
BlaCk_Void 2021-08-08 22:25:09 +09:00
parent 75709e2543
commit f16c8cc65b

View file

@ -142,7 +142,7 @@ function Copy-Auto() {
Write-Host "" Write-Host ""
} }
Copy-Item -Path "${file}" -Destination "${target}" -Force Copy-Item -Path "${file}" -Destination "${target}" -Force -Recurse
} }
function Move-Auto() { function Move-Auto() {
@ -165,10 +165,10 @@ function Move-Auto() {
Write-Host "" Write-Host ""
} }
Move-Item -Path "${file}" -Destination "${target}" -Force Get-ChildItem -Path "${target}" -Recurse | Move-Item -Path "${file}" -Destination "${target}" -Force
} }
function Restore-Auto() { function Restore-Auto() {
Param ( Param (
[Parameter(Mandatory=$true, Position=0)] [Parameter(Mandatory=$true, Position=0)]
[string] $file [string] $file
@ -178,9 +178,9 @@ function Restore-Auto() {
if ( Test-Path -Path "${file}" ) { if ( Test-Path -Path "${file}" ) {
Remove-Item "${file}" -Recurse -Force Remove-Item "${file}" -Recurse -Force
} }
Move-Item -Path "${target}" -Destination "${file}" -Force Get-ChildItem -Path "${target}" -Recurse | Move-Item -Destination "${file}" -Force
$local:loopupTarget = "${target}.bak" $local:lookupTarget = "${target}.bak"
if ( Test-Path -Path "${lookupTarget}" ) { if ( Test-Path -Path "${lookupTarget}" ) {
Restore-Auto "${target}" Restore-Auto "${target}"
} }