mirror of
https://github.com/MustardChef/WSABuilds.git
synced 2024-11-14 15:45:06 +01:00
Fix Windows 10 installation Appx commands error when pwsh.exe installed
Issue PowerShell/PowerShell#19031 still exists on Windows 10 and still not be fixed
This commit is contained in:
parent
7da3a914a7
commit
dbb4a085b0
@ -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"
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user