Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

powershell scripts do not terminate correctly #427

Open
KnicKnic opened this issue Mar 16, 2021 · 2 comments
Open

powershell scripts do not terminate correctly #427

KnicKnic opened this issue Mar 16, 2021 · 2 comments

Comments

@KnicKnic
Copy link

KnicKnic commented Mar 16, 2021

@vishiy @rashmichandrashekar
I am using https://github.com/microsoft/OMS-docker/blob/ci_feature_prod/docs/aks/mdmonboarding/mdm_onboarding.ps1
I noticed that it exits incorrectly using exit This sets the exit code to 0 and allows apps to continue.

You should either throw, or use exit 1 or something else. See https://devblogs.microsoft.com/powershell/windows-powershell-exit-codes/

I was expecting when the scrip failed, to fail my script runner.

@austonli
Copy link

Hi @KnicKnic , we are working on a feature to remove the dependency for the Metrics role assignments. At that point, we will not longer require that script. Please let us know if this is still a blocking issue for you.

@KnicKnic
Copy link
Author

@austonli I think the problem is endemic in the code base and all powershell files should be reviewed. I found a similar pattern in the second powershell file I looked at https://github.com/microsoft/OMS-docker/blob/ci_feature_prod/docs/aksengine/kubernetes/AddMonitoringWorkspaceTags.ps1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants