Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions WinGet-Essentials/WinGet-Essentials.psd1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
RootModule = 'WinGet-Essentials.psm1'
ModuleVersion = '1.12.0'
ModuleVersion = '1.12.1'
GUID = '2a2b6c24-d6cc-4d59-a456-e7ccd90afd03'
Author = 'Jon Carrier'
CompanyName = 'Unknown'
Expand All @@ -16,7 +16,7 @@

RequiredModules = @(
@{ModuleName = 'TextTable'; ModuleVersion = '1.0.2'; Guid = '16a5ab4c-4d8c-42d6-8f72-227aea552a84'},
@{ModuleName = 'TableUI'; ModuleVersion = '1.8.0'; Guid = 'b5eb9ef8-a2ef-40d4-a8d5-46d91ab7060e'}
@{ModuleName = 'TableUI'; ModuleVersion = '1.9.1'; Guid = 'b5eb9ef8-a2ef-40d4-a8d5-46d91ab7060e'}
)
FunctionsToExport = @('Update-WinGetEssentials', 'Update-WinGetSoftware', 'Get-WinGetSoftwareUpgrade', 'Checkpoint-WinGetSoftware', 'Restore-WinGetSoftware', 'Initialize-WinGetIgnore', 'Initialize-WinGetRestore', 'Merge-WinGetRestore')
CmdletsToExport = @()
Expand Down
20 changes: 13 additions & 7 deletions WinGet-Essentials/modules/WinGet-Update.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Set-StrictMode -Version 3
Import-Module "$PSScriptRoot\WinGet-Utils.psm1"

# Used for specifing the default choice when prompting the user.
# Used for specifying the default choice when prompting the user.
[int]$DefaultChoiceContinue = 0

[string]$DefaultSource = 'winget'
Expand Down Expand Up @@ -36,6 +36,7 @@ function Get-ListHash
#>
function Get-WinGetSoftwareUpgrade
{
[CmdletBinding()]
param (
# Detruncate any entries in the text-based results by performing additional queries.
[switch]$Detruncate,
Expand Down Expand Up @@ -73,6 +74,7 @@ function Get-WinGetSoftwareUpgrade
if (Test-Path $cacheFile)
{
if ($CleanCache) {
Write-Verbose "Cache cleaned ..."
Remove-Item $cacheFile
} else {
Write-Verbose "Getting upgrade cache ..."
Expand Down Expand Up @@ -114,6 +116,8 @@ function Get-WinGetSoftwareUpgrade
-not($ignoredIds -contains $_.Id)
}
}

Write-Verbose "Found $($upgrades.Count) upgrades ..."
}

if ($Detruncate) {
Expand All @@ -124,7 +128,9 @@ function Get-WinGetSoftwareUpgrade
hash = $cacheHash
upgrades = $upgrades
}
$cache | ConvertTo-Json | Set-Content $cacheFile

Write-Verbose "Updating: $cacheFile ..."
$cache | ConvertTo-Json | Set-Content $cacheFile -Force

$upgrades
}
Expand Down Expand Up @@ -160,15 +166,15 @@ function Resolve-WinGetSoftwareUpgrade
Attempts to upgrade to the latest version of WinGet-Essentials via the
PSGallery. The various configuration files required by the WinGet-Essentials
cmdlets will be migrated/moved from prior installations, or an error output
will be emitted stating that such a resouce is missing and is needed to
will be emitted stating that such a resource is missing and is needed to
function.
#>
function Update-WinGetEssentials
{
param(
<#
When set, the cmdlet will automatically relaunch using an Administrator
PowerShell instance. This cmdlet requires aministrator privileges
PowerShell instance. This cmdlet requires administrator privileges
to create Symbolic Links.
#>
[switch]$Administrator,
Expand Down Expand Up @@ -265,7 +271,7 @@ function Update-WinGetSoftware
# Clean the cache
[switch]$CleanCache,

# Indicates to run the command in an Administror PowerShell instance.
# Indicates to run the command in an Administrator PowerShell instance.
[switch]$Administrator,

# Bypasses the ignore file.
Expand Down Expand Up @@ -597,7 +603,7 @@ function Update-WinGetSoftware
$commandArgs += @('--name', $DefaultSource)
}
winget $commandArgs
Get-WinGetSoftwareUpgrade -UseIgnores -Detruncate
Get-WinGetSoftwareUpgrade -NoIgnore:$($using:NoIgnore) -CleanCache:$($using:CleanCache) -Verbose:$Verbose -Detruncate
}

Show-JobProgress $jobName
Expand All @@ -614,7 +620,7 @@ function Update-WinGetSoftware
Write-Output "Sync Skipped."
} else {
$jobName = Start-Job -ScriptBlock {
Get-WinGetSoftwareUpgrade -UseIgnores -Detruncate
Get-WinGetSoftwareUpgrade -NoIgnore:$($using:NoIgnore) -CleanCache:$($using:CleanCache) -Verbose:$Verbose -Detruncate
}

Show-JobProgress $jobName
Expand Down