Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.