2023-07-30 16:15:52 -04:00
|
|
|
|
param(
|
|
|
|
|
[string]$source,
|
|
|
|
|
[string]$destination
|
|
|
|
|
)
|
|
|
|
|
|
2024-02-05 10:09:23 -05:00
|
|
|
|
Clear-Host
|
2023-07-30 16:15:52 -04:00
|
|
|
|
|
|
|
|
|
Write-Host "Stopping installer ..."
|
|
|
|
|
|
|
|
|
|
$installer = Stop-Process -Name "SPTInstaller" -ErrorAction SilentlyContinue
|
|
|
|
|
|
|
|
|
|
if ($installer -ne $null) {
|
|
|
|
|
Write-Host "Something went wrong, couldn't stop installer process'"
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Write-Host "Copying new installer ..."
|
|
|
|
|
|
2024-03-19 12:51:30 -04:00
|
|
|
|
Import-Module BitsTransfer
|
|
|
|
|
|
|
|
|
|
Start-BitsTransfer -Source $source -Destination $destination
|
|
|
|
|
|
|
|
|
|
Remove-Module BitsTransfer
|
2023-07-30 16:15:52 -04:00
|
|
|
|
|
2023-09-21 10:55:25 -04:00
|
|
|
|
# remove the new installer from the cache folder after it is copied
|
|
|
|
|
Remove-Item -Path $source
|
|
|
|
|
|
2023-07-30 16:15:52 -04:00
|
|
|
|
Start-Process $destination
|
|
|
|
|
|
|
|
|
|
Write-Host "Done"
|