Closed jhoneill closed 4 years ago
All classes are being moved to C#. The next version 7.0 will no longer have any PowerShell Class files.
So you're going to take the logic for "using" out of mergefile ? The problem is the old logic finds false-positives and moves (e.g). a line from the middle of a comment block - which won't be valid syntactically.
Steps to reproduce
if a class file has a comment like this
when the module is built, merge file matches on using and will put "we do this "into the output file
This is fixed by changing two regexes in MergeFile.
At line 189
$matches = $fileContents | Select-String '^\s*using'
And at line 202$newFileContents = ($fileContents -replace '^\s*using.*$', '')
The first for "any line starting with any white space followed by "using" and the second for "Any line starting with using, all the way to the end of the line.