Skip to content

Change Add-Type -OutputType to not support ConsoleApplication and WindowsApplication #13440

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

Merged
merged 2 commits into from
Aug 21, 2020

Conversation

daxian-dbw
Copy link
Member

@daxian-dbw daxian-dbw commented Aug 14, 2020

PR Summary

Related issue: #13344
The output assembly type ConsoleApplication and WindowsApplication doesn't work with Add-Type today.
Per the conclusion of the powershell committee, this PR changes Add-Type -OutputType to throw terminating error when either ConsoleApplication or WindowsApplication is used.

PR Checklist

Copy link
Collaborator

@iSazonov iSazonov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd wait Ryslyn team answer. If they have not plans to fix this we can remove the code and add throw. Otherwise it is better to add ValidationSet attribute - less changes to revert.

@daxian-dbw
Copy link
Member Author

Adding ValidationSet attribute will be very confusing -- it's a enum type parameter but some members don't work because of the ValidationSet. That makes the ValidateSet attribute more like a bug.
Also, the changes in this PR is very trivial, so it will also be a trivial work to revert the changes when someone gets to fix it (if it's fixable).

@iSazonov
Copy link
Collaborator

iSazonov commented Aug 18, 2020

Adding ValidationSet attribute will be very confusing -- it's a enum type parameter but some members don't work because of the ValidationSet.

I mean we can use string values and add a comment with link to tracking issue.

@daxian-dbw
Copy link
Member Author

The changes in this PR is trivial, and reverting it when it needs to is also trivial, so I don't think we need to do it differently.

@iSazonov iSazonov added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Aug 18, 2020
@daxian-dbw
Copy link
Member Author

@anmenaga I think this PR is ready to merge.

@iSazonov iSazonov added this to the 7.1.0-preview.7 milestone Aug 19, 2020
@iSazonov
Copy link
Collaborator

We could keep #13344 open for tracking.

@iSazonov iSazonov removed this from the 7.1.0-preview.7 milestone Aug 21, 2020
@iSazonov iSazonov self-assigned this Aug 21, 2020
@iSazonov iSazonov merged commit 5f9d284 into PowerShell:master Aug 21, 2020
@iSazonov iSazonov added this to the 7.1.0-preview.7 milestone Aug 21, 2020
@daxian-dbw daxian-dbw deleted the addtype branch August 21, 2020 17:31
@ghost
Copy link

ghost commented Sep 8, 2020

🎉v7.1.0-preview.7 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants