Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to have this:

Set-Alias pr php \.fileToExecute

So that it runs the file in PHP (depending on where I am located when I execute pr).

share|improve this question

First create a function:

function RunPHP {php c:\www\phpinfo.php}

Then create the alias to run that function:

Set-Alias pr RunPHP

You probably want to run different files so the function should accept a variable as the file path:

function RunPHP($path) {php $path}

Now set the alias as shown above and you can run this command:

pr c:\www\file.php
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.