I'm trying to make a simple function to create Variables in powershell with generated name
I'm using this code :
function createAnewVariable {
[CmdletBinding()]
Param(
[String]$Name
)
New-Variable -Name GenLink$Name -Value "AMIGA" -Option AllScope
}
createAnewVariable -Name "AutoVAR"
Outside a function it's working perfectly when i do a get-variable i can see my automatic created variables like $GenLinkName but inside a function i don't have access to the varaible in the list and i can't call it ! oO
It's maybe simple but i don't understand why :)
Someone can tell me where i'm wrong please ?