Once you have the App-V OneGet/Microsoft Package Management provider installed, how the heck do you use it?!
The App-V provider supports locating, installing and uninstalling App-V 5.x packages from a file path/share (the use of HTTP/S streaming is not supported). To be able install App-V packages we first need to tell the provider where it can find packages.
Note: The following screenshots were taken from a Windows 8.1 x64 WMF 4.0 machine with the OneGet experimental build installed.
Registering a App-V Package Source
Before the App-V provider can locate any packages, you need to register one or more package sources. By default, the only package source that is registered automatically is the App-V Package Source Root, but only if present in the App-V client configuration.
Each package source requires at least a name and location. When registering a package source you will also need to tell OneGet what provider the source is associated with. The following shows adding a local folder as an App-V provider package source.
In addition, each package source can be trusted (they’re not by default). If a package source is untrusted – like the Chocolatey public feed – you will see a prompt when installing packages. When a package source is trusted, you are not prompted when installing packages. The examples shown here do not utilise a trusted package source.
Discovering App-V Packages
The OneGet/Package Management will search all registered package sources by default. For example, searching for ‘Chrome’ will search Chocolatey, the PSGallery and the ‘DropBox’ package source for packages matching ‘Chrome’.
That’s quite a few packages and we certainly would not want to install all of them! Fortunately, Find-Package supports filtering packages by provider, version and/or source.
The versioning semantics of App-V packages with OneGet/Package Management will probably be the subject of another blog post. Note: the package summary is read directly from the App-V package description – you do add a description to each sequence right?!
Installing App-V Packages
All packages are installed with the OneGet/PackageManagement Install-Package cmdlet – regardless of provider. There are two primary ways of installing available App-V packages with the App-V provider; Find-Package and Install-Package.
The Install-Package cmdlet will take the output of the Find-Package cmdlet via the pipeline. Therefore, we can install the ‘Microsoft Expression Web’ App-V package using this method.
Note: there are only calls to Get-AppvClientPackage to show that there was nothing registered in the App-V client before Install-Package was run and that the package was registered afterwards. The Get-AppvClientPackage commands are not required!
Package names can also be specified on the Install-Package cmdlet itself. This also supports the
–ProviderName, -Source and/or –RequiredVersion switches to filter the installation source etc.
Removing App-V Packages
There may be occasions when you might need to remove an App-V package or two. The great thing about the OneGet/Package Management module is that it will enumerate packages registered in the App-V client – regardless of installation method. Therefore, if you already have App-V packages registered, you can still use the App-V OneGet provider without having to make any changes :).
The following example depicts that nothing is registered in the App-V client at first, then Notepad++ is registered outside of OneGet via the native App-V cmdlets and is still detected.
Packages can be removed either using the Uninstall-Package cmdlet or piped from the Get-Package cmdlet into the Uninstall-Package cmdlet. The following command will uninstall all registered App-V packages.
Unregistering Package Sources
As and when you need to remove package sources, you can use the Unregister-PackageSource cmdlet with the package source name.
Note: the OneGet/Package Management App-V provider does not currently support the –Location parameter of the Unregister-PackageSource cmdlet. It is on the backlog and we are working on it 😉
Summary
Remember that this is an open-source project. This means that if there are changes you would like to see implemented or you have found a bug, head over to the project site and start to contribute!