Improve check for developer mode by checking minimum required build number#8749
Conversation
…umber The test would fail if the developer mode is enabled but the machine has an older build than the minimum required build. The change adds a check for the build version in the test.
JamesWTruher
left a comment
There was a problem hiding this comment.
this isn't blocking, but it might be easier to read/maintain
test/powershell/Modules/Microsoft.PowerShell.Management/New-Item.Tests.ps1
Outdated
Show resolved
Hide resolved
…em.Tests.ps1 Co-Authored-By: adityapatwardhan <adityap@microsoft.com>
src/System.Management.Automation/namespaces/FileSystemProvider.cs
Outdated
Show resolved
Hide resolved
src/System.Management.Automation/namespaces/FileSystemProvider.cs
Outdated
Show resolved
Hide resolved
Better performance
src/System.Management.Automation/namespaces/FileSystemProvider.cs
Outdated
Show resolved
Hide resolved
Fix spacing around `,`
|
merging this because it is blocking PRs. |
|
@adityapatwardhan I'm a bit late to the party here, but I noticed that we are depending a manifest in the binary for OSVersion to give correct results. This doesn't seem to happen when we run the tests, as they are loaded into the dotnet.exe binary. I get version 6.2 on my windows 10 machine when running the tests. |
|
@powercode Windows API, by default, will return 6.2 for the Windows Version. For Windows PowerShell and PowerShell Core, we rely on a compatibility section in the app manifest to have it return 10. If you're referring to unit tests running in dotnet.exe, it may be ok to expect 6.2 as long as it's understood. |
|
@SteveL-MSFT It's just annoying when the tests don't behave as the product. |
PR Summary
The test would fail if the developer mode is enabled but the machine has an older build than the minimum required build.
The change adds a check for the build version in the test.
PR Context
The current is causing CI failures.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.[feature]to your commit messages if the change is significant or affects feature tests