X Tutup
The Wayback Machine - https://web.archive.org/web/20201111170619/https://github.com/PowerShell/PowerShell/issues/3751
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

Add support for OS check to the #requires statement #3751

Open
alexandair opened this issue May 10, 2017 · 13 comments
Open

Add support for OS check to the #requires statement #3751

alexandair opened this issue May 10, 2017 · 13 comments

Comments

@alexandair
Copy link
Contributor

@alexandair alexandair commented May 10, 2017

PowerShell Core is a cross-platform, so it makes sense to add support for operating system check to the #requires statement in case you want to write an OS-specific script.

@MaximoTrinidad
Copy link

@MaximoTrinidad MaximoTrinidad commented May 10, 2017

Hum!! I'm using the isXXXX variables to identify which OS I want the code to execute. It won't hurt to implement another #REQUIRES -OS option.

:)

@SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented May 11, 2017

Benefit of #requires is that it's a parse time check and not runtime if the entire script is not compatible vs using $isWindows, etc...

@joeyaiello
Copy link
Member

@joeyaiello joeyaiello commented May 17, 2017

I'm writing an RFC right to discuss platform differences. For the time being, I think it's a perfectly usable workaround to throw at the beginning of a psm1 if !isLinux.

@joeyaiello joeyaiello added this to the 6.0.0-HighPriority milestone May 24, 2017
@iSazonov iSazonov self-assigned this Jun 5, 2017
@joeyaiello
Copy link
Member

@joeyaiello joeyaiello commented Aug 22, 2017

Reminder here to discuss with @PowerShell/powershell-committee the possibility of pushing this out. No immediate need (certainly not moreso than the "interop" variables), and this should be done with intent.

@SteveL-MSFT SteveL-MSFT modified the milestones: 6.1.0, 6.0.0-HighPriority Sep 6, 2017
@SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Sep 6, 2017

@PowerShell/powershell-committee reviewed this and agree that this isn't needed for 6.0.0, we'll revisit the necessity at all post 6.0.0

@rjmholt
Copy link
Member

@rjmholt rjmholt commented Mar 23, 2018

I've opened an RFC on updating the behaviour of #requires. Please feel free to comment in the PR.

@ThomasNieto
Copy link
Contributor

@ThomasNieto ThomasNieto commented May 31, 2019

@joeyaiello Can this enhancement be included with PS 7?

@rjmholt
Copy link
Member

@rjmholt rjmholt commented May 31, 2019

This has been accepted in PowerShell/PowerShell-RFC#122

Now it just needs to be implemented

@iSazonov
Copy link
Collaborator

@iSazonov iSazonov commented Jun 3, 2019

I think we would be great to have a meta issue with not implemented RFCs.

@rjmholt
Copy link
Member

@rjmholt rjmholt commented Jun 3, 2019

I think we would be great to have a meta issue with not implemented RFCs.

We should discuss with @SteveL-MSFT and @joeyaiello, but I do keep feeling that RFCs don't integrate well with issue tracking for us.

I think meta issues tend to get neglected and aren't very helpful compared to a 1-issue-per-workitem approach and tagging. So my suggestion would be:

  • When RFCs are accepted, they are linked to the appropriate issue in the relevant repository and the issue is tagged as implementing an RFC
  • Then, when the issue is closed as implemented, the RFC is moved to implemented
@iSazonov
Copy link
Collaborator

@iSazonov iSazonov commented Jun 3, 2019

In the case we need one issue in RFC repo to track implementing and there can be some related issues and PRs in the repo.

@SteveL-MSFT
Copy link
Member

@SteveL-MSFT SteveL-MSFT commented Jun 5, 2019

Perhaps instead of a meta issue that itself is additional work to maintain, we should have a RFC Approved, Waiting on Implementation type label (but shorter) in this repo and have the ability to render a view of RFCs based on filtering criteria (we already need it for other purposes).

@iSazonov
Copy link
Collaborator

@iSazonov iSazonov commented Jun 5, 2019

In the case we need to create an issue to apply the label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Developer Experience/SDK
  
Awaiting triage
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.
X Tutup