Skip to content

Instantly share code, notes, and snippets.

@Christwiest
Created April 22, 2017 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Christwiest/2fc151c1b4fdd0e4cebc68db8f7a06b2 to your computer and use it in GitHub Desktop.
Save Christwiest/2fc151c1b4fdd0e4cebc68db8f7a06b2 to your computer and use it in GitHub Desktop.
Write-Progress -Activity "Stop VDA Agent"
Stop-Service BrokerAgent -Force
Import-Module AppvClient
Write-Progress -Activity "Sync Packages"
Sync-AppvPublishingServer 1 -Global
Write-Progress -Activity "App-v Staging Registry"
$apps = Get-AppvClientPackage
[System.Collections.ArrayList]$appList = $apps
foreach ($app in $apps){
$package = ($app.packageID).ToString()
$version = ($app.versionID).ToString()
Start-AppvVirtualProcess -AppvClientObject (Get-AppvClientPackage $app.name) cmd.exe
$command = measure-command {
do {
write-host "Staging: " $app.name
sleep 1
}
until (Test-Path "HKLM:\SOFTWARE\Microsoft\AppV\Client\Packages\$package\Versions\$version\RegistryStagingFinished")
write-host "Finished: " $app.name
$appvProcess = get-appvVirtualProcess
Stop-appvclientpackage $app
}}
Write-Progress -Activity "Start VDA Agent"
Start-Service BrokerAgent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment