-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Disable PowerShell profile and simplify fingerprinting link speed on Windows #11183
Conversation
Thanks! Couple of things that may be helpful, although my experience is all PowerShell/C#, not go.
Since the Where-Object clause is an explicit equals (not
I used Slightly related note, I would love if this could log the names it's looking for at a debug level; then a new user would be able to see what values are allowed if they need to specify the adapter manually. Alternatively, you could explicitly say to use the "Interface Alias on Windows, not the "Interface Name". I fully admit that this was probably me overthinking things, because the InterfaceName is normally something like |
Oh thank you so much for the tips. My knowledge of PowerShell is quite limited, so always good to learn new things 🙂
Yup, I noticed this too while working on this, so I also opened #11184 😄 That PR adds a new field to log messages to display the device name during fingerprinting. Is this what you were looking for? |
3d21a71
to
8f3843c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job simplifying this!
100% of the credit goes to @randomchance. I just typed words 🙃 |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Fingerprinting link speed on Windows relies on running a PowerShell command and parsing its output.
If the user has any PowerShell profile that outputs anything to the console, this process will fail. This PR adds the
-NoProfile
parameter to avoid loading user profile when running the command.Link speeds are also not always integers, such as in the case of WiFi network cards, so this PRs changes the value parsing to useParseFloat
.Get-NetAdapter
returns a property calledSpeed
, which always returns the link speed in bytes/s, making parsing the command output easier.Closes #11171