Open BradKnowles opened 2 weeks ago
A potential fix would be to call [System.Environment]::ExpandEnvironmentVariables($physical_path)
in the line validating the path
ElseIf (-not (Test-Path -LiteralPath [System.Environment]::ExpandEnvironmentVariables($physical_path))) {
That would expand the path, test it for existence, and still put the original specified path, with the %SystemDrive%
intact.
SUMMARY
This task fails even though
%SystemDrive%\inetpub\wwwroot
does exist once the%SystemDrive%
has been expanded. I have this task to ensure the Default Web Site settings haven't been tampered with. The tasks resets them to default values.ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
Use this task in a playbook targeting a Windows 2019 server with IIS installed.
EXPECTED RESULTS
The value of the
Default Web Site
physical path to be set to%SystemDrive%\inetpub\wwwroot
ACTUAL RESULTS