When working in a POSIX shell, I can use the builtin type to see how an executable, shell function, builtin, or alias is defined.
For instance, I have a shell function box, which will draw an ASCII box around a given piece of text:
$ box "I am the operator of my pocket calculator"
#############################################
# I am the operator of my pocket calculator #
#############################################
and I can see how the function is defined like this:
$ type box
box is a function
box ()
{
t="$1xxxx";
c=${2:-#};
echo ${t//?/$c};
echo "$c $1 $c";
echo ${t//?/$c}
}
Is there a PowerShell equivalent? I'm particularly interested in seeing PowerShell functions that I have defined in $profile, and seeing how they are defined -- I've been using
type $profile
to show all of them, but I want something a little more targeted. (Note that the PowerShell/Cmd command type is equivalent to the Unix cat and is not in any way related to the Unix type builtin that I'm asking about.)