Windows PowerShell & ColdFusion Setup
Join the DZone community and get the full member experience.
Join For FreeI recently found the Windows PowerShell and can't stop using it. I've setup a couple of helper functions to let me start CF from a simple command in the console.
Before you can do anything you need to create a profile script. From within PowerShell you can run
$profile
to get the expected location for your profile. If you don't already have the file create it now. You will also need to tell PowerShell that it is ok to execute the new script by running
Set-ExecutionPolicy Unrestricted
You can, and should, read more about script execution.
If you have the standard ColdFusion install you can try this script (note: you should change line 1 to point at your correct ColdFusion install, my example shows CF9):
new-alias jrun "C:\ColdFusion9\runtime\bin\jrun.exe"
function cf($server="coldfusion"){
jrun -start $server
}
Using MultiServer? Try adding this to your profile script:
new-alias jrun "C:\JRun4\bin\jrun.exe"
function cf($server="cfusion"){
jrun -start $server
}
Now, in the console, you can start your default CF servers by simply typing
cf
If you want to use something other than the default server, like when using multiserver, you can type
cf myserver
or
cf -server myserver
To stop the server just type
Ctrl+C
Happy PowerShell scripting!
Published at DZone with permission of Steve Good, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments