How to pass a varible with the name

i currently writting a script could save and export the variable ,you can pass a variable into the parameter and save the $variable for the next time i can export it in the current session

$new = 123
note.ps1 -variable $new
get-note.ps1 -name new

but i having trouble passing the name of the variable into the parameter

It would be helpful if you provided your code so we could understand what you are trying to do.

When you pass the variable as $new you are passing the value of the variable, not the name.

1 Like

Guess you need a second parameter for note.ps1 and pass (get-variable $new).name to it.