Again and again we had to find out that sometimes App-V shortcuts in the user profile or even globally on the back. This can happen for various reasons. In particular, after a missing unpublishing for a user even if the package no longer exists. For nonpersistent VDI or Terminal Server this is no problem in the global context under C:\ProgramData\Microsoft\Windows\Start Menu\Programs, because the systems are always in their original state after a reboot.For user profiles, however, this is a problem.
Since I have a little more time right now, I finally get to publish the script I created a long time ago for this problem.


How do I use this?The script can be included in the logon or logoff script or run independently. It can also be used via the Task Scheduler.Important is, it must run in the user context for links in the user directory and in the system context for the links of the system.The call Clean-AppVLinks.ps1 only cleans up the start menu.

App V Cleanup Script

Command Line Switches:

		delete all orphan app-v shortcuts of unpublished App-V applications
        In App-V remain for a unpublishing sometimes shortcuts on the desktop or are in the Start menu 
        (because of Profile Management or in use etc). This script looks which applications are published 
        and delete the shortcuts of unreleased packages

	.PARAMETER  -Desktop
		-Desktop : Clean up App-V Desktop icons

	.PARAMETER  -Global
		-Global : Clean up Global links (c:\programdata\Microsoft\Windows\start menu, c:\Users\Public\Desktop)
        Need to run as Administrator

	.PARAMETER  -CleanUpEmptyFolders
		-CleanUpEmptyFolders : Not an App-V Feature. Search for every empty folder in the "Start Menu" with the exception of "Autostart" and "Startup" and delete these folders.
        After a app-v synchonisation the App-V links are deletet. With exception of the parent folder

        & Clean-AppVLinks.ps1 -Global -Desktop
        & Clean-AppVLinks.ps1 -Desktop

     Andreas Nick 2020 without warranty




zip-16App_V-Cleanup-PowerShell-Script HOT

Created Tuesday, April 21 2020 14:40
Changed Tuesday, April 21 2020 14:40
Version 1.0
Size 10.42 KB
Created by Andreas Nick
Changed by Andreas Nick
Downloads 299
License Nick Informationstechnik Tool LicenceTooltip