Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix windows_service so it works correctly #266

Merged
merged 1 commit into from
Jun 20, 2016
Merged

Fix windows_service so it works correctly #266

merged 1 commit into from
Jun 20, 2016

Conversation

lynxman
Copy link
Contributor

@lynxman lynxman commented Jun 17, 2016

Just fixed a couple escapes needed for this to work

Verified

This commit was signed with the committer’s verified signature.
snyk-bot Snyk bot
Just fixed a couple escapes needed for this to work
@@ -52,7 +53,7 @@
} ->
exec { 'consul_service_set_parameters':
cwd => $consul::bin_dir,
command => "${consul::bin_dir}/set_service_parameters.ps1",
command => "& \"${consul::bin_dir}/set_service_parameters.ps1\"",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you describe the "&" prepend thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ampersand (the 'and' sign) here tells PowerShell to execute that command, instead of treating it as a cmdlet or a string. The backticks (the funny looking single-quotes) are there to escape the following character, similar to the " in C-based languages, or double-double-quotes ("") in VB. Otherwise the " character will end the string and the parser will cry when it can't understand what you're trying to say after that. (You can alternatively use single-quotes instead in this case, as I have in the previous example.)
http://edgylogic.com/blog/powershell-and-external-commands-done-right/
Just want to ensure this is executed as a command inside powershell, this is the way to force it to do so

@solarkennedy
Copy link
Contributor

Ok. We don't currently have any unit or itests that are windows-specific, so we'll have to depend on you and the other windows users to test this and sure it says fixed. Thank you for the contribution!

@solarkennedy solarkennedy merged commit 79793ea into voxpupuli:feature/windows_support Jun 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants