Skip to content
Discussion options

You must be logged in to vote

The $adtSession variable isn't a global by any means, there's zero globals in PSAppDeployToolkit. The reason it's available in your extension module is because it's available in a parent scope of your module (i.e. it's defined in your script which is importing your extension module, therefore your script is parent to the module).

Because the above relies on happenstance, unless your extension module will always be called from a script where the script defines $adtSession, I'd recommend using Get-ADTSession for consistency and reliability.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mjr4077au
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants