diff --git a/CHANGELOG.md b/CHANGELOG.md index 9857806..9522766 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ 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). +## [3.1.1] - 2021-04-02 +#### Fixed +* Chocolatey once again will be installed automatically if not already present + ## [3.1.0] - 2021-04-02 #### Removed * No longer using Native API method for interacting with choco.exe due to [a compatibility issue between the Chocolatey API and Chocolatey.org](https://github.com/jianyunt/ChocolateyGet/issues/24) diff --git a/src/ChocolateyGet.psd1 b/src/ChocolateyGet.psd1 index 1b3af20..3e00269 100644 --- a/src/ChocolateyGet.psd1 +++ b/src/ChocolateyGet.psd1 @@ -1,6 +1,6 @@ @{ RootModule = 'ChocolateyGet.psm1' - ModuleVersion = '3.1.0' + ModuleVersion = '3.1.1' GUID = 'c1735ed7-8b2f-426a-8cbc-b7feb6b8288d' Author = 'Jianyun' Copyright = '' diff --git a/src/ChocolateyGet.psm1 b/src/ChocolateyGet.psm1 index 0b52177..1e177fb 100644 --- a/src/ChocolateyGet.psm1 +++ b/src/ChocolateyGet.psm1 @@ -10,11 +10,6 @@ $script:AcceptLicense = "AcceptLicense" # Define choco related variables $script:ChocoExeName = 'choco.exe' -if (-not (Get-ChocoPath)) { - Write-Debug ("Choco not already installed") - $ChocoExePath = Install-ChocoBinaries -} - # Utility variables $script:FastReferenceRegex = "(?[^#]*)#(?[^\s]*)#(?[^#]*)" $script:ChocoSourcePropertyNames = @( @@ -45,3 +40,9 @@ Get-ChildItem $ScriptPath/public -Recurse -Filter '*.ps1' -File | ForEach-Object Export-ModuleMember $_.Name } } + +# Install Chocolatey if not already present +if (-not (Get-ChocoPath)) { + Write-Debug ("Choco not already installed") + Install-ChocoBinaries +}