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

@@ -2780,23 +2780,31 @@ function install-photoslegacy {
$appx = Get-AppxPackage -AllUsers | Where-Object { $_.PackageFullName -like '*PhotosLegacy*' }
if (!$appx) {
Remove-Item "$($tempDir)Microsoft.PhotosLegacy_8wekyb3d8bbwe*" -Force -Recurse -ErrorAction SilentlyContinue
$downloadedfiles = Download-AppxPackage -PackageFamilyName 'Microsoft.PhotosLegacy_8wekyb3d8bbwe' -outputDir "$tempDir"
$package = $downloadedfiles | Where-Object { $_ -match '\.appxbundle$' } | Select-Object -First 1
$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
}
try {
Get-Command store -ErrorAction Stop
#install photos legacy using new store cmdlet
store install 9NV2L4XVMCXM
}
catch {
Remove-Item "$($tempDir)Microsoft.PhotosLegacy_8wekyb3d8bbwe*" -Force -Recurse -ErrorAction SilentlyContinue
$downloadedfiles = Download-AppxPackage -PackageFamilyName 'Microsoft.PhotosLegacy_8wekyb3d8bbwe' -outputDir "$tempDir"
$package = $downloadedfiles | Where-Object { $_ -match '\.appxbundle$' } | Select-Object -First 1
$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
}
}
}