I have a DSC script that installs IIS on a 2008R2 server. Rather than install the whole IIS role, we pick an choose the features we want. After the features are all installed, I go ahead and configure the web sites.
What I am finding is that the script fails when I am configuring the apppools. However if I reboot the server and rerun the script, it runs all the way through with no errors.
How can I force a reboot after the feature install and have the script pick up where it left off or even just start over. Either way would work for me.
I added the xPendingReboot module from the latest wave, right after the WindowsFeature module but that just skips on through.’
I don’t think you can do that using the built-in WindowsFeature resource; you’d need to build a custom one. The provided resource only sets the reboot flag if Install-WindowsFeature indicates that a reboot is required. If that cmdlet doesn’t indicate a needed reboot, there won’t be one.
xPendingReboot only acts on a pending reboot; it doesn’t trigger a pending reboot.