DSC icon indicating copy to clipboard operation
DSC copied to clipboard

Exit codes not reliable

Open IlleNilsson opened this issue 1 month ago • 1 comments

Prerequisites

  • [x] Write a descriptive title.
  • [x] Make sure you are able to repro it on the latest version
  • [x] Search the existing issues.

Summary

I'm using PowerShell to create a resource but the exit codes are not as expected. I get an exit code of 2, even if coded to 0 upon exit of pwsh.exe.

Here is the repo and the launch.json has the test cases... ; https://github.com/IlleNilsson/Microsoft.DSC.v3.resource.venture

Steps to reproduce

Run the test in the launch.json file

Expected behavior

0

Actual behavior

2

Error details


Environment data

7.5.4

Version

3.1.1

Visuals

No response

IlleNilsson avatar Nov 08 '25 08:11 IlleNilsson

I did a quick look through your resource implementation, and I'm having a little trouble following it. In any case, there's nothing DSC can do about an executable emitting the incorrect exit code - can you clarify whether the script is returning the wrong exit code unexpectedly or the script is returning the correct exit code and DSC is misinterpreting it?

michaeltlombardi avatar Nov 18 '25 15:11 michaeltlombardi