Our company has a UWP application, DentalDial that is packaged as a .msix. This package is installed for all users with the ProvisionedAppPackage powershell commands.
Command used for install:
Add-AppxProvisionedPackage -Online -PackagePath "C:\some\path\DentalDialInstaller_3.0.7.0\DentalDialInstaller_3.0.7.0_x86.msixbundle" -SkipLicense
This seemingly works fine, the app package is installed for all users, without problem.
As seen from the output of
Get-AppPackage -AllUsers
The issues arise when trying to uninstall the package for all users. Following guides form here https://www.advancedinstaller.com/per-machine-msix.html I have tried all possible path combinations I could think off, with most of the commands seeming to execute successfully but change nothing
Remove-AppPackage -Package "DentalDialInstaller_3.0.7.0_x86__sxsx6zjqc160p" -AllUsers
Remove-AppPackage -Package "DentalDialInstaller_3.0.7.0_x64__sxsx6zjqc160p" -AllUsers
Remove-AppPackage -Package "DentalDialInstaller_3.0.7.0_neutral__sxsx6zjqc160p" -AllUsers
Remove-AppPackage -AllUsers -package "DentalDialInstaller.DentalDial_3.0.7.0_x86__sxsx6zjqc160p"
Remove-AppPackage -AllUsers -package "DentalDialInstaller_3.0.7.0.DentalDial_3.0.7.0_x86__sxsx6zjqc160p"
Any ideas as to how to properly uninstall this app packages for all users would be greatly appreciated, Thanks!
Related
I try to list all applications, choose one of them and uninstall it, kind of like in control panel.
$package = get-package | Out-GridView -PassThru
Get-Package -Name $package.Name | Uninstall-Package
when I execute this and choose Google Chrome, it doesn't do much.
this is probably a dumb question, not new to PowerShell but not veteran either
The Uninstall-Package cmdlet can't delete entries where "ProviderName" is "Programs"
Example:
get-package *chrome*
Name Version Source ProviderName
---- ------- ------ ------------
Google Chrome 105.0.5195.127 Programs
In general Programs with "ProviderName" property as "Programs" are ones that are installed via .exe .
If you want to uninstall packages with PackageManagement/PowerShellGet they need to be installed by PackageManagement/PowerShellGet.
Alternative would be to install Chocolatey Package Provider and it should be able to delete it
I am currently testing Microsoft Deployment Workbench for automated Windows installation.
I have created a workflow with Windows 11 and would like to install the various programs via chocolatey after the Windows 11 installation.
Here you can see my workflow:
chocolatey is installed with a .bat script using:
command line: cmd.exe /c "%SCRIPTROOT%\BTNHD\chocoinstall.bat"
with the following content:
#powershell -noProfile -ExecutionPolicy unrestricted -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
then we restart the computer
then the script is started with the different programs, which looks like this:
command line: cmd.exe /c "%SCRIPTROOT%\BTNHD\installtemplate.bat"
with the following content:
choco install firefox --yes
choco install vlc --yes
Unfortunately it installs only the first software in the list at step 3, in my case Firefox and after that it takes a while and aborts with these error messages:
Now I have already tried the following things:
the reboot removed unfortunately no improvement
for each program a separate script and accordingly a separate installation step
tested other programs
changed the script
unfortunately there is nothing in the chocolatey log that can help me.
If I start the script manually, but everything works fine.
I currently do not know what to do and hope someone can help me, if there is any information missing, please let me know.
Thank you!
I try to install Haskell with chcolatey. When I run choco install ghc it downloads ghc as expected. But at some point it says this:
Access to the path 'C:\tools\ghc-9.0.1-x86_64-unknown-mingw32' is denied.
Renamed C:\tools\ghc-9.0.1-x86_64-unknown-mingw32 to C:\tools\ghc-9.0.1
ERROR: Could not find a part of the path 'C:\tools\ghc-9.0.1\bin\ghcii.sh'.
The install of ghc was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\ghc\tools\chocolateyInstall.ps1'.
See log for details.
I run this command in the Windows PowerShell as Administrator, so why he can't access this folder?
Im using Windows 10 Pro.
Found the solution!!!
My Antivirus-Software blocked the access. I just deactivated it for the time of the installation and it worked fine.
I'm having an issue with this script. For some reason, it was working previously and now it is not. It is now returning with:
Invoke-GPUpdate : The term 'Invoke-GPUpdate' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or
if a path was included, verify that the path is correct and try again.
Write-Host "Refreshing Group Policies on the local machine......."
Invoke-GPUpdate -Computer $computer -RandomDelayInMinutes 0 -force ForegroundColor Cyan
Start-Sleep -s 20
Invoke-GPUpdate is part of the GroupPolicy module. GroupPolicy is not available by default, but is included with RSAT Tools. What likely happened is a major update to Windows occurred and in this case, if RSAT Tools isn't installed as a Windows Feature (it is only available as a "Feature on Demand" beginning with the Windows 10 October 2018 Update, which is build 17763), it will get removed during the update and needs to be re-installed.
This technically happens with the feature as well I believe, as RSAT Tools is still linked to specific versions of Windows, but the upgrade process will re-install the feature if it was already present.
Installing GroupPolicy RSAT Tools as a feature with Windows PowerShell
If you have Windows 1809 or newer, you can install as a feature using the following command:
Get-WindowsCapability -Name 'Rsat.GroupPolicy.*' -Online | Where-Object { $_.State -ne 'Installed' } | Add-WindowsCapability -Online
You can do the same with other RSAT Tools as well (the features are modularized per their functionality). To enumerate all of them:
Get-WindowsCapability -Name RSAT*
Once again, this requires Windows 1809 or newer or the features will be unavailable. You'll have to install it by using the MSU provided by Microsoft for your Windows version.
I am trying to uninstall packages using the PowerShell command and script. Every time I run the command it runs and does nothing moreover can't find any logs of it. I tried Microsoft documentation https://learn.microsoft.com/en-us/powershell/module/packagemanagement/uninstall-package?view=powershell-7.1 In stack overflow similar problem Powershell: Find installed Antivirus, filtering out Windows Defender to find the installed antivirus. But When I want to uninstall it simply does nothing.
# Get-Package -Provider Programs -IncludeWindowsInstaller
$appToRemove = Get-Package -IncludeWindowsInstaller -Name Avast
Write-Output $appToRemove
Uninstall-Package $appToRemove -Force -AllVersions -Confirm
I have tried several solutions and stuck for 1 week. Can anyone please help me? Thank you.