Adding Write Protection to functions

by Dec 22, 2009

Functions by default have no write protection so they can easily be overwritten and redefined. You should do this if you'd like to make a function "read-only":

function ImportantFunction {
"You cannot overwrite me!"
}

(dir function:ImportantFunction).Options = 'ReadOnly'

Twitter This Tip! ReTweet this Tip!