Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run multiple commands in a PowerShell Alias

Tags:

People also ask

How do I pass multiple PowerShell commands?

Chaining multiple PowerShell commands in one line However, if you want to do run multiple unrelated commands on the same line, you can use the firstcommand; secondcommand method. In this case, the second command gets executed even if the first command fails.

What are alias commands in PowerShell?

An alias is an alternate name or nickname for a cmdlet or for a command element, such as a function, script, file, or executable file. You can use the alias instead of the command name in any PowerShell commands.

Does && work in PowerShell?

Long description. Beginning in PowerShell 7, PowerShell implements the && and || operators to conditionally chain pipelines.


I'm trying to add an alias to PowerShell in my $profile file.

Set-Alias regrunt grunt;g aa;g cm 'regrunted';g ps;

When I run regrunt, only the first command is run. How can I make this alias run all of the commands?

PS: Please no comments about "do not commit minified files", we have all passed through this.