102k views
3 votes
Make a new Alias, so that you can run np to launch Notepad from a Powershell prompt

User Yanachen
by
7.6k points

1 Answer

4 votes

Final answer:

To create an alias in PowerShell to launch Notepad, use the New-Alias cmdlet followed by the alias name and the command. The alias can be created using the command New-Alias -Name np -Value notepad.exe. The alias will be valid for the current session.

Step-by-step explanation:

To create a new alias in PowerShell, use the New-Alias cmdlet followed by the alias name and the command you want to associate with it. In this case, to create an alias 'np' that launches Notepad, you can use the following command:

New-Alias -Name np -Value notepad.exe

Once you run this command, you can simply type 'np' in the PowerShell prompt to launch Notepad.

It's worth noting that the alias will only be valid for the current session. If you want the alias to be available every time you start PowerShell, you can add the command to your PowerShell profile script.

User Leon Grapenthin
by
7.8k points