xRobocopy icon indicating copy to clipboard operation
xRobocopy copied to clipboard

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

Open kfrajtak opened this issue 7 years ago • 0 comments

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

kfrajtak avatar Dec 15 '16 11:12 kfrajtak