Forum Discussion

pra4ash's avatar
pra4ash
Copper Contributor
Jun 03, 2020

Variable not appearing in Function

Guys - newbie here, please bear with me.

1. I have a function that'll store user credential. It's in the profile file

2. profile loads, I initiate the function manually Get-MyUserCred

3. Loads successfully and exits the function

4. Why am I not able to use the variable ($cred) from that function? It just doesn't work, however, if I remove the function from the profile file, it works.

 

Not sure if this makes sense to you guys, but any help is much appreciated!

Thank you 

 

#Prakash

Resources