Skip to content

Commit

Permalink
Chocolatey v2 Support (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanbergstrom authored Feb 12, 2023
1 parent 7bb63de commit 1c1da0e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.1.0] - 2023-02-12
#### Added
* Future support for Chocolatey v2

#### Changed
* Install Chocolatey v1.2.1 by default if Chocolatey is not already installed

## [4.0.0] - 2021-09-24
#### Added
* Support for [package parameters/arguments that start with dashes via separate cmdlet dynamic parameters](https://github.com/jianyunt/ChocolateyGet/issues/29)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ ChocolateyGet works with PowerShell for both FullCLR/'Desktop' (ex 5.1) and Core

When used with CoreCLR, PowerShell 7.0.1 is a minimum requirement due to [a compatibility issue in PowerShell 7.0](https://github.com/PowerShell/PowerShell/pull/12203).

Users must upgrade to v4.1.0 or higher of this provider module prior to the release of Chocolatey v2 to ensure continued compatibility.

### Save a package
Save-Package is not supported with the ChocolateyGet provider, due to Chocolatey not supporting package downloads without special licensing.

Expand Down
4 changes: 2 additions & 2 deletions src/ChocolateyGet.psd1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
RootModule = 'ChocolateyGet.psm1'
ModuleVersion = '4.0.0'
ModuleVersion = '4.1.0'
GUID = 'c1735ed7-8b2f-426a-8cbc-b7feb6b8288d'
Author = 'Jianyun'
Copyright = ''
Expand All @@ -19,7 +19,7 @@
},
@{
ModuleName='Foil'
ModuleVersion='0.1.0'
ModuleVersion='0.3.0'
}
)
PrivateData = @{
Expand Down
2 changes: 1 addition & 1 deletion src/private/Find-ChocoPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ function Find-ChocoPackage {
}

# Convert the PSCustomObject output from Foil into PackageManagement SWIDs, then filter results by any version requirements
Foil\Get-ChocoPackage @chocoParams | ConvertTo-SoftwareIdentity -Source $selectedSource |
Foil\Find-ChocoPackage @chocoParams | ConvertTo-SoftwareIdentity -Source $selectedSource |
Where-Object {Test-PackageVersion -Package $_ -RequiredVersion $RequiredVersion -MinimumVersion $MinimumVersion -MaximumVersion $MaximumVersion}
}
2 changes: 1 addition & 1 deletion src/private/Install-Chocolatey.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function Install-Chocolatey {
[Net.ServicePointManager]::SecurityProtocol = ([Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12)
}
# Keep the default version of choco to install pinned to known safe versions
$env:chocolateyVersion = '0.12.1'
$env:chocolateyVersion = '1.2.1'
Invoke-WebRequest 'https://chocolatey.org/install.ps1' -UseBasicParsing | Invoke-Expression > $null
} catch {
ThrowError -ExceptionName 'System.OperationCanceledException' `
Expand Down
1 change: 1 addition & 0 deletions src/public/Get-InstalledPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function Get-InstalledPackage {
}

$chocoParams = @{
# Remove this flag after the release of Chocolatey v2
LocalOnly = $true
AllVersions = $true
}
Expand Down

0 comments on commit 1c1da0e

Please sign in to comment.