mirror of
https://github.com/massgravel/get.activated.win.git
synced 2025-12-15 16:18:19 +01:00
Fix start-process and write-progress on PS 2.0
This commit is contained in:
parent
836a6d277b
commit
66b1789202
1 changed files with 9 additions and 6 deletions
15
index.html
15
index.html
|
|
@ -1,8 +1,10 @@
|
||||||
# This script is hosted on <b>https://get.activated.win</b> for <b>https://massgrave.dev</b><hr><pre>
|
# This script is hosted on <b>https://get.activated.win</b> for <b>https://massgrave.dev</b><hr><pre>
|
||||||
|
|
||||||
if (-not $args) {
|
if (-not $args) {
|
||||||
|
Write-Host ''
|
||||||
Write-Host 'Need help? Check our homepage: ' -NoNewline
|
Write-Host 'Need help? Check our homepage: ' -NoNewline
|
||||||
Write-Host 'https://massgrave.dev' -ForegroundColor Green
|
Write-Host 'https://massgrave.dev' -ForegroundColor Green
|
||||||
|
Write-Host ''
|
||||||
}
|
}
|
||||||
|
|
||||||
& {
|
& {
|
||||||
|
|
@ -70,7 +72,7 @@ if (-not $args) {
|
||||||
$errors += $_
|
$errors += $_
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Write-Progress -Activity "Downloading..." -Completed
|
Write-Progress -Activity "Downloading..." -Status "Done" -Completed
|
||||||
|
|
||||||
if (-not $response) {
|
if (-not $response) {
|
||||||
Check3rdAV
|
Check3rdAV
|
||||||
|
|
@ -116,14 +118,15 @@ if (-not $args) {
|
||||||
if ($chkcmd -notcontains "CMD is working") {
|
if ($chkcmd -notcontains "CMD is working") {
|
||||||
Write-Warning "cmd.exe is not working.`nReport this issue at $troubleshoot"
|
Write-Warning "cmd.exe is not working.`nReport this issue at $troubleshoot"
|
||||||
}
|
}
|
||||||
saps -FilePath $env:ComSpec -ArgumentList "/c """"$FilePath"" -el $args""" -verb runas -Wait
|
|
||||||
CheckFile $FilePath
|
|
||||||
|
|
||||||
if ($psv -lt 3) {
|
if ($psv -lt 3) {
|
||||||
write-host ""
|
$p = saps -FilePath $env:ComSpec -ArgumentList "/c """"$FilePath"" -el $args""" -Verb RunAs -PassThru
|
||||||
write-host "Press any key to exit when process is done..."
|
$p.WaitForExit()
|
||||||
[void][System.Console]::ReadKey($true)
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
saps -FilePath $env:ComSpec -ArgumentList "/c """"$FilePath"" -el $args""" -Wait -Verb RunAs
|
||||||
|
}
|
||||||
|
CheckFile $FilePath
|
||||||
|
|
||||||
$FilePaths = @("$env:SystemRoot\Temp\MAS*.cmd", "$env:USERPROFILE\AppData\Local\Temp\MAS*.cmd")
|
$FilePaths = @("$env:SystemRoot\Temp\MAS*.cmd", "$env:USERPROFILE\AppData\Local\Temp\MAS*.cmd")
|
||||||
foreach ($FilePath in $FilePaths) { Get-Item $FilePath -ErrorAction SilentlyContinue | Remove-Item }
|
foreach ($FilePath in $FilePaths) { Get-Item $FilePath -ErrorAction SilentlyContinue | Remove-Item }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue