Skip to content

Use $LASTEXITCODE instead of $result when building an error message #26

@kfrajtak

Description

@kfrajtak

Hi,

I ran into a problem when using your DSC resource.

The message was

VERBOSE: [2016-12-15T12:15:50] [ERROR] PowerShell DSC resource MSFT_xRobocopy  
failed to execute Test-TargetResource functionality with error message: 
robocopy returned with errors! Exit code: ! More info 
here:https://support.microsoft.com/en-us/kb/954404 

I believe there should $LASTEXITCODE variable used instead of $result (which was not initialized and is undefined at this point) when building error message on the line 200:

throw "robocopy returned with errors! Exit code: $result! More info here:https://support.microsoft.com/en-us/kb/954404"

Thanks,
Karel

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThe issue is a bug.help wantedThe issue is up for grabs for anyone in the community.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions