-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separate the online downloader and make it a new instance
- Loading branch information
Showing
4 changed files
with
32 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
$WT = "WindowsTerminal" | ||
$CH = "conhost" | ||
if (Get-Process -Name $WT -ErrorAction SilentlyContinue) { | ||
Write-Output "This script is either running in the process '$($processName)' or is open somewhere else." | ||
Write-Output "Make sure to save any work in the process '$($processName)' and we'll close it for you." | ||
$windowsterminal = 'WindowsTerminal' | ||
$conhost = 'conhost' | ||
if (Get-Process -Name $windowsterminal -ErrorAction SilentlyContinue) { | ||
Write-Output "This script is either running in the process '$($windowsterminal)' or is open somewhere else." | ||
Write-Output "Make sure to save any work in the process '$($windowsterminal)' and we'll close it for you." | ||
Write-Output "Press any key to continue." | ||
$host.UI.RawUI.ReadKey() | Out-Null | ||
$host.UI.RawUI.ReadKey("NoEcho, IncludeKeyUp") | ||
taskkill /IM "WindowsTerminal.exe" /F | ||
Exit-PSHostProcess | ||
Exit-PSSession | ||
Exit | ||
} elseif (Get-Process -Name $conhost -ErrorAction SilentlyContinue) { | ||
StartMainMenu | ||
} else { | ||
Write-Output "An error has occured create a issue on GitHub. https://github.com/mcalec-dev/gallerydl-pwsh/issues" | ||
Write-Output "Parsing error in testforwt.ps1" | ||
Write-Output "Press any key to continue." | ||
$host.UI.RawUI.ReadKey("NoEcho, IncludeKeyUp") | ||
taskkill /IM "WindowsTerminal.exe" /F | ||
Exit-PSHostProcess | ||
Exit-PSSession | ||
Exit | ||
} else if (Get-Process -Name $CH -ErrorAction SilentlyContinue) { | ||
RunMainMenu | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
$tempFolder = "$($env:TEMP)\gdl-pwsh" | ||
New-Item -Path $tempFolder -ItemType Directory -Force | Out-Null | ||
New-Item -Path "$($tempFolder)\modules" -ItemType Directory -Force | Out-Null | ||
Invoke-WebRequest -Uri "https://git.mcalec.dev/gallerydl-pwsh/modules/variables.ps1" -OutFile $tempFolder\modules\variables.ps1 | Out-Null | ||
Invoke-WebRequest -Uri "https://git.mcalec.dev/gallerydl-pwsh/modules/testforwt.ps1" -OutFile $tempFolder\modules\testforwt.ps1 | Out-Null | ||
Invoke-WebRequest -Uri "https://git.mcalec.dev/gallerydl-pwsh/run.ps1" -OutFile $tempFolder\run.ps1 | ||
Import-Module -Name $tempFolder\variables.ps1 | ||
Import-Module -Name $tempFolder\testforwt.ps1 | ||
Import-Module -Name $tempFolder\run.ps1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters