# Run script from powershell in the same window

I have installed PHP and PHPUnit in my PC. Both of these files are in same directory and I have added to enviroment variable path. I have also associate .phar extension to run with php.exe application. Now, when I run phpunit.phar in powershell, it is opened in a new window rather the current one. How can I make this run in the same window everytime.

Note: When I do the same thing in cmd.exe, it is opened in same window which is surprising

-

## 1 Answer

Here is a dirty solution I discovered using batch files.

Create a file named phpunit.bat in any of the directory in path environment variables. You can choose windows directory if unsure.

Add the following code to the batch file

@echo off
echo.
"c:\path\to\php\php.exe" "C:\path\to\phpunit.phar" %*
exit

-