Provisioning - Install.ps1 file has syntax errors


When I run a chef-run, I see the error as:

[Rel92-Test-agt1] At C:\chef\install.ps1:56 char:13
                  +   if ($pA256($src) {
                  +             ~
                  Unexpected token '(' in expression or statement.
                  At C:\chef\install.ps1:56 char:13
                  +   if ($pA256($src) {
                  +             ~
                  Missing closing ')' after expression in 'if' statement.
                  At C:\chef\install.ps1:56 char:20
                  +   if ($pA256($src) {
                  +                    ~
                  Unexpected token '{' in expression or statement.
                  At C:\chef\install.ps1:51 char:29
                  + Function Install-Chef($msi) {
                  +                             ~
                  Missing closing '}' in statement block.
                      + CategoryInfo          : ParserError: (:) [], ParseException
                      + FullyQualifiedErrorId : UnexpectedToken

I Check the script locally on the node adn the syntax is in fact bad, I deleted it and ran it again, and the same script is downloaded. This script is generated via the Chef-Provisioning cookbook:

but I’m not sure this is because of that cookbook or the generator for the scrpt that is run on line 39

install_command =, true, opts).install_command


Looks to be an issue with the script_generator…


Could you gist up the actual install.ps1 that was generated and also reply with output of chef --version and chef gem list winrm? That’ll let me know what version of the winrm and winrm-fs gems to check against.

The location the error is generated doesn’t look to be part of the normal install.ps1 template.

PS C:\GIT Repositories\cookbook-relativity_scaled-automation> chef --version
Chef Development Kit Version: 0.14.25
chef-client version: 12.10.24
berks version: 4.3.3
kitchen version: 1.8.0
PS C:\GIT Repositories\cookbook-relativity_scaled-automation> chef gem list winrm

*** LOCAL GEMS ***

winrm (1.8.1, 1.6.0, 1.5.0)
winrm-elevated (0.4.0)
winrm-fs (0.4.2)
winrm-s (0.3.6, 0.3.4)
winrm-transport (1.0.3)
PS C:\GIT Repositories\cookbook-relativity_scaled-automation>


That install.ps1 is getting mangled somehow/somewhere. It seems that some functions are duplicated and overwriting other functions…

I see you’ve got a bug opened -

We can follow up further there.


Great, thanks…