You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
puppet-powershellmodule/lib/puppet/provider/psrepository/powershellcore.rb
Line 59 in b8ff5e7
(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:https://docs.microsoft.com/en-us/powershell/module/powershellget/set-psrepository?view=powershell-5.0
https://docs.microsoft.com/en-us/powershell/module/powershellget/set-psrepository?view=powershell-5.1
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.The text was updated successfully, but these errors were encountered: