DexterPOSH / PSRemotely

Remote operations validation framework, exposes a DSL to wrap existing Pester/PoshSpec based validation tests.
http://psremotely.readthedocs.io/en/latest/
MIT License
46 stars 7 forks source link

Add check for invalid chars in the file names #56

Closed DexterPOSH closed 7 years ago

DexterPOSH commented 7 years ago

PSRemotely dumps the ..tests.ps1 file on the remote node and also generates a Nunit style XML result file for the pester tests run. As per the enhancement #48 , all the files will give preference to using NodeName for the tests and XML file. But there is a gotcha with using NodeName here since the NodeName can have illegal filename characters in it. Now, this bug uncovered in the integration tests for using IPv6, where the node name was '::1' and when dumping the files containing the nodename the error of an invalid character was thrown.

DexterPOSH commented 7 years ago

Easiest fix of the issue is to do a sanity check before dumping the tests file and Nunit file for the invalid chars in the name. If those exist throw a warning and use the $env:COMPUTERNAME isntead of the nodename.