I wanna be able to execute the following command without having to type that much
php E:\zftool\zftool.phar create project E:\test
So I created a zf.cmd file containing this
php E:\zftool\zftool.phar %1 %2 %3
But when I enter
zf create project E:\test
It only executes the alias
php E:\zftool\zftool.phar
Any ideas on how can I fix that? Thanks in advance.
================================================================================
[Edit]:
The solution proposed by JPBlanc solved my problem, but if you create the function at runtime you'll lost its definition after closing PowerShell window.
To make it persist for every session, you have to add that function to your profile:
Open Windows PowerShell.
Enter
notepad $profilecommand. If it opens an empty unnamed file, then you should close it and create a new $profile withNew-Item -path $profile -type filecommand.Paste your function code inside the file you've just created, save it and you're ready to go.
If receive any error messages like
"File cannot be loaded because the execution of scripts is disabled on this system"
that can be fixed by entering
Set-ExecutionPolicy Unrestricted or Set-ExecutionPolicy Unrestricted -Force