ConfigureRemotingForAnsible.ps1 fails when called from github with Invoke-Expression #20512
Labels
affects_2.1
This issue/PR affects Ansible v2.1
bug
This issue/PR relates to a bug.
windows
Windows community
ISSUE TYPE
COMPONENT NAME
ConfigureRemotingForAnsible.ps1
ANSIBLE VERSION
OS / ENVIRONMENT
Windows Server 2012
Windows Server 2016
SUMMARY
Run this in a powershell console
The error is:
New-EventLog : The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At line:124 char:47
New-EventLog -LogName Application -Source $EventSource
~~~~~~~~~~~~
CategoryInfo : InvalidData: (:) [New-EventLog], ValidationMetadataException
FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.NewEventLogCommand
And points to the problem, $MyInvocation.MyCommand.Name is an empty string when called like this
so the above could be easily changed to
The text was updated successfully, but these errors were encountered: