1
Vote

Unexpected characters in file path can cause errors

description

I have a ' character in my account name and therefore in the my home directory path

I get an error at line 5255 because this
> #// The ambersand is needed because there might be spaces in the file path to the HTML report.
    Invoke-Expression -Command "&'$HtmlOutputFileName'"
will break if the asked to execute
 & 'C:\james.o'neill\blah' 
The fix is simple - invoke expression is considered harmful anyway so replace the above with
Start-Process $HtmlOutputFileName

comments