# $ Isn't Part of the Variable Name

Big gotcha.

![image049.png](https://4171205829-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LA8qNDXlOx79WorVawZ%2F-LA8qTOf8jN0CwdQbcQM%2F-LA8qUcsiZ-99Rb0a6pK%2Fimage049.png?generation=1523804930780601\&alt=media)

Can you predict what happened?

![image051.png](https://4171205829-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LA8qNDXlOx79WorVawZ%2F-LA8qTOf8jN0CwdQbcQM%2F-LA8qUdIHBuoj7dIFbaZ%2Fimage051.png?generation=1523804930765190\&alt=media)

You see, the $ is not part of the variable's name. If you have a variable named example, that's like having a box with "example" written on the side. Referring to example means you're talking about the box itself. Referring to $example means you're messing with the contents of the box.

So in my example, I used $example=5 to put 5 into the box. I then created a new variable. The new variable's name was $example - that isn't naming it "example," it's naming it the contents of the "example" box, which is 5. So I create a variable named 5, that contains 6, which you can see by referring to $5.

Tricky, right? Comes up all the time:

![image053.png](https://4171205829-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LA8qNDXlOx79WorVawZ%2F-LA8qTOf8jN0CwdQbcQM%2F-LA8qUdxwV1SRUx8wtDI%2Fimage053.png?generation=1523804930797428\&alt=media)

In that example, I used the -ErrorVariable parameter to specify a variable in which I would store any error that would occur. Problem is, I used $x. I should have used x by itself:

![image055.png](https://4171205829-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LA8qNDXlOx79WorVawZ%2F-LA8qTOf8jN0CwdQbcQM%2F-LA8qUel0_CC-efEHFzR%2Fimage055.png?generation=1523804930946064\&alt=media)

That will store any error in a variable named x, which I can later access by using $x to get its contents - meaning, whatever error was stored in there.
