-
-
Notifications
You must be signed in to change notification settings - Fork 28
Description
Add cmdlets to install/uninstall the Azure DevOps Shell in, at least, the following targets:
- Windows Terminal
- Windows Start Menu
- Windows Taskbar
Title:
Conditionally create Windows Terminal shortcut for Azure DevOps Shell in WiX installer
Description:
The current WiX-based installer for TfsCmdlets always creates an “Azure DevOps Shell” shortcut pointing to Windows PowerShell. We’d like to enhance both the MSI and new PowerShell-based installers so that, if Windows Terminal is installed on the user’s machine, they create a shortcut opening the “Azure DevOps Shell” profile in Windows Terminal; otherwise they fall back to the existing PowerShell shortcut.
Additionally, we need to introduce two new cmdlets—Install-TfsShell and Uninstall-TfsShell—to provide the same conditional behavior when users install TfsCmdlets via PowerShell Gallery. To fully support Windows Terminal, we’ll ship two JSON profile fragments (one for Windows PowerShell, one for PowerShell Core/7) named “Azure DevOps Shell,” and deploy them alongside the module.
Current Behavior:
- In
Setup/Product.wxs, the Azure DevOps Shell shortcut is hard-coded to launch PowerShell withImport-Module AzureDevOpsShell. - There are no
Install-TfsShellorUninstall-TfsShellcmdlets in the module. - No Windows Terminal profile fragments are provided.
Desired Behavior:
-
Detection
- Detect presence of Windows Terminal (e.g. via registry AppPath lookup for
wt.exeor file search in%LocalAppData%\Microsoft\WindowsApps\wt.exe).
- Detect presence of Windows Terminal (e.g. via registry AppPath lookup for
-
MSI Installer
-
If found, create a desktop shortcut targeting:
wt.exe -p "Azure DevOps Shell" -
If not found, create the legacy PowerShell shortcut as today.
-
-
PowerShell Gallery Installer
- Implement
Install-TfsShellto perform the same detection and shortcut creation logic at module install time. - Implement
Uninstall-TfsShellto remove whichever shortcut was created.
- Implement
-
Windows Terminal Profile Fragments
-
Windows PowerShell profile (
AzureDevOpsShell-WinPS.json), with command line: -
PowerShell Core profile (
AzureDevOpsShell-PSCore.json), with command line:{ "name": "Azure DevOps Shell (PowerShell Core)", "commandline": "pwsh.exe -NoExit -Command Import-Module AzureDevOpsShell", "icon": "ms-appx:///ProfileIcons/PowerShellCore.png", "startingDirectory": "%USERPROFILE%" } -
Install these fragments into the user’s WT settings folder (e.g.
%LocalAppData%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\profiles\) on install, and remove them on uninstall.
-
Proposed Changes:
-
WiX (
Product.wxs)-
Add
<AppSearch>or<DirectorySearch>+<FileSearch>to set aWTPATHproperty forwt.exe. -
Define two mutually-exclusive
<Component>entries underDesktopFolder:- Windows Terminal shortcut: conditioned on
WTPATH, targeting[WTPATH]with-p "Azure DevOps Shell". - PowerShell shortcut: conditioned on
NOT WTPATH, targeting PowerShell as today.
- Windows Terminal shortcut: conditioned on
-
-
PowerShell Module
-
New cmdlets:
Install-TfsShell— detect WT, install the appropriate shortcut, and deploy both profile fragments.Uninstall-TfsShell— remove the shortcut and both profile fragments.
-
-
Profile Fragments
- Add
AzureDevOpsShell-WinPS.jsonandAzureDevOpsShell-PSCore.jsonunder module assets. - Copy/remove them in the WT settings folder on install/uninstall.
- Add
Acceptance Criteria:
- MSI Installer: Creates WT-based shortcut when Windows Terminal is present; otherwise falls back to PowerShell.
- PowerShell Gallery Installer:
Install-TfsShell&Uninstall-TfsShellreplicate the same logic. - Profile Fragments: Both “Azure DevOps Shell (Windows PowerShell)” and “Azure DevOps Shell (PowerShell Core)” profiles appear in Windows Terminal after installation and are removed on uninstall.
- No regressions in existing PowerShell-only scenarios.
References:
- Product.wxs: https://github.com/igoravl/TfsCmdlets/blob/main/Setup/Product.wxs
- WiX AppSearch docs: https://wixtoolset.org/documentation/manual/v3/xsd/util/registrysearch.html
- WiX DirectorySearch/FileSearch: https://wixtoolset.org/documentation/manual/v3/xsd/util/directorysearch.html
{ "name": "Azure DevOps Shell (Windows PowerShell)", "commandline": "powershell.exe -NoExit -Command Import-Module AzureDevOpsShell", "icon": "ms-appx:///ProfileIcons/PowerShell.png", "startingDirectory": "%USERPROFILE%" }