windows 10 重新安裝 默認軟件
阿新 • • 發佈:2018-03-08
gen OS each war rst current user led environ
1 管理員權限打開powershell
2 輸入 Set-ExecutionPolicy Unrestricted 出現選項,輸入Y
3 將下列代碼粘貼輸入:
# Get all the provisioned packages $Packages = (get-item ‘HKLM:\Software\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Applications‘) | Get-ChildItem # Filter the list if provided a filter $PackageFilter = $args[0] if ([string]::IsNullOrEmpty($PackageFilter)) { echo "No filter specified, attempting to re-register all provisioned apps." } else { $Packages = $Packages | where {$_.Name -like $PackageFilter} if ($Packages -eq $null) { echo "No provisioned apps match the specified filter." exit } else { echo "Registering the provisioned apps that match $PackageFilter" } } ForEach($Package in $Packages) { # get package name & path $PackageName = $Package | Get-ItemProperty | Select-Object -ExpandProperty PSChildName $PackagePath = [System.Environment]::ExpandEnvironmentVariables(($Package | Get-ItemProperty | Select-Object -ExpandProperty Path)) # register the packageecho "Attempting to register package: $PackageName" Add-AppxPackage -register $PackagePath -DisableDevelopmentMode }
windows 10 重新安裝 默認軟件