Skip to content

Commit

Permalink
Merge pull request #9 from EncoreTechnologies/release/v2.1.0
Browse files Browse the repository at this point in the history
Release v2.1.0
  • Loading branch information
nmaludy authored Apr 28, 2020
2 parents ae09203 + 3e452ee commit 0ef7842
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 63 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Development

## 2.1.0 (2020-04-28)

* `psrepository` - Fixed the inability to register psrepoositorys when none are registered on the node prior to puppet due to bug in `instances_command` expecting a returned hashtable. (Bugfix)

* `psrepository` - Many fixes around the default powershell gallery repo due to the `flush` command attempting to set the source_location of the repo. (Bugfix)
Expand All @@ -11,8 +13,13 @@
* `package` - Fixed the inability to upgrade previously installed modules with -AllowClobber. This would previously fail with an error if a cmdlet was moved to a new module. Powershell would error stating the cmdlet exists in the system already within a module and you need to specific -AllowClobber to install the new one. (Bugfix)

* Converted the module over to PDK for validation and spec testing. (Feature)

* Enabled Travis builds (Feature)

* Enabled TLSv1.2 which is required to communicate with PowerShell Gallery. Previously,
this module did not enforce TLSv1.2 and the repository setup commands would fail. (Bugfix)

Contributed by @pauby

## 2.0.1 (September 6, 2018)

Expand Down
9 changes: 6 additions & 3 deletions lib/puppet/provider/package/windowspowershell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
commands powershell: 'powershell'

def self.invoke_ps_command(command)
# The SecurityProtocol section of the -Command forces PowerShell to use TLSv1.2,
# which is not enabled by default unless explicitly configured system-wide in the registry.
# The PowerShell Gallery website enforces the use of TLSv1.2 for all incoming connections,
# so without forcing TLSv1.2 here the command will fail.
sec_proto_cmd = '[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12'
result = powershell(['-NoProfile', '-ExecutionPolicy', 'Bypass', '-NonInteractive', '-NoLogo', '-Command',
# The following section of the -Command forces powershell to use tls1.2 (which it does not by default currently unless set system wide): [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
# Without tls1.2 you cannot install modules from PSGallery
"$ProgressPreference = 'SilentlyContinue'; $ErrorActionPreference = 'Stop'; [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; #{command}"])
"$ProgressPreference = 'SilentlyContinue'; $ErrorActionPreference = 'Stop'; #{sec_proto_cmd}; #{command}"])
result.lines
end
end
9 changes: 6 additions & 3 deletions lib/puppet/provider/pspackageprovider/windowspowershell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
commands powershell: 'powershell'

def self.invoke_ps_command(command)
# The SecurityProtocol section of the -Command forces PowerShell to use TLSv1.2,
# which is not enabled by default unless explicitly configured system-wide in the registry.
# The PowerShell Gallery website enforces the use of TLSv1.2 for all incoming connections,
# so without forcing TLSv1.2 here the command will fail.
sec_proto_cmd = '[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12'
result = powershell(['-NoProfile', '-ExecutionPolicy', 'Bypass', '-NonInteractive', '-NoLogo', '-Command',
# The following section of the -Command forces powershell to use tls1.2 (which it does not by default currently unless set system wide): [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
# Without tls1.2 you cannot install modules from PSGallery
"$ProgressPreference = 'SilentlyContinue'; $ErrorActionPreference = 'Stop'; [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12; #{command}"])
"$ProgressPreference = 'SilentlyContinue'; $ErrorActionPreference = 'Stop'; #{sec_proto_cmd}; #{command}"])
result.lines
end
end
64 changes: 7 additions & 57 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,73 +1,23 @@
{
"name": "hbuckle-powershellmodule",
"version": "2.0.1",
"author": "Henry Buckle",
"name": "encore-powershellmodule",
"version": "2.1.0",
"author": "Encore Technologies",
"summary": "Manage PowerShell modules and repositories",
"license": "Apache-2.0",
"source": "https://github.com/hbuckle/puppet-powershellmodule",
"project_page": "https://github.com/hbuckle/puppet-powershellmodule",
"issues_url": "https://github.com/hbuckle/puppet-powershellmodule/issues",
"source": "https://github.com/EncoreTechnologies/puppet-powershellmodule",
"project_page": "https://github.com/EncoreTechnologies/puppet-powershellmodule",
"issues_url": "https://github.com/EncoreTechnologies/puppet-powershellmodule/issues",
"dependencies": [

],
"operatingsystem_support": [
{
"operatingsystem": "Windows",
"operatingsystemrelease": [
"Server 2008",
"Server 2008 R2",
"Server 2012",
"Server 2012 R2",
"Server 2016",
"7",
"8.1",
"10"
]
},
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"8.7+",
"9"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"14.04",
"16.04",
"17.04"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7"
]
},
{
"operatingsystem": "Fedora",
"operatingsystemrelease": [
"25",
"26"
]
},
{
"operatingsystem": "openSUSE",
"operatingsystemrelease": [
"42.2"
]
},
{
"operatingsystem": "OSX",
"operatingsystemrelease": [
"10.12+"
"Server 2019"
]
}
],
Expand Down

0 comments on commit 0ef7842

Please sign in to comment.