App-V 5.0: Package Conversion Script
A quick PowerShell script with logging to convert a directory full of App-V packages.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | $src = "<source path>\" $dst = "<destination path>" $logdir = "<logfile location>\ConversionLog.txt" Import -Module AppvPkgConverter $list = dir $src | where {$_.mode -match "d" } If(( Test-Path $logdir ) -eq $false ) { New-Item ( $logdir ) -Type File } foreach ( $i in $list ) { Write-Host $src $i $conv = ConvertFrom -AppvLegacyPackage -SourcePath $src $i -DestinationPath $dst If( $conv .Error -ne $null -or $conv .Warnings -ne $null ) { Add-Content -Path $logdir -Value ( $conv .Source+ " appears to have failed...`n" ) Add-Content -Path $logdir -Value ( "Error: " + $conv .Errors+ "`nWarning: " + $conv .Warnings+ "`n" ) }elseif( $conv .Information -ne $null ){ Add-Content $logdir $conv .Information "`n" }else{ Add-Content -Path $logdir -Value ( $conv .Source + " completed ok, no Errors or Warnings...`n" ) } } |