Skip to content

powershell session from linux box to windows server gets stuck #24064

@mbhatia-mdsol

Description

@mbhatia-mdsol

Prerequisites

Steps to reproduce

Hi, I am running a powershell script from a linux box where it needs to execute several commands on 4 remote windows servers and finally deploy the application on them. For this I am using pwsh plugin. At several points in the script, I am creating ps session using new-pssession command and removing them as soon as the work is done. Sometimes i even have to use foreach/for loop to execute a function on all 4 remote nodes. This thing works fine sometimes but many a times the code gets stuck while executing the function on those nodes.

Expected behavior

The sessions should work properly without getting stuck and code must go to the next step.

Actual behavior

Sometimes it gets executed on the 2nd session and then gets stuck and other time it gets stuck on the first one itself. There is no specific point where it gets stuck. And there is no specific remote node for which this issue is coming up.

Earlier we used to run this script from a windows node and it used to work fine. 

I even created a separate small script to perform one of these functions via sessions, and it worked fine. So it shows that my code is logically correct. Is there any timeout issue with the PSSession or pwsh plugin or something related to this? It's a very big blocker for us right now.

Error details

No response

Environment data

I login to a windows server where via putty i connect to the linux box. from that linux box i am trying to access and perform some steps on multiple windows remote nodes. I am using PS version 7.

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions