Over a million developers have joined DZone.

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


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


If you want to use something other than the default server, like when using multiserver, you can type

cf myserver


cf -server myserver

To stop the server just type


Happy PowerShell scripting!


Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}