[BOLT-102] Loading params from file on powershell triggers splat operator error Created: 2017/09/26  Updated: 2018/04/12  Resolved: 2018/04/04

Status: Resolved
Project: Puppet Task Runner
Component/s: CLI, DOCS, Windows
Affects Version/s: None
Fix Version/s: BOLT 0.18.2

Type: Bug Priority: Normal
Reporter: Gareth Rushgrove Assignee: Michael Smith
Resolution: Fixed Votes: 0
Labels: DOCS, docs-reviewed, resolved-issue-added
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relates to BOLT-29 Allow nodes to be specified in a file... Closed
Acceptance Criteria:

Example commands should work on powershell

Sprint: Bolt Kanban
Method Found: Needs Assessment
Release Notes: Not Needed
QA Risk Assessment: Needs Assessment


Based on the documentation you should be able to load params from a file, using the @ symbol. However on powershell the @ is reserved. This would instead need to be passed quoted as a string I think.

bolt plan run sample::example --params @params.json --modules /modules --debug

At line:1 char:114
+ ... efault garethr/bolt plan run sample::example --params @params.json -u ...
+                                                           ~~~~~~~
The splatting operator '@' cannot be used to reference variables in an expression. '@params' can be used only as an
argument to a command. To reference variables in an expression use '$params'.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : SplattingNotPermitted

Comment by Gareth Rushgrove [ 2017/09/26 ]

Jean Bond related to our conversation just now. I don't think this is actually implemented yet, but it might cause issues on powershell.

Jenny Mahmoudi worth noting with regards the CLI spec I think.

Comment by Michael Smith [ 2018/01/22 ]

I suggest we document that single quote is needed to use it under powershell and resolve this issue.

Comment by Michael Smith [ 2018/03/12 ]

Kate Lopresti this could be resolved with a minor addition to https://puppet.com/docs/bolt/0.x/bolt_options.html where we specify loading from file via the '@' symbol.

Comment by Kate Lopresti [ 2018/04/02 ]

Added "For Windows PowerShell,  add single quotation marks to define the file..." and code example to related content in Specifying nodes section: 


Also moved this ticket from Known to Resolved issues in release notes. 



Generated at Mon Dec 09 13:56:17 PST 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.