win_service play fails when run without an optional parameter

All,

I’m running version 2.1.1, and have a very simple play to restart a service on my Win2k8 and Win2k12 servers:

Hi,

I wonder if you are somehow picking up an old version of the modules, as I just checked (latest devel 2.2 version and

If ($params.start_mode) {

is no longer in the code.

If you are running from source ensure you have done a git submodule update --init and a source hacking/env-setup otherwise you may pick up older versions of the modules installed elsewhere on your system.

If it isn’t something to do with picking up an old version of win_service.ps1 reply back and I’ll have another think what could be causing this.

Hope this helps,

Jon

Hi, Jon.

Sorry for the long delay in responding.

It may well be that an old version of the module is being picked up. There are two, one in core (dated July, 2016), the other one in extras (dated March, 2015). I guess this module made it into core. If I delete the version in extras, will that solve the problem. This is an RPM install.

Dimitri

I would definitely clean up your installation and try again - you definitely only need one version of the module. I wonder perhaps if you have a source installation or a pip installation as well as an RPM install?