Merge pull request #357 from 1552980358/master

Fix Windows 10 installation Appx commands error when pwsh.exe installed
This commit is contained in:
MustardChef 2024-04-07 15:19:18 +01:00 committed by GitHub
commit 52191a20dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 3 deletions

View File

@ -38,6 +38,10 @@ function Get-InstalledDependencyVersion {
}
}
Function Check-Windows11 {
RETURN (Get-ComputerInfo | Select-Object -expand OsName) -match 11
}
Function Test-CommandExist {
Param ($Command)
$OldPreference = $ErrorActionPreference
@ -53,10 +57,9 @@ Function Finish {
Start-Process "wsa://com.android.vending"
}
If (Test-CommandExist pwsh.exe) {
If ((Check-Windows11) -And (Test-CommandExist 'pwsh.exe')) {
$pwsh = "pwsh.exe"
}
Else {
} Else {
$pwsh = "powershell.exe"
}