-
-
Notifications
You must be signed in to change notification settings - Fork 5
Add configurable PowerShell ExecutionPolicy support with settings UI #74
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
Add configurable PowerShell ExecutionPolicy support with settings UI #74
Conversation
Co-authored-by: Power-Maverick <36135520+Power-Maverick@users.noreply.github.com>
Co-authored-by: Power-Maverick <36135520+Power-Maverick@users.noreply.github.com>
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.
- Keep the original code where unrestricted bypass was set.
- Add additional features on the settings page that will allow user to provide the bypass policy to use
- If user has provided the bypass policy use that instead of the default one
|
@copilot make the necessary changes
|
Co-authored-by: Power-Maverick <36135520+Power-Maverick@users.noreply.github.com>
I've implemented the requested changes in commit ccd870c: ✅ Kept original code: Restored default behavior using How it works:
The new field is positioned between "MS Build Path" and "Namespace" and works for both interactive PowerShell sessions and background MSBuild operations. |
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.
Pull Request Overview
This PR adds configurable PowerShell ExecutionPolicy support to resolve corporate policy restrictions that prevented users from using the PCF Builder tool. The enhancement allows users to specify custom ExecutionPolicy parameters through a new settings UI field while maintaining backward compatibility.
- Added new "PowerShell Execution Policy" field in Settings form for custom ExecutionPolicy configuration
- Modified command initialization logic to use custom ExecutionPolicy when specified
- Added new helper methods for custom ExecutionPolicy handling with fallback to original behavior
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| Settings.cs | Added CustomExecutionPolicy property to store user's preferred ExecutionPolicy parameters |
| SettingsForm.cs | Integrated new ExecutionPolicy text field into Settings UI for user configuration |
| PCFBuilder.cs | Modified InitCommandLine and FindMsBuildPath methods to use custom ExecutionPolicy when available |
| Commands.cs | Added helper methods for custom ExecutionPolicy support with backward compatibility |
Files not reviewed (1)
- Maverick.PCF.Builder/Forms/SettingsForm.Designer.cs: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Removed default PowerShell initialization and added support for dynamic custom execution policies via `pluginSettings`. A success message is now displayed in the console when a custom policy is applied, enhancing flexibility and user feedback.
…tps://github.com/Power-Maverick/PCF-CustomControlBuilder into copilot/fix-56c38257-6850-4666-9ae7-98f0c41da468

Problem
Users with restrictive company policies that prevent setting PowerShell ExecutionPolicy at the CurrentUser scope were unable to use the PCF Builder tool. The tool previously required
Set-ExecutionPolicy -Scope CurrentUserwhich violates many corporate security policies, but could work withSet-ExecutionPolicy -Scope Processwhich only affects the current session.Solution
This PR adds configurable PowerShell ExecutionPolicy support through a new settings UI, allowing users to specify their preferred execution policy while maintaining backward compatibility with the original behavior.
Key Changes
Settings UI Enhancement:
Smart Execution Policy Logic:
InitCommandLine()to use custom execution policy if provided, otherwise use original defaultFindMsBuildPath()method to respect user's custom execution policySetExecutionPolicyToUnrestricted()behavior as default fallbackNew Methods Added:
New Settings Property:
Usage Examples
Default Behavior (Empty field):
Custom Policy (User enters:
-ExecutionPolicy Bypass -Scope Process -force):Custom Policy (User enters:
-ExecutionPolicy RemoteSigned -Scope CurrentUser -force):Benefits
This change resolves the issue where users couldn't use the tool due to company ExecutionPolicy restrictions, while providing maximum flexibility and maintaining full backward compatibility.
Fixes #73
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.