You need to be passing through name reference as a string to Remove-Variable
Remove-Variable "var1"
SYNTAX
Remove-Variable [-Name] <string[]>
In your case you are passing though a variable value, e.g. "defucntion", but variable with name "defucntion" doesn't exist.
p.s. You can check help for functions by using Get-Help to identify parameter types
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…