Skip to content

Commit

Permalink
Update Portable.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNico98 authored Jul 17, 2024
1 parent 4faa671 commit 4569493
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Portable.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Scarica il file
$URL = "https://github.com/MrNico98/WinHubX/releases/download/WinHubX-v.2.4.0.2/WinHubX.portable.exe"
$FILE = "WinHubX.portable.exe"
Invoke-WebRequest -Uri $URL -OutFile $FILE
Expand All @@ -9,14 +8,16 @@ if (Test-Path $FILE) {

# Esegui l'applicazione
Write-Output "Avviando l'applicazione..."
Start-Process -FilePath $FILE
$process = Start-Process -FilePath $FILE -PassThru

while (Get-Process | Where-Object { $_.Name -eq "WinHubX.portable" }) {
# Se il processo è ancora in esecuzione, attendi 5 secondi e riprova
Start-Sleep -Seconds 2
}
# Attendi fino a quando il processo non è terminato
$process.WaitForExit()

Write-Output "Eliminando $FILE..."
Remove-Item -Path $FILE
Write-Output "Operazione completata."
} else {
Write-Output "Il download non è riuscito."
}


0 comments on commit 4569493

Please sign in to comment.