Here are 2 quick lines of code that help you uninstall a Program:
$Prog = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -match “ProgramName”}
$Prog.Uninstall()
Reading time: 1 min
Here are 2 quick lines of code that help you uninstall a Program:
$Prog = Get-WmiObject -Class Win32_Product | Where-Object{$_.Name -match “ProgramName”}
$Prog.Uninstall()
If you need to deploy a MS Store App for example through Intune or GPO, here is my script:
First of all you need the App ID of the store app. Go to https://apps.microsoft.com/ search for the app and select it. In the URL you will see something like this: https://apps.microsoft.com/detail/9nw77489ngj0?hl=en-us&gl=US. 9nw77489ngj0 is the App ID.
Now the script:
Start-Transcript -Path “C:\3cx_msstore.log”
$appid=”9NW77489NGJ0″
winget install -e –id $appid –source msstore –accept-source-agreements –accept-package-agreements
winget upgrade –id $appid
Stop-Transcript
A follow-up on the last post here is another way to run msiexec through PowerShell.
For example, here is how you can install OCS inventory agent with some parameters. OCS is an open source inventarization system.
Start-Process -FilePath .\OCS-Windows-Agent-Setup-x64.exe -ArgumentList ‘/S /NOSPLASH /NOW /SERVER=https://inventory.ajni.it//ocsinventory /TAG=”a” /SSL=0’
References:
https://www.ajni.it/2024/04/run-msiexec-transforms-with-powershell/
Here is a tip if you are having issues with Microsoft 365 Apps when trying to login to activate Office (error 1200).
References:
Having performance problems when deleting one single file or folder? File Explorer takes 2-3 seconds to “calculate” something before deleting? Deleting automatic destinations might help you out. I had a case where this file was 4MB big, which is a lot for only text/paths.
Delete everything under:
C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations
The big file in question is f01b4d95cf55d32a.automaticDestinations-ms. You might want to delete this file only. But I deleted everything.
References: