well hold the phone now - as it stands, your returning the error code here:

$ChangeVLKey = @error

What is it you figure you want to return ? If you want to return the error code, I would make a slight addition to what you have. As well, it is possible to return a string AND an error code (in @ERROR), all depends on what you want to do.