Skip to content

Commit 52191a2

Browse files
authored
Merge pull request MustardChef#357 from 1552980358/master
Fix Windows 10 installation Appx commands error when pwsh.exe installed
2 parents 7da3a91 + c67866a commit 52191a2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

‎MagiskOnWSA/installer/Install.ps1‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ function Get-InstalledDependencyVersion {
3838
}
3939
}
4040

41+
Function Check-Windows11 {
42+
RETURN (Get-ComputerInfo | Select-Object -expand OsName) -match 11
43+
}
44+
4145
Function Test-CommandExist {
4246
Param ($Command)
4347
$OldPreference = $ErrorActionPreference
@@ -53,10 +57,9 @@ Function Finish {
5357
Start-Process "wsa://com.android.vending"
5458
}
5559

56-
If (Test-CommandExist pwsh.exe) {
60+
If ((Check-Windows11) -And (Test-CommandExist 'pwsh.exe')) {
5761
$pwsh = "pwsh.exe"
58-
}
59-
Else {
62+
} Else {
6063
$pwsh = "powershell.exe"
6164
}
6265

0 commit comments

Comments
 (0)