הסרה ו התקנה מחודשת ליישומון STORE, ווינדוז 10

exprexs

Member
הסרה ו התקנה מחודשת ליישומון STORE, ווינדוז 10.
פתח מסוף הפק' POWERSHELL כ"מנהל".
העתק מכאן את הפק' הבאות, והדבק אותן אל המסוף.


קוד:
$AppName = '*Store*'
Get-AppxPackage $AppName | Remove-AppxPackage
Get-AppXPackage $AppName -AllUsers | % {Add-AppxPackage -Register "$($_.InstallLocation)\AppXManifest.xml" -DisableDevelopmentMode }
Start MS-Windows-Store:
Exit
 
נערך לאחרונה ב:

exprexs

Member
אפשר גם כך, בתסריט.
התסריט הבא בודק תחילה אם היישומון מותקן או לא.
כשהמסוף מגלה שהיישומון לא מותקן, התסריט מתקין אותו.


קוד:
# Apps to Install
$Names = @(
  '*Store*',
  '*Calculator*',
  '*Photos*',
  '*Edge*',
  '*ScreenSketch*',
  '*ZuneVideo*'
)
# Check if the apps are already installed
$InstalledApps = $Names | ForEach-Object {
    Get-AppXPackage -Name $_ -AllUsers -EA:0
}
#
# Display a message based on installation status
if ($InstalledApps -eq $null -or $InstalledApps.Count -lt $Names.Count) {
    # Display names of apps that are not installed
    $NotInstalledApps = $Names | Where-Object { $_ -notin $InstalledApps.Name }
    if ($NotInstalledApps.Count -eq 0) {
        Write-Host 'All apps are already installed. No further action needed.'
    } else {
        $NotInstalledApps | ForEach-Object {
            Write-Host "App $_ Is Not Installed."
        }
#
        # Prompt the user to install the apps
        Write-Host "Would you like to install the '$($NotInstalledApps -join "', '")' Apps? (Y/N)"
        $Choice = Read-Host
        if ($Choice -eq 'Y' -or $Choice -eq 'y') {
            # Install the apps that are not already installed
            $NotInstalledApps | ForEach-Object {
                Add-AppxPackage -DisableDevelopmentMode -Register "$((Get-AppxPackage -Name $_).InstallLocation)\AppXManifest.xml"
            }
#
            Write-Host 'Apps have been Installed Successfully.'
        } else {
            Write-Host 'Canceled. No Action Performed.'
        }
    }
} else {
    Write-Host 'All apps are already installed. No further action needed.'
}
#
 
למעלה