flcdrg / au-packages

David's Chocolatey Automatic Packages
MIT License
18 stars 53 forks source link

Restart winrm #120

Closed Plork closed 2 years ago

Plork commented 2 years ago

add the option to disable the restart of winrm with admin center install.

flcdrg commented 2 years ago

Thanks for the PR!

Given I presume you'd only want to use this to disable the restart, I'm thinking it might be nicer to make this an 'opt-in' parameter..

eg call it '\DisableRestartWinRM` and only add it to the args list if it is passed in:

if ($pp['RESTARTWINRM']) {
    $restart_winrm = "RESTART_WINRM=0"
}
Plork commented 2 years ago

fine with me, thats the only discussion I was looking for ;) was exactly my internal debat.

naming parameters is alway the hardest thing :D

Will change the script

Plork commented 2 years ago

I rewrote arguments to be more clear for optional flags. also less struggles with quotes like this.

apologies for my editor removing trailing spaces :S

I have a macbook atm, so didnt find a way to test this yet. @flcdrg

flcdrg commented 2 years ago

I tested this out, but it failed. Missing a space I think

ERROR: Running ["C:\Windows\System32\msiexec.exe" /i "C:\Users\david\AppData\Local\Temp\chocolatey\windows-admin-center\1.3.44065.0\WindowsAdminCenter2110.msi" /qn norestart SME_PORT=6516 SSL_CERTIFICATE_OPTION=generate RESTART_WINRM=0/l*v "C:\Users\david\AppData\Local\Temp\chocolatey\windows-admin-center.1.3.44065.0.MsiInstall.log" ] was not successful. Exit code was '1639'. Exit code indicates the following: The command line arguments passed to the MSI are incorrect. If you passed in additional arguments, please adjust. Otherwise followup with the package maintainer(s) to get this fixed. This is most likely an issue with the 'windows-admin-center' package and not with Chocolatey itself. Please follow up with the package maintainer(s) directly..
The install of windows-admin-center was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\windows-admin-center\tools\chocolateyinstall.ps1'.
 See log for details.
Plork commented 2 years ago

thnx for the test!! I missed those

flcdrg commented 2 years ago

I've pushed a new version with this change. Hopefully it will appear soon