diff options
author | Tor Magnus Rakvåg <tm@intility.no> | 2018-02-12 14:08:17 +0100 |
---|---|---|
committer | Tor Magnus Rakvåg <tm@intility.no> | 2018-02-12 14:20:19 +0100 |
commit | 67fd2daf3151fd3a6eaee90a11aa5792e01e8159 (patch) | |
tree | 3b6a4c3ddf8681a27dc17c15e8628ad61d33e75e /lib | |
parent | baba34bdf0fd079f6bde0f7f0f28929c084543ba (diff) | |
download | chef-67fd2daf3151fd3a6eaee90a11aa5792e01e8159.tar.gz |
add source param
Signed-off-by: Tor Magnus Rakvåg tm@intility.no
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/provider/package/powershell.rb | 5 | ||||
-rw-r--r-- | lib/chef/resource/powershell_package.rb | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/chef/provider/package/powershell.rb b/lib/chef/provider/package/powershell.rb index 9fe3e52b24..eb65d80e3d 100644 --- a/lib/chef/provider/package/powershell.rb +++ b/lib/chef/provider/package/powershell.rb @@ -115,9 +115,14 @@ class Chef command.push(arg) end command.push("-RequiredVersion #{version}") if version + command.push("-Source #{new_resource.source}") if new_resource.source && command[1] =~ Regexp.union(/Install-Package/, /Find-Package/) command.push(").Version") command.join(" ") end + + def check_resource_semantics! + # This validation method from Chef::Provider::Package does not apply here, so no-op it. + end end end end diff --git a/lib/chef/resource/powershell_package.rb b/lib/chef/resource/powershell_package.rb index 05c59acf73..829db5f4f8 100644 --- a/lib/chef/resource/powershell_package.rb +++ b/lib/chef/resource/powershell_package.rb @@ -41,6 +41,7 @@ class Chef property :version, [String, Array], coerce: proc { |x| [x].flatten } + property :source, [String] end end end |