Raising to a power takes precedence over negation so if you just do, for example -22 you should get -4.
However, if you do (-2)2 then you get +4, because the minus is squared as well.
If you want the positive result make sure you put the negative sign inside the brackets before squaring.