Powershell session

Can you help me confirm that each powershell script step runs in it’s own session?

I’m running workers and it looks like steps are running in the same powershell session as i’m seeing modules already loaded into session.

Hi Jon,

When a deployment uses PowerShell in different steps, each step has its own instance of PowerShell. If you import a module in a previous step, it should not be already imported in a later step. Could you please provide some code snippets and logs indicating where you are having the issue?

Jeremy Miller

Jeremy, Thanks for the confirmation. After investigation our side the issue was coming from powershell “module auto-loading”. We had a command that used AWSPowershell and auto loaded the latest version and then later on in the step template we had a custom module with a reference to AWSPowershell but a lower version.

The loading in the lower version of AWSPowershell caused a type data clash with the higher version that was auto loaded.

Hey Jon,

I’m glad you found the culprit, troubleshooting code can be a needle in a hay stack sometimes. Thanks for the update on what the issue was, good info to have!