It reassigns an existing alias name to a different PowerShell cmdlet. The Set-Alias command uses the Name parameter to specify the alias name C to a different PowerShell command Get-Content. The Get-Alias cmdlet uses the Name parameter to specify the alias name and retrieve the command name as Get-Command. In the above PowerShell script, earlier we assigned an alias name C to the Get-Command cmdlet. PS C:\> Set-Alias -Name C -Value Get-Content To reassign an existing alias C to a different command, use the following script. In the above example, we have assigned an alias name C to the Get-Command cmdlet. Using the Set-Alias cmdlet, you can reassign an existing alias to a different PowerShell cmdlet. The output of the above PowerShell set alias command is:Ĭool Tip: How to import alias in PowerShell! How to Reassign an existing alias to a cmdlet using Set-Alias To get the alias name for PowerShell cmdlet, use the Get-Alias command as below Get-Alias -Name C Set-Alias cmdlet creates a PowerShell alias for a cmdlet in the current session. In the above PowerShell script, the Set-Alias uses the Name parameter to specify the alias name for the PowerShell command Get-Command. Use the Set-Alias to create an alias name or to set an alias name for a cmdlet in PowerShell current session. How to Set Alias for a cmdlet in PowerShell Value: Specify the cmdlet name that is being used for aliased. It can take Global, Local, or Script value. Scope: Specify the scope for the new alias. Description: Specify the description of the alias. It accepts only alphanumeric characters for an alias name. ![]() Name: Specify the name of the new alias. The Set-Alias cmdlet in PowerShell doesn’t set permanent alias for a cmdlet. PowerShell Set-Alias creates or change a PowerShell command alias. What happens when a biomedical engineer spots a gap in his own skills that turns out to be a gap for many others in the same industry? In the case of Neil Thompson, it led to the birth of his business, Teach the Geek, which helps engineers gain valuable. Nerd Journey # 193 - Communication for Specialists with Neil Thompson (1/2) Best Practices
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |