• NJ-DBA (12/19/2011)


    richard.bothma (12/19/2011)


    Hi,

    I am also struggling with the same issue that was mentioned above, when I try execute the powershell script, on the line:

    "Backup Status" -Head $a -Body "<H2> ERRORSLIST </H2>"|out-file $workingdir\errors.html

    The error message is:

    You must provide a value expression on the right-hand side of the '-' operator.

    At C:\Data\Powershell\HTMLReports\working\htmlreports.ps1:427 char:18

    + "Backup Status" - <<<< Head $a -Body "<H2> ERRORSLIST </H2>"|out-file $workingdir\errors.html

    + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException

    + FullyQualifiedErrorId : ExpectedValueExpression

    I dont have much experience with Powershell so Im not sure what the problem is,

    does anyone know what the problem could be?

    Forgive me if I am missing something silly,

    Thanks

    Richard

    Not sure why uou are getting that error- and not in front of a machine right now so i cant try to reproduce, but that line is just a header row. I think you should be able to just comment it out.

    After a second look, there should not be a <<< in the code. Look at the script again. Is this an artifact of your copy/paste? The code should just have -head ... Remove those symbols and any space... Sorry typing from my phone