NetworkingDsc
NetworkingDsc copied to clipboard
HostsFile : Add possibility to put a comment on each line added
Details of the scenario you tried and the problem that is occurring
When using the resource to add a entry in the HostsFile, there is no possibility to add a comment at the end of line, as we usually do.
The purpose is to leave a trace about why the entry is there.
Verbose logs showing the problem
Suggested solution to the issue
Add a parameter (string) that can be added at end of line when adding an entry.
The DSC configuration that is used to reproduce the issue (as detailed as possible)
- name: Fichier hosts pour installation
win_dsc:
resource_name: HostsFile
HostName: '{{item.Name}}'
Ensure: Present
IPAddress: '{{item.IP}}'
with_items:
- '{{ListeHostsPourInstallWAP}}'
The operating system the target node is running
Version and build of PowerShell the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)
6.1.0.0
Taking a look at this, might require a refactor on the resource to implement properly since there's some duplicated code that would make this challenging as is.
Happy for anyone to refactor this one @MKletz - does need a bit of attention to clean it up.