You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Get-Help does not resolve aliases to scripts if they are not in the path #2899
The original bug is filed here, PowerShell v5.1
I can reproduce it with the latest powershell-6.0.0-alpha.14-win7-x86.
Here is the description of the issue and steps to reproduce.
Create a directory C:\TEMP\HelpAlias (we assume it is not in the path yet).
Create a script Test-Me.ps1 in it:
<#.Synopsis Test help.Description Test help#>
Open a PowerShell console and invoke the following commands:
0> Set-Alias zz C:\TEMP\HelpAlias\Test-Me.ps1
0> Get-Help zz
Name : zz
Category : Alias
Synopsis : Test-Me.ps1
Component :
Role :
Functionality :
0> $env:path = $env:path + ';C:\TEMP\HelpAlias'
0> Get-Help zz
NAME
C:\TEMP\HelpAlias\Test-Me.ps1
SYNOPSIS
Test help
SYNTAX
C:\TEMP\HelpAlias\Test-Me.ps1 [<CommonParameters>]
DESCRIPTION
Test help
Expected behavior
Get-Help works for properly defined aliases to scripts regardless of
their location, i.e. included in the path or not. In other words, the
result is the same as if Get-Help is invoked with the script path
defined by the alias.
Actual behavior
We can see that the alias zz is not resolved by Get-Help when the script is
not the path. Then it is resolved fine after adding the directory to the path
and Get-Help zz gets the expected help.
Reacted by Kevin Berridge, Nick Reilingh and Lance Craig
Bump (hopefully to prevent auto closure by the bot). This is a pain in known scenarios. Sometimes scripts distributed with a module should be just scripts and not script modules (modules have unwanted features, sometimes). The natural workaround (working, solving known issues) is scripts aliases. But help is not working...
This issue still exists in 7.5.0
I have to bump it again to prevent auto closure by the microsoft-github-policy-service.
If there is no further activity from the PS team then I'll probably close the issue myself. Any thoughts, plans?
Activity
ThomasNieto commentedon Aug 18, 2023
This is still an issue on 7.4-preview4.
nightroman commentedon Feb 14, 2024
Bump (hopefully to prevent auto closure by the bot). This is a pain in known scenarios. Sometimes scripts distributed with a module should be just scripts and not script modules (modules have unwanted features, sometimes). The natural workaround (working, solving known issues) is scripts aliases. But help is not working...
nightroman commentedon Aug 13, 2024
The issue still exists in 7.4.4
nightroman commentedon Feb 10, 2025
This issue still exists in 7.5.0
I have to bump it again to prevent auto closure by the
microsoft-github-policy-service.If there is no further activity from the PS team then I'll probably close the issue myself. Any thoughts, plans?
microsoft-github-policy-service commentedon Feb 11, 2025
📣 Hey Roman Kuzmin 1967-2026 (@nightroman), how did we do? We would love to hear your feedback with the link below! 🗣️
🔗 https://aka.ms/PSRepoFeedback
nightroman commentedon Feb 11, 2025
Suboptimal