mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Remove New-WinGetSettings, since stable release of WinGet now supports MSStore app downloads
This commit is contained in:
@@ -1700,42 +1700,6 @@ function Confirm-WinGetInstallation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function New-WinGetSettings {
|
|
||||||
$wingetSettingsFile = "$env:LOCALAPPDATA\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json"
|
|
||||||
$wingetSettings = @(
|
|
||||||
'{'
|
|
||||||
' "$schema": "https://aka.ms/winget-settings.schema.json",'
|
|
||||||
' '
|
|
||||||
' // For documentation on these settings, see: https://aka.ms/winget-settings'
|
|
||||||
' "experimentalFeatures": {'
|
|
||||||
' "storeDownload": true'
|
|
||||||
' },'
|
|
||||||
' "logging": {'
|
|
||||||
' "level": "verbose"'
|
|
||||||
' }'
|
|
||||||
'}'
|
|
||||||
)
|
|
||||||
$wingetSettingsContent = $wingetSettings -join "`n"
|
|
||||||
if (Test-Path -Path $wingetSettingsFile -PathType Leaf) {
|
|
||||||
$jsonContent = Get-Content -Path $wingetSettingsFile -Raw
|
|
||||||
# Check if storeDownload feature is already enabled
|
|
||||||
WriteLog "Checking if storeDownload feature is enabled in WinGet configuration."
|
|
||||||
if ($jsonContent -match '"storeDownload"\s*:\s*true') {
|
|
||||||
WriteLog "WinGet's settings.json file is already configured to enable the storeDownload feature."
|
|
||||||
return
|
|
||||||
}
|
|
||||||
# Back up existing settings.json file
|
|
||||||
WriteLog "The storeDownload feature is not enabled in WinGet configuration."
|
|
||||||
$backupWingetSettingsFile = $wingetSettingsFile + ".bak"
|
|
||||||
if (-not (Test-Path -Path $backupWingetSettingsFile -PathType Leaf)) {
|
|
||||||
WriteLog "Backing up existing WinGet settings.json file to $backupWingetSettingsFile"
|
|
||||||
Copy-Item -Path $wingetSettingsFile -Destination $backupWingetSettingsFile -Force | Out-Null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
WriteLog "Creating WinGet settings.json file to allow the storeDownload feature. Writing file to $wingetSettingsFile"
|
|
||||||
$wingetSettingsContent | Out-File -FilePath $wingetSettingsFile -Encoding utf8 -Force
|
|
||||||
}
|
|
||||||
|
|
||||||
function Add-Win32SilentInstallCommand {
|
function Add-Win32SilentInstallCommand {
|
||||||
param (
|
param (
|
||||||
[string]$AppFolder,
|
[string]$AppFolder,
|
||||||
@@ -1962,7 +1926,6 @@ function Get-Apps {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($storeApps) {
|
if ($storeApps) {
|
||||||
New-WinGetSettings
|
|
||||||
if (-not (Test-Path -Path $storeAppsFolder -PathType Container)) {
|
if (-not (Test-Path -Path $storeAppsFolder -PathType Container)) {
|
||||||
New-Item -Path $storeAppsFolder -ItemType Directory -Force | Out-Null
|
New-Item -Path $storeAppsFolder -ItemType Directory -Force | Out-Null
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user