Closed JMacIV closed 5 months ago
Heya,
Sorry you're running into this issue. From the provided output it seems like you may be running an old winget version that apparently doesn't have this --disable-interactivity option.
~~Could you check your winget version for me? This can be checked by running the command: winget -v
I have version 1.7.10861 installed for reference.~~
Double checking you're image it's showing you're running winget 1.2.10691, this is quite an old version. Could you try updating winget? I believe this is done through the ms store.
Hey Raphire - You are correct, I am running v1.2.10691. This is the default version that comes in 23H2 ISO.
From this page on Microsoft, if you click on the versions, it seems they added this "--disable-interactivity" flag with 1.4.
I am fairly certain this PS command will silently install the version from the store... But you might also need to run winget update with that ID afterwards. I could not fully test as this Win11 machine doesn't have a MS store account, but this command got through agreement prompts until interrupted for MS store account.
winget install -e -h --id=9nblggh4nns1 --source=msstore --accept-package-agreements
This id value came from this link to the package on MS Store - https://apps.microsoft.com/detail/9nblggh4nns1?rtc=1&hl=en-us&gl=US
Maybe before starting this part of the script, you could add something like
$version = (winget -v) -replace 'v', '' if ($version -lt 1.4) { Write-Host "Need to update winget to version 1.4 or later" winget install -e -h --id=9nblggh4nns1 --source=msstore --accept-package-agreements $version = (winget -v) -replace 'v', '' if ($version -lt 1.4) { winget upgrade -e -h --id=9nblggh4nns1 } }
However, if you are okay with downloading these straight from the GitHub repos....
$version = (winget -v) -replace 'v', '' if ($version -lt 1.4) { Write-Host "Need to update winget to version 1.4 or later. Installing Prerequisite and winget straight from GitHub" Add-AppxPackage https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx Add-AppxPackage https://github.com/microsoft/winget-cli/releases/latest/download/Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle }
I can confirm that the GitHub download version worked and my install to v1.7.11132, and I was immediately able to run the original winget uninstall for OneDrive with the --disable-interactivity flag :)
@JMacIV
Thanks for the detailed response and suggestions. I'll look into this later this weekend!
Closing issue as resolves, see #52
@JMacIV Thanks for your contribution :)
https://github.com/Raphire/Win11Debloat/blob/35fc5738f945ef67756003fe8ddea7964a3f039e/Win11Debloat.ps1#L338
Hey, script is great so far! Found a single bug though.
It seems --disable-interactivity is not available for winget on OneDrive.
Argument name was not recognized for the current command : '--disable-interactivity'
This is Win11 Pro 23H2. OneDrive is still installed :(
Edited to add that I running with params "-Silent -RemoveApps"
Attaching screenshot of running this command manually.