Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.