If you're on Linux or a UNIX-based platform, "expect" is a tool used to interact with text-based sessions through scripting. Most platforms have it as part of the default install, or added as a package. Supposedly, it's also available for Windows, but I can't vouch for how it operates there.
See:
http://en.wikipedia.org/wiki/ExpectHere's an example (not tested in the slightest, use at your own risk):
Code:
#!/usr/bin/expect
set timeout 30
# This is to directly connect to an array, though should be
# easily altered to use a local CLI. Assumes you're using
# SSH-key-based authentication, to avoid setting up a
# password in the script.
spawn ssh "user@your-3par-array"
expect "%"
send "shutdownsys halt\r"
# The prompt reads:
# Do you REALLY want to HALT this InServ? yes or no: yes
expect "yes or no:"
send "yes\r"