From 86ddec0132e753c96ddea3df637ed59b3ea12149 Mon Sep 17 00:00:00 2001 From: zoicware <118035521+zoicware@users.noreply.github.com> Date: Thu, 12 Feb 2026 18:06:10 -0500 Subject: [PATCH] add new store cmdlet to install photos legacy --- RemoveWindowsAi.ps1 | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/RemoveWindowsAi.ps1 b/RemoveWindowsAi.ps1 index 332a7e0..19ba175 100644 --- a/RemoveWindowsAi.ps1 +++ b/RemoveWindowsAi.ps1 @@ -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 - } + } }