App-V 5.0 – Convert Legacy Packages to the new file format
Hi all,
In a previous post we showed how easy it is to test App-V legacy packages, now we’re going to convert automatically these packages to the new App-V 5.0 format.
To complete this we’re going to use the “ConvertFrom-AppvLegacyPackage” cmdlet from the App-V 5.0 Beta 2 release.
ConvertFrom-AppvLegacyPackage |
Converts each package to the new file format. The cmdlet will return all packages that were successfully converted as well as output any errors or warnings found during the package conversion. |
Example: ConvertFrom-AppvLegacyPackage -SourcePath "{legacy pkgs}" -DestinationPath "{vnext pkgs}" |
First we need to locate the directory that holds all the legacy packages within the Powershell console.
The following can be used:
Cd c:\packages\4.6
Once the console window is in that location we need to specify a directory for the converted packages. To do this we are going to use a variable $50Packages.
$50Packages = "C:\Packages\5.0"
You can create this directory manually but if you want Powershell to create this then you can use the command below.
New-Item -Path C:\Packages\5.0 -type directory
As you can see from the directory structure for the legacy packages in our case “C:\Packages\4.6”, each package has its own folder which contains the package assets. You have a choice here, you can create all the folders manually for the 5.0 packages or you can use Powershell to create them automatically for you.
You may have guessed we’re going to use Powershell to do this.
What the command below is doing is listing the contents of the directory in our case “C:\Packages\4.6”, its then looping through each folder and creating a new directory within the $50Packages variable with the name of legacy package.
dir | ForEach-Object { New-Item -Path $50Packages\$_ -type directory }
Now we have the folder structure created we’re going to go ahead and convert each legacy package and set the output to the new $50Packages directory within the defined folder we created above.
dir | ForEach-Object {ConvertFrom-AppvLegacyPackage -SourcePath $_.FullName -DestinationPath $50Packages\$_ }
What you will see when the packages are converting is the status of the conversion and in each folder the output. Once all packages are complete then it’s time to check the output and then test each package functionality in the new App-V 5.0 format.
Disclaimer
The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.
Conclusion
App-V legacy package conversion to the new 5.0 format is an easy process as long as you get the prerequisites completed i.e. directory structure for the new 5.0 packages plus legacy package testing.
If you want a report created as part of the conversion then leverage the report creation from https://blogs.technet.com/b/virtualworld/archive/2012/10/24/app-v-5-0-legacy-package-conversion-report-creation.aspx
David Falkus | Premier Field Engineer | Application Virtualization
Comments
Anonymous
January 01, 2003
As your script in your previous post for testing legacy packages, it runs without any problem. Simple and effective! Thanks for that!Anonymous
April 14, 2015
First, don't panic. Mainstream Support ending doesn't mean that if you are using App-V 4.6 you