Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -565,21 +565,15 @@ private void Process_Types_Ps1Xml(string filePath, ConcurrentBag<string> errors)
typeName,
new PSScriptProperty(
@"DisplayName",
GetScriptBlock(@"if ($this.Name.IndexOf('-') -lt 0)
{
if ($null -ne $this.ResolvedCommand)
GetScriptBlock(@"if ($null -ne $this.ResolvedCommand)
{
$this.Name + "" -> "" + $this.ResolvedCommand.Name
}
else
{
$this.Name + "" -> "" + $this.Definition
}
}
else
{
$this.Name
}"),
"),
setterScript: null,
shouldCloneOnAccess: true),
typeMembers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,16 @@ Describe "Get-Alias DRT Unit Tests" -Tags "CI" {
$returnObject[$i].Definition | Should -Be 'Get-Command'
}
}

It "Get-Alias DisplayName should always show AliasName -> ResolvedCommand for all aliases" {
Set-Alias -Name Test-MyAlias -Value Get-Command -Force
Set-Alias -Name tma -Value Test-MyAlias -force
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent parameter capitalization: -force should be -Force to match the capitalization used in line 160 and PowerShell conventions.

Suggested change
Set-Alias -Name tma -Value Test-MyAlias -force
Set-Alias -Name tma -Value Test-MyAlias -Force

Copilot uses AI. Check for mistakes.
$aliases = Get-Alias Test-MyAlias, tma
$aliases | ForEach-Object {
$_.DisplayName | Should -Be "$($_.Name) -> Get-Command"
}
$aliases.Name.foreach{Remove-Item Alias:$_ -ErrorAction SilentlyContinue}
}
}

Describe "Get-Alias" -Tags "CI" {
Expand Down
Loading