79477652

Date: 2025-03-01 13:40:47
Score: 1
Natty:
Report link

By searching for "ps1" and "pathext", I'v found the corresponding code block from powershell/powershell github repository which explained the search order more specificly. See as:

/// <returns>
        /// A collection of the patterns used to find the command.
        /// The patterns are as follows:
        ///     1. [commandName].cmdlet
        ///     2. [commandName].ps1
        ///     3..x
        ///         foreach (extension in PATHEXT)
        ///             [commandName].[extension]
        ///     x+1. [commandName]
        /// </returns>

And ,alias succeed them all.

https://github.com/PowerShell/PowerShell/blob/33ed509ca493f004a0832a2af50b0ef5f9220eea/src/System.Management.Automation/engine/CommandSearcher.cs#L1310

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: plo