[BuildCheck Suggestion]: Detect and flag usage of the `$(OS)` MSBuild Property
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 141
Description
### Summary
This property only has two documented values, "Windows_NT" and "Unix", but this doesn't tell the story accurately today. In addition, this property like all properties can be overridden by environment variables. We should guide users to better-supported mechanisms for determining the OS of the executing build. Users should use the static members of the `System.OperatingSystem` like `IsWindows()` to check platform support.
### Background and Motivation
We don't have documented guidance for moving away from `$(OS)`, this should help drive that as well.
### Sample issue or antipattern that the check should be flagging
This
```
dotnet
dotnet.exe
```
should suggest using
```
dotnet
dotnet.exe
```
instead
### Sample output
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.