add new store cmdlet to install photos legacy

This commit is contained in:
zoicware
2026-02-12 18:06:10 -05:00
committed by GitHub
parent 2afb6bc715
commit 86ddec0132

View File

@@ -2781,22 +2781,30 @@ function install-photoslegacy {
if (!$appx) { if (!$appx) {
Remove-Item "$($tempDir)Microsoft.PhotosLegacy_8wekyb3d8bbwe*" -Force -Recurse -ErrorAction SilentlyContinue try {
$downloadedfiles = Download-AppxPackage -PackageFamilyName 'Microsoft.PhotosLegacy_8wekyb3d8bbwe' -outputDir "$tempDir" Get-Command store -ErrorAction Stop
$package = $downloadedfiles | Where-Object { $_ -match '\.appxbundle$' } | Select-Object -First 1 #install photos legacy using new store cmdlet
$dependencies = $downloadedfiles | Where-Object { $_ -match '\.appx$' } store install 9NV2L4XVMCXM
if ($package) { }
try { catch {
Add-AppPackage $package -DependencyPath $dependencies -ForceApplicationShutdown Remove-Item "$($tempDir)Microsoft.PhotosLegacy_8wekyb3d8bbwe*" -Force -Recurse -ErrorAction SilentlyContinue
} $downloadedfiles = Download-AppxPackage -PackageFamilyName 'Microsoft.PhotosLegacy_8wekyb3d8bbwe' -outputDir "$tempDir"
catch { $package = $downloadedfiles | Where-Object { $_ -match '\.appxbundle$' } | Select-Object -First 1
Write-status -msg "Can't install PhotosLegacy via appxbundle... make sure you have the appx service enabled" -errorOutput $dependencies = $downloadedfiles | Where-Object { $_ -match '\.appx$' }
} if ($package) {
try {
Add-AppPackage $package -DependencyPath $dependencies -ForceApplicationShutdown
}
catch {
Write-status -msg "Can't install PhotosLegacy via appxbundle... make sure you have the appx service enabled" -errorOutput
}
}
else {
Write-status -msg "Can't find PhotosLegacy Installer" -errorOutput
}
} }
else {
Write-status -msg "Can't find PhotosLegacy Installer" -errorOutput
}
} }
} }