Repository navigation
Use WMI in Get-Uptime on Windows - #24644
Ilya (iSazonov) wants to merge 1 commit into
Conversation
|
Just as an FYI, WMI is typically not accessible for non-admins in a non-interactive session like ssh/PSRemoting. |
|
Payment for accuracy. :-) Another official API I know Do you know any other ways that we could use? |
|
I'm not aware of any but I've not really had a look before. I just know that in Ansible we've tried to reduce our use of WMI because it doesn't work on a network logon unless the user is an administrator. I guess it's a question here if the cmdlet should get the more accurate information at the cost of erroring in a PSRemoting session or whether it should have a fallback in case that fails. |
|
We need more discuss in related issue. |
|
📣 Hey Ilya (@iSazonov), how did we do? We would love to hear your feedback with the link below! 🗣️ 🔗 https://aka.ms/PSRepoFeedback |
PR Summary
Fix #24432
PR Context
The stopwatch has a significant drift in Windows over time so it is better use WMI request.
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.- [ ] Issue filed:
(which runs in a different PS Host).