How do I tell node to reboot if installation of powershell completed

Hello,

My recipe contains single line > include_recipe ‘powershell::powershell5’ to install WMF5. It works fine but reboot does not happen at the end.
Recipe itself contains following directives

notifies :request, ‘windows_reboot[powershell]’, :immediately if reboot_pending? && node[‘powershell’][‘installation_reboot_mode’] != 'no_reboot’
not_if { ::Powershell::VersionHelper.powershell_version?(node[‘powershell’][‘powershell5’][‘version’]) }

How do I tell recipe to go on with reboot if installation did in fact took place?

Log output is below

_file[c:\chef\cache\package\Win8.1AndW2K12R2-KB3134758-x64.msu] updated file contents c:\chef\cache\package\Win8.1AndW2K
12R2-KB3134758-x64.msu

  - update content in file c:\chef\cache\package\Win8.1AndW2K12R2-KB3134758-x64.msu from none to bb6af4
  (file sizes exceed 10000000 bytes, diff output suppressed)

[2016-05-20T14:10:29-06:00] INFO: windows_package[Windows Management Framework Core 5.0] installed Windows Management Fr
amework Core 5.0 at latest
- install version latest of package Windows Management Framework Core 5.0
Recipe: iis_dsc::basic

My guess is that reboot_pending? is being evaluated at compile time which would likely be false. I think you would be fine to remove the pending_reboot? check alltogether because if your wmf5 install does indeed converge, I’m pretty sure that will always require a reboot.

Snippet I posted is from powershell cookbook not mine cookbook so I can not change it. My recipe has a single line which just includes that recipe from powershell cookbook.

I see. I’m going to assume then that the powershell cookbook is doing the right thing. One other thing to check is if you have overriden the node['powershell']['installation_reboot_mode'] attribute. The powershell cookbook sets this to no_reboot by default so you should set it to immediate_reboot. It looks like that could be better documented.

I am having the same issue, although, not sure if it is an issue or expected behavior. I am adding powershell::powershell5 to my run list followed by another cookbook that will utilize the dsc_resource resource - WMF5 is required for this. WMF5 gets installed but it does not reboot.