locked
Remote Powershell Module Loading Issue RRS feed

  • Question

  • Hi,
    i want to access the Powershell of the Computer in which the Service is installed from a remote machine. i can able to connect the powershell from remote PC. but the Modules are not loading.
    I am adding the Response Message here while i run the Starwind Import statement from Remote PS. (Starwind is a Virtual SAN).

    The Modules are listing and Starwind Commands are running in the powershell of same PC where the Starwind Service is installed.

    But the Modules are not loading when the Powershell is accessed Remotely

    StarWindX doesn't support current appartment. You need to run this script with -STA switch to use StarWindX.
    At line:1 char:1
    + Invoke-Command -ScriptBlock { Import-Module StarWindX } -Session $s
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (StarWindX doesn... use StarWindX.:String) [], RuntimeException
    + FullyQualifiedErrorId : StarWindX doesn't support current appartment. You need to run this script with -STA swit
    ch to use StarWindX.



    Kindly asking for Support. Waiting for your Response

    Thursday, December 27, 2018 9:02 AM

All replies

  • "StarWindX doesn't support current apartment"

    Contract the module vendor for assistance.  PowerShell remoting runs as MTA.  The module is not compatible with remoting.


    \_(ツ)_/


    • Edited by jrv Thursday, December 27, 2018 9:56 AM
    Thursday, December 27, 2018 9:55 AM
  • Hi,
    i want to access the Powershell of the Computer in which the Service is installed from a remote machine. i can able to connect the powershell from remote PC. but the Modules are not loading.
    I am adding the Response Message here while i run the Starwind Import statement from Remote PS. (Starwind is a Virtual SAN).

    The Modules are listing and Starwind Commands are running in the powershell of same PC where the Starwind Service is installed.

    But the Modules are not loading when the Powershell is accessed Remotely

    StarWindX doesn't support current appartment. You need to run this script with -STA switch to use StarWindX.
    At line:1 char:1
    + Invoke-Command -ScriptBlock { Import-Module StarWindX } -Session $s
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : OperationStopped: (StarWindX doesn... use StarWindX.:String) [], RuntimeException
    + FullyQualifiedErrorId : StarWindX doesn't support current appartment. You need to run this script with -STA swit
    ch to use StarWindX.



    Kindly asking for Support. Waiting for your Response

    The best place to ask these questions is StarWind Support Forum, there's quite a big PowerShell community.

    Here:

    StarWind Software Support Forum

    https://forums.starwindsoftware.com

    I've already asked engineers to assist you :) 


    Cheers,

    Anton Kolomyeytsev [MVP]

    StarWind Software

    Profile:   Blog:   Twitter:   LinkedIn:   

    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

    Wednesday, January 2, 2019 9:36 AM
  • Hey, 

    As mentioned in the error message, you can run script with a -STA switch. Example: powershell.exe -sta -file "C:\MyScript.ps1". 

    You can install StarWindX on the management machine and connect to machine with StarWind Service running via network to avoid using PS remote. 


    Cheers,

    Alex Bykvoskyi

    StarWind Software

    Blog:   Twitter:   LinkedIn:  

    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

    Thursday, January 3, 2019 8:37 AM