mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-10 10:34:54 +02:00
Updated install-powershell.ps1
This commit is contained in:
parent
6683e179fc
commit
a4fa175203
@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user