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

Allow PowerShell script execution #234

Merged
merged 1 commit into from
Aug 22, 2016

Conversation

dlukman
Copy link
Contributor

@dlukman dlukman commented Mar 7, 2016

Windows AMIs have the ExecutionPolicy set to Restricted and this breaks kitchen converge just before installing Chef Client because it does not allow PowerShell script execution. The added line fixes this issue.

Output:

$$$$$$ & : File C:\Users\Administrator\AppData\Local\Temp\kitchen\default-windows-2012
$$$$$$ r2-long_script.ps1 cannot be loaded because running scripts is disabled on
$$$$$$ this system. For more information, see about_Execution_Policies at
$$$$$$ http://go.microsoft.com/fwlink/?LinkID=135170.
$$$$$$ At line:1 char:42
$$$$$$ + $ProgressPreference='SilentlyContinue';&
$$$$$$ "$env:TEMP/kitchen/default-windows-2012 ...
$$$$$$ +
$$$$$$ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$$$$$$     + CategoryInfo          : SecurityError: (:) [], PSSecurityException
>>>>>> Converge failed on instance <default-windows-2012r2>.
>>>>>> Please see .kitchen/logs/default-windows-2012r2.log for more details
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: WinRM exited (1) for command: [& "$env:TEMP/kitchen/default-windows-2012r2-long_script.ps1"]
>>>>>> ----------------------

@mwrock
Copy link
Member

mwrock commented Mar 7, 2016

👍

@Dan-JoeLopez
Copy link

+1
For what its worth, I am implimenting this fix on my local machine to enable testing up to aws for my win 2012 instances.

@cheeseplus
Copy link
Contributor

👍

@rveznaver
Copy link

Merge? Anyone?

@mwrock mwrock merged commit f04256f into test-kitchen:master Aug 22, 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.

5 participants