During an upgrade to Powershell 5 for a customer, we found that App-V applications would no longer work. This was during an upgrade to PS 3 to PS 5 on Windows 7. The PS 5 upgrade also had a dependency of PS 4, which may be the root cause of the issue. Microsoft may have taken out the PS 4 dependency for the latest PS version upgrades since PS 5.0.
We saw an issue when importing the App-V module, it would fail unless we re-installed the App-V client. The error may be something like:
“The specified module ‘appvclient’ was not loaded because no valid module file was found in any module directory.”
Well none of us want to repair or re-install the App-V client after an upgrade. After a bit of digging, we found that the install of PowerShell deleted the modules in the PowerShell directory.
Just adding a few extra lines to your install can remedy the issue. Add the below lines to your Powershell installation script and automate the fix during the install. Be sure to put it after the PowerShell 5 install and prior to the reboot.
if (Test-Path ‘c:\Program Files\Microsoft Application Virtualization\Client\AppvClient\AppVClientCmdlets.psm1’)
{
New-Item -ItemType Directory -Force -Path ‘c:\Windows\System32\WindowsPowerShell\v1.0\Modules\AppVclient’
Copy-Item -Path ‘c:\Program Files\Microsoft Application Virtualization\Client\AppvClient\*.*’ -Destination ‘c:\Windows\System32\WindowsPowerShell\v1.0\Modules\AppVclient’
#Import-Module ‘c:\Program Files\Microsoft Application Virtualization\Client\AppvClient\AppVClientCmdlets.psd1’
Import-Module ‘c:\Program Files\Microsoft Application Virtualization\Client\AppvClient\AppVClientCmdlets.psm1’
}
Hope this helps!