How to use function Alias in PowerShell?

PowerShellMicrosoft TechnologiesSoftware & Coding

Like the Parameter alias, we can also set the function alias name to refer to the function as a different name.


function Test-NewConnection{
   Write-Output "Testing $server connection"

Now, instead of the Test-NewConnection function name, you can directly use the function alias “TC” as shown below.

PS C:\> Tc -Server "Test1-win2k16"
Testing Test1-win2k16 connection
Published on 09-Nov-2020 14:04:06