Find app installed in PC

Deleted
Not applicable

Hello 

 

I have a list of application which is pre installed in PC and i want to find out using powershell. so basically i want to write a script which will check that which app is installed from th app list. in my app list i have kind of candy crush, Farmville. 

6 Replies

You can report on those via Get-AppxPackage/Get-AppxProvisionedPackage, however the good folks at Microsoft have decided to be more and more annoying which each new release of W10 and the latest ones also feature some other mechanisms. Such as downloading apps directly upon detecting internet connectivity. They don't show up in the list of preinstalled apps, but will still be deployed and you have to deploy some registry keys as well...

 

TL;DR version, read here: https://www.tenforums.com/tutorials/68217-turn-off-automatic-installation-suggested-apps-windows-10-...

I just want to write a script will check that any of the following script is running or not. i tried what you suggested and still it is not working properly. Here is my 

 

ForEach($App in $AppsList) {

$software = (Get-AppxPackage -allusers $App).PackageFullName
$installed = (Get-ProvisionedAppxPackage -online | Where {$_.DisplayName -eq $software}) -ne $null

if ($installed) {
Write-Host "'$App' not found.";
} else {
Write-Host "'$App' found."
}
}

For starters the PackageFullName property is different from the DisplayName one, so you should not be comparing them directly. The Get-ProvisionedAppxPackage lists apps that are included in the windows image, not necessarily ones that are installed. If you only care about the installed ones, use just Get-AppxPackage, which will cover any app, regardless of the source it was installed from (as mentioned above, some will be directly downloaded from the internet).

Hi @Vasil Michev

 

As you said i am using only get-Appxpackage but still its not working how it suppose to work. i have a list of package which need to be find apps is installed in pc but some application is not installed and it still says it is installed.

$PackageFullName = (Get-AppxPackage -allusers $App).PackageFullName
write-host $PackageFullName
if ($PackageFullName)
{
Write-Host "Removing Package: $App"
}
else
{
Write-Host "Unable to find package: $App"
}
Here is the update code
$PackageFullName = (Get-AppxPackage -allusers $App).PackageFullName
write-host $PackageFullName
if ($PackageFullName)
{
Write-Host "Package found : $App"
}
else
{
Write-Host "Unable to find package: $App"
}

As Vasil wrote, don't use PackageFullname. Use DisplayName.

Here is a script I run during computer deployment:

 

[CmdletBinding()]
Param()
##
## Remove everything but StickyNotes, Paint, Photos, Calc
##
## Michael B. Smith
## April 4, 2018
## michael@smithcons.com
##
## No warranties, etc. etc.
##
## Somewhat based on
##
## But do NOT do a 'Get-AppxPackage | Remove-AppxPackage -AllUsers'.
## You will break Windows.
##
## The initial posting on this topic from Michael Niehaus in 2015:
##
$keepers = @(
    'Microsoft.MicrosoftStickyNotes',
    'Microsoft.MSPaint',
    'Microsoft.Windows.Photos',
    'Microsoft.WindowsCalculator',
    'Microsoft.StorePurchaseApp',
    'Microsoft.WindowsStore'
)
$packages = Get-AppxProvisionedPackage -Online
foreach( $package in $packages )
{
    if( $keepers -contains $package.DisplayName )
    {
        Write-Verbose "Will NOT remove $( $package.DisplayName )"
    }
    else
    {
        Write-Verbose "WILL remove $( $package.DisplayName )"
        Write-Verbose "PackageFullName $( $package.PackageName )"
        Remove-AppxPackage -Package $package.PackageName -AllUsers -Verbose
        Remove-AppxProvisionedPackage -Online -PackageName $package.PackageName -Verbose -ErrorAction SilentlyContinue
    }
}
$packages = $null