Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Windows PowerShell & ColdFusion Setup

DZone's Guide to

Windows PowerShell & ColdFusion Setup

·
Free Resource

I 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!

Topics:

Published at DZone with permission of Steve Good, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}