How to create a Powershell Alias for Set-Executionpolicy

As per the documentation:

You can assign an alias to a cmdlet, script, function, or executable file.

You cannot assign an alias to a command and its parameters. For example, you can assign an alias to the Get-Eventlog cmdlet, but you cannot assign an alias to the Get-Eventlog -LogName System command.

This is presumably a way to avoid having to disambiguate a parameter that exists on an alias and which is passed when invoking the alias.

You therefore have two options:

  1. Encapsulate your command in a function called Enable-Rush (note the PowerShell acceptable naming scheme, if you care); or

  2. Save the command as a file and create a alias to the file.

And to persist it, put it in a $PROFILE.