farag2 / Sophia-Script-for-Windows

:zap: The most powerful PowerShell module on GitHub for fine-tuning Windows 10 & Windows 11
MIT License
7.65k stars 578 forks source link

appx is not supported in powershell 7 platform(0x80131539). #472

Closed ZilchBloke closed 1 year ago

ZilchBloke commented 1 year ago

Prerequisites

Steps to reproduce

AppxPackage module is not working with powershell 7.3.3
but AppxPackage module was compatible with default poweshell with windows 10.

Sophia script couldnot remove apps like onenote, spotify, cortana, alarm, phone,xbox, etc. Sophia script cannot be used with older powershell to use AppxPackage module.

Work around : had to remove app individually using powershell 5 that was default in windows 10 (run as Admin): For example for windows alarm app : check using : Get-AppxPackage -allusers *WindowsAlarm*
and then pipe it with Remove-AppxPackage like this :
Get-AppxPackage -allusers *windowsalarm* | Remove-AppxPackage

Windows Version

Windows 10 22H2 (OS built 19045.2788)

Sophia Script version

Sophia Script for Windows 10 PowerShell-7-V 5.16.3

farag2 commented 1 year ago

Hm... let me check. I import the appropriate module for PS 7.

farag2 commented 1 year ago

Also do you have the error screenshot?

ZilchBloke commented 1 year ago

image

farag2 commented 1 year ago

I got it and found out that accidently removed 2 strings. Please wait.

ZilchBloke commented 1 year ago

sure. thanks a lot. you are the best 👍 : )

farag2 commented 1 year ago

Fixed. Just replaced the whole module with a new one: https://raw.githubusercontent.com/farag2/Sophia-Script-for-Windows/master/src/Sophia_Script_for_Windows_10_PowerShell_7/Module/Sophia.psm1