-
Notifications
You must be signed in to change notification settings - Fork 19
Description
| flush_command = "Set-PSRepository #{@resource[:name]}" |
(Probably another file, this is initial investigation)
Because of how the source code is written, it always executes a command with first parameter being the name of the resource.
In the working example you provide it says it should work with powershell 5 and 6 (https://github.com/hbuckle/puppet-powershellmodule/blob/master/README.md), however, it only works with powershell 5.1, with 5.0 it doesn't.
The issue is that the command "Set-PSRepository" doesn't take the first string as a parameter in powershell 5.0. Also, there would be an issue if you were to set a 'name' parameter inside puppet, it errors, because there are 2 name parameters.
Command's Set-PSRepository' required parameter 'name as positional parameter '0' is only introduced in 5.1 as seen here:
Possible solution is not to include resource name in the flush command, so you would always have to explicitly say the name of the PSRepository and it would work with powershell 5.0 and below.