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).

link|improve this question

feedback

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
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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