Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for OS check to the #requires statement #3751
Comments
|
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. :) |
|
Benefit of |
|
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. |
|
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. |
|
@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 |
|
I've opened an RFC on updating the behaviour of |
|
@joeyaiello Can this enhancement be included with PS 7? |
|
This has been accepted in PowerShell/PowerShell-RFC#122 Now it just needs to be implemented |
|
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:
|
|
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. |
|
Perhaps instead of a meta issue that itself is additional work to maintain, we should have a |
|
In the case we need to create an issue to apply the label. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

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.