mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-19 08:28:19 +02:00
Updated install-powershell.ps1
This commit is contained in:
parent
0ad1759cd5
commit
c7d2f403a0
@ -424,21 +424,23 @@ try {
|
|||||||
Expand-ArchiveInternal -Path $packagePath -DestinationPath $contentPath
|
Expand-ArchiveInternal -Path $packagePath -DestinationPath $contentPath
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Write-Host "Extracting..."
|
Write-Host "⏳ (3/4) Extracting package to: $contentPath..."
|
||||||
tar zxf $packagePath -C $contentPath
|
tar zxf $packagePath -C $contentPath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-not $UseMSI) {
|
if (-not $UseMSI) {
|
||||||
|
Write-Host "Removing current installation at: $Destination ..."
|
||||||
Remove-Destination $Destination
|
Remove-Destination $Destination
|
||||||
if (Test-Path $Destination) {
|
if (Test-Path $Destination) {
|
||||||
Write-Host "Copying files..."
|
Write-Host "⏳ (4/4) 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/4) 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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user