Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $initialState = [System.Management.Automation.Runspaces.InitialSessionState]::Create()
- $initialState.ImportPSModule("AzureAD")
- $rsPool = [runspacefactory]::CreateRunspacePool($state)
- $rsPool.SetMaxRunspaces(10) # number of threads to run at once
- $rsPool.ApartmentState = "STA"
- $rsPool.ThreadOptions = "ReuseThread"
- $rsPool.Open()
- $code = {
- param (#enter parameters here#)
- Connect-AzureAD #...
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement