Updated install-powershell.ps1

This commit is contained in:
Markus Fleschutz 2025-04-30 17:07:58 +02:00
parent 6683e179fc
commit a4fa175203

View File

@ -438,18 +438,18 @@ try {
} }
if (Test-Path $Destination) { if (Test-Path $Destination) {
Write-Host "⏳ (4/5) Copying files to $Destination... " Write-Host "⏳ (5/5) Copying files to $Destination... "
# only copy files as folders will already exist at $Destination # only copy files as folders will already exist at $Destination
Get-ChildItem -Recurse -Path "$contentPath" -File | ForEach-Object { Get-ChildItem -Recurse -Path "$contentPath" -File | ForEach-Object {
$DestinationFilePath = Join-Path $Destination $_.fullname.replace($contentPath, "") $DestinationFilePath = Join-Path $Destination $_.fullname.replace($contentPath, "")
Copy-Item $_.fullname -Destination $DestinationFilePath Copy-Item $_.fullname -Destination $DestinationFilePath
} }
} elseif ($IsWinEnv) { } elseif ($IsWinEnv) {
Write-Host "⏳ (4/5) Moving new installation to $Destination... " Write-Host "⏳ (5/5) Moving new installation to $Destination... "
$null = New-Item -Path (Split-Path -Path $Destination -Parent) -ItemType Directory -ErrorAction SilentlyContinue $null = New-Item -Path (Split-Path -Path $Destination -Parent) -ItemType Directory -ErrorAction SilentlyContinue
Move-Item -Path $contentPath -Destination $Destination Move-Item -Path $contentPath -Destination $Destination
} else { } else {
Write-Host "⏳ (4/5) Moving new installation to $Destination... " Write-Host "⏳ (5/5) Moving new installation to $Destination... "
& sudo mv "$contentPath" "$Destination" & sudo mv "$contentPath" "$Destination"
} }
} }