-
-
Couldn't load subscription status.
- Fork 28
Add Install-TfsShell and Uninstall-TfsShell cmdlets with Windows Terminal support #252
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
base: main
Are you sure you want to change the base?
Conversation
…inal support Co-authored-by: igoravl <725797+igoravl@users.noreply.github.com>
Co-authored-by: igoravl <725797+igoravl@users.noreply.github.com>
Co-authored-by: igoravl <725797+igoravl@users.noreply.github.com>
Test Results0 tests 0 ✅ 0s ⏱️ Results for commit 5aacea1. ♻️ This comment has been updated with latest results. |
| { | ||
| "name": "Azure DevOps Shell (Windows PowerShell)", | ||
| "commandline": "powershell.exe -NoExit -Command \"Import-Module TfsCmdlets; Enter-TfsShell\"", | ||
| "icon": "ms-appx:///ProfileIcons/PowerShell.png", |
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.
Use the Assets/TfsCmdlets_Icon_128.png file instead as an icon
| } | ||
| catch | ||
| { | ||
| // Registry access might fail, continue with file-based detection |
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.
@copilot Why is the file-based detection at the top of the method? Shouldn't it be here?
Besides, separate the detection logic (registry-based, file-based) in their own methods for readability/maintainability sake.
| return null; | ||
| } | ||
|
|
||
| protected override void CacheParameters() |
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.
@copilot You should not need to implement this. It's generated by the source generator.
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.
This file is auto-generated from the XML comments in the actual cmdlet. You don't need to generate it
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.
This file is auto-generated from the XML comments in the actual cmdlet. You don't need to generate it
| { | ||
| "name": "Azure DevOps Shell (PowerShell Core)", | ||
| "commandline": "pwsh.exe -NoExit -Command \"Import-Module TfsCmdlets; Enter-TfsShell\"", | ||
| "icon": "ms-appx:///ProfileIcons/PowerShellCore.png", |
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.
Use the Assets/TfsCmdlets_Icon_128.png file instead as an icon
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.
Just like with the Windows Terminal profiles, I want to support both PSWindows and PSCore here. The PSCore icon should be conditioned to the presence of PowerShell Core (pwsh.exe). Once it is detected, determine then whether to create it as a regular pwsh.exe shortcut, or a shortcut to Windows Terminal.
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.
Review my comments and do the required changes
This PR introduces two new cmdlets that enable users to install and uninstall Azure DevOps Shell shortcuts with intelligent Windows Terminal detection and integration.
Overview
The new cmdlets provide a PowerShell-native way to manage shell shortcuts, automatically detecting Windows Terminal and creating appropriate shortcuts while maintaining backward compatibility with traditional PowerShell environments.
Key Features
Install-TfsShell Cmdlet
Uninstall-TfsShell Cmdlet
Enhanced WiX Installer
The MSI installer now includes Windows Terminal detection via registry AppSearch, with conditional component installation that creates Windows Terminal shortcuts when detected or falls back to PowerShell shortcuts for legacy compatibility.
Usage Examples
Windows Terminal Integration
Two JSON profile fragments are included:
Both profiles are configured to launch with
Import-Module TfsCmdlets; Enter-TfsShelland use appropriate Windows Terminal icons.Implementation Details
Backward Compatibility
The implementation maintains full backward compatibility:
Fixes #101.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.