Feature: Migrate netsh to SMA.PowerShell.Create() & admin banner#3499
Open
BornToBeRoot wants to merge 3 commits into
Open
Feature: Migrate netsh to SMA.PowerShell.Create() & admin banner#3499BornToBeRoot wants to merge 3 commits into
BornToBeRoot wants to merge 3 commits into
Conversation
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR modernizes the Network Interface “Configure” workflow by moving configuration execution to an in-process PowerShell runspace (System.Management.Automation.PowerShell.Create()), aligning the UI with other admin-gated areas, and documenting the UX changes.
Changes:
- Migrate network configuration actions from spawning
powershell.exeto in-processSMA.PowerShell.Create()execution. - Add an admin-required banner (“Restart as Administrator”) and gate configuration commands behind
IsAdmin. - Add status-bar success messages for configuration actions and update documentation/changelog accordingly.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Website/docs/changelog/next-release.md | Documents the migration to in-process PowerShell, the new admin banner, status messages, and button relocation. |
| Website/docs/application/network-interface.md | Updates user documentation: moves Flush/Release/Renew to Configure tab and explains admin requirement + banner. |
| Source/NETworkManager/Views/NetworkInterfaceView.xaml | Moves Flush/Release/Renew controls to Configure tab and adds the non-admin banner UI. |
| Source/NETworkManager/ViewModels/NetworkInterfaceViewModel.cs | Gates configuration commands on admin status and adds success/failure status messages for actions. |
| Source/NETworkManager.Utilities/PowerShellHelper.cs | Removes external powershell.exe execution helper, keeping only PowerShell-safe escaping. |
| Source/NETworkManager.Models/Network/NetworkInterface.cs | Implements in-process execution for netsh/ipconfig via a PowerShell runspace helper. |
| Source/NETworkManager.Localization/Resources/Strings.resx | Adds new localized strings for success messages and the admin banner message. |
| Source/NETworkManager.Localization/Resources/Strings.Designer.cs | Adds generated accessors for the new localization keys. |
Files not reviewed (1)
- Source/NETworkManager.Localization/Resources/Strings.Designer.cs: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+572
to
+575
| ps.Invoke(); | ||
|
|
||
| private void OnUserHasCanceled() | ||
| { | ||
| UserHasCanceled?.Invoke(this, EventArgs.Empty); | ||
| if (checkExitCode && ps.HadErrors) | ||
| throw new Exception(string.Join("; ", ps.Streams.Error.Select(e => e.ToString()))); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed in this pull request
To-Do
Contributing
By submitting this pull request, I confirm the following: