Closed vandot closed 1 year ago
@vandot apologies for the delays here. I'm assigning myself to give this PR a review and understand the need for this change. By chance is there accompanying issue related to the problem you mention in the description?
@nywilken there isn't accompanying issue related to the problem, I can create it if needed?
Proposed change is just to cover edge case if you reboot Windows machine as well.
Using twice New-NetFirewallRule
command is not possible and it's much cleaner fix to replace windows-startup-script-cmd
with sysprep-specialize-script-cmd
rather then write a powershell that first checks if NetFirewallRule exists etc.
Here is described how and when are different Windows startup scripts executed. Checking all described cases inside docs I think it makes sense to execute scripts only once and not after each boot, thus replacing windows-startup-script-cmd
with sysprep-specialize-script-cmd
.
@nywilken any updates?
Hi @vandot I have not had a chance to review. But the provided details is enough context to get me going. Sorry for not following up sooner.
Changes merged with my additional on top. Closing PR as it has been merged.
If you use
windows-restart
second boot will fail ifwindows-startup-script-cmd
has action that cannot be executed twice, likeNew-NetFirewallRule
. Whilesysprep-specialize-script-cmd
will be executed only at first boot.