Environment Startup Scripts

Hi Adam,

does the startup script can use PSU defined variables or it is not planned ?

we’d like to use startup script with persistent runspace for not having to load PowerCLI every apicalls for instance.

it’d be neat to be able to user variables in startup scripts.


That’s a good question.

We are using InitialSessionState for both variables and the startup script.

I would assume that it would work but maybe that is not the case.

it’s seems like it’s not the case unfortunately.

Can you take a look at this ?

Hi @adam,

Have you been able to take a look a this? I made a lot of tests and $secret scoped variables seems not usable from startup script for environments.

thanks in advance and feel free to let me know if I can be of any assistance :slightly_smiling_face:


I updated the other thread and opened an issue for this. They are, in fact, not working in start up scripts.