Firstly, you need to have a folder with your scripts and add this folder to Environment path
(PC properties → advanced → Environment variables → Edit path → add path to your folder)
Method 1 (bat file)
create bat file with command to perform. Here sample content of
php artisan tinker
It will work anywhere - both cmd and powershell. One downside it will annoy you with prompt
Terminate batch job (Y/N)? on ctr+c.
Method 2 (ps1 file)
create ps1 file with command to perform. Here sample content of
Invoke-Expression 'php artisan tinker'
It will work only in powershell. But it doesn't prompt
Terminate batch job (Y/N)? which is a relief.