Advertisement
PC_Aide

add_remove_inside package_sync (file appv).ps1

Nov 4th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <#
  2.     Add-appvClientPackage: https://docs.microsoft.com/en-us/powershell/module/appvclient/add-appvclientpackage?view=win10-ps
  3.  
  4.     Mount-AppvClientPackage: https://docs.microsoft.com/en-us/powershell/module/appvclient/mount-appvclientpackage?view=win10-ps
  5.  
  6.     Publish-AppvClientPackage: https://docs.microsoft.com/en-us/powershell/module/appvclient/publish-appvclientpackage?view=win10-ps
  7.  
  8.     Sync-AppvPublishingServer: https://docs.microsoft.com/en-us/powershell/module/appvclient/sync-appvpublishingserver?view=win10-ps
  9.  
  10. ****************************************************************************************************************************
  11.     Elevated : yes
  12. ***************************************************************************************************************************
  13. #>
  14.  
  15. #File from UNC -->  \\*.appv
  16. $nameappV="\\192.168.1.21\share\7zip.appv"
  17. Add-AppvClientPackage $nameappV | Mount-AppvClientPackage | Publish-AppvClientPackage -Global  # Mount (optional)
  18. #O/P:
  19.  
  20. #"in the appv-v buuble" to checking (environment variabble, virtual registry + native {arg -> -m second instance regedit}, and so on) with cmd,...)
  21. #Doc : https://support.microsoft.com/en-ca/help/2848278/how-to-launch-processes-inside-the-app-v-5-0-virtualized-environment
  22. $inside_package = get-appvClientPackage "name of package"
  23. start-appVirtualProcess -filePath c:\winsows\system32\cmd.exe -appvClientObject $inside_package
  24. #O/P:
  25.  
  26. #Remove cahche (%programData%\app-v\<PackageID>\<VersionID>)
  27. #
  28. Get-AppvClientPackage -Name $nameappV | Remove-AppvClientPackage
  29. #
  30. Remove-appvClientPackage -name $nameAppv
  31. #O/P:
  32.  
  33. #Synchronization
  34. #By name
  35. Sync-AppvPublishingServer -Name "pc_aide" -force
  36. #By ID
  37. Sync-AppvPublishingServer -serverID 1 -force
  38. #O/P:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement