Answered by:
How can i do a clean package removal in App-V 5?

Question
-
When i execute the "Get-AppvclientPackage -all | Remove-AppvClientPackage" the powershell says the all the package has been removed. i can find the entries of all the packages have been removed from Programdata. But the following details of the packages are still exists in the client machine.
1. Empty folders with package GUID as the name in %programdata%\Appv location. (this can be ignored)
2. Package related entries in %Appdata% and %LocalAppdata%.
3. Package related entries in HKCU hives.
Can you please guide me how can i make sure that all the package related entries are removed?
Thanks,
Prem
Thursday, January 16, 2014 1:33 PM
Answers
-
Are you using the App-V Management Server in your environment at all?
Also take a look here: http://blogs.technet.com/b/appv/archive/2012/12/03/app-v-5-0-client-powershell-deep-dive.aspx#_Managing_packages
$Contoso = Get-AppvClientPackage -Name Contoso*
# Unpublish the package
Unpublish-AppvClientPackage $Contoso
# Remove the package
Remove-AppvClientPackage $ContosoPLEASE MARK ANY ANSWERS TO HELP OTHERS Blog: rorymon.com Twitter: @Rorymon
- Marked as answer by Premkumar.K Friday, January 17, 2014 9:55 AM
Thursday, January 16, 2014 1:56 PM -
Prem,
You could use a script, for example:
$CurrentPolicy = Get-ExecutionPolicy -Scope LocalMachine Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force Import-Module "C:\Program Files\Microsoft Application Virtualization\Client\AppvClient\AppvClient.psd1" net stop AppVClient Get-AppvClientPackage -All | Remove-AppVClientPackage net stop AppVClient Set-Location -Path env: Remove-Item C:\ProgramData\App-V\* -recurse $UserAppData = Get-Content -Path appdata Remove-Item $UserAppData\Microsoft\AppV\Client\Catalog\Packages\* -recurse Remove-Item $UserAppData\Microsoft\AppV\Client\VFS\* -recurse $UserAppData = Get-Content -Path localappdata Remove-Item $UserAppData\Microsoft\AppV\Client\Integration\* -recurse Remove-Item $UserAppData\Microsoft\AppV\Client\VFS\* -recurse net start AppVClient Get-AppvPublishingServer | Sync-AppvPublishingServer Set-ExecutionPolicy -ExecutionPolicy $CurrentPolicy -Force
Here are two sites with scripts that also delete the files (not the registry entries):
http://myitforum.com/myitforumwp/2013/06/01/powershell-delete-app-v-cache/
- Marked as answer by Premkumar.K Friday, January 17, 2014 2:14 AM
- Unmarked as answer by Premkumar.K Friday, January 17, 2014 2:16 AM
- Marked as answer by Premkumar.K Friday, January 17, 2014 9:55 AM
Thursday, January 16, 2014 8:08 PM
All replies
-
Are you using the App-V Management Server in your environment at all?
Also take a look here: http://blogs.technet.com/b/appv/archive/2012/12/03/app-v-5-0-client-powershell-deep-dive.aspx#_Managing_packages
$Contoso = Get-AppvClientPackage -Name Contoso*
# Unpublish the package
Unpublish-AppvClientPackage $Contoso
# Remove the package
Remove-AppvClientPackage $ContosoPLEASE MARK ANY ANSWERS TO HELP OTHERS Blog: rorymon.com Twitter: @Rorymon
- Marked as answer by Premkumar.K Friday, January 17, 2014 9:55 AM
Thursday, January 16, 2014 1:56 PM -
Rorymon,
Thankyou so much. Its clearing the package entries completely. However the empty folders are remaining. Is this cause any issue? because i am getting the below error on "Sync-AppvPublishingServer 1".
"Part or all packages publish failed.
published: 0
failed: 5
Please check the error events of 'Configure/Publish Package' before this message for the details of the failure.Event ID:19104"
Note:
I am adding and publishing packages via App-V ManagementConsole (webTool) not from powershell command.
I am using AppV 5.0 SP2. and Citrix Xenapp 6.5 with network share roaming profile.
Thanks,
Prem
Thursday, January 16, 2014 2:32 PM -
Prem,
You could use a script, for example:
$CurrentPolicy = Get-ExecutionPolicy -Scope LocalMachine Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force Import-Module "C:\Program Files\Microsoft Application Virtualization\Client\AppvClient\AppvClient.psd1" net stop AppVClient Get-AppvClientPackage -All | Remove-AppVClientPackage net stop AppVClient Set-Location -Path env: Remove-Item C:\ProgramData\App-V\* -recurse $UserAppData = Get-Content -Path appdata Remove-Item $UserAppData\Microsoft\AppV\Client\Catalog\Packages\* -recurse Remove-Item $UserAppData\Microsoft\AppV\Client\VFS\* -recurse $UserAppData = Get-Content -Path localappdata Remove-Item $UserAppData\Microsoft\AppV\Client\Integration\* -recurse Remove-Item $UserAppData\Microsoft\AppV\Client\VFS\* -recurse net start AppVClient Get-AppvPublishingServer | Sync-AppvPublishingServer Set-ExecutionPolicy -ExecutionPolicy $CurrentPolicy -Force
Here are two sites with scripts that also delete the files (not the registry entries):
http://myitforum.com/myitforumwp/2013/06/01/powershell-delete-app-v-cache/
- Marked as answer by Premkumar.K Friday, January 17, 2014 2:14 AM
- Unmarked as answer by Premkumar.K Friday, January 17, 2014 2:16 AM
- Marked as answer by Premkumar.K Friday, January 17, 2014 9:55 AM
Thursday, January 16, 2014 8:08 PM -
Hi Premkumar.K,
I also clean packages with same command:
"Get-AppvclientPackage -all | Remove-AppvClientPackage"
...and still sync works fine after that. And i noticed also - this above command leaves empty package folders in programdata.
I our cases this is not generating any sync issues.
(AppV5SP1/SP2,XA65/XD7)
Thursday, January 16, 2014 8:13 PM