Virtual SAN - Remote- Powershell

Software-based VM-centric and flash-friendly VM storage + free version

Moderators: anton (staff), art (staff), Max (staff), Anatoly (staff)

Post Reply
MANU
Posts: 3
Joined: Fri Dec 14, 2018 1:18 pm

Thu Dec 27, 2018 8:48 am

Hi,
This is my third Post in this forum, i got great support from you guys. now there are some Problems i am facing. i can run StarwindX commands in Powershell of the same computer in which the Starwind service is running.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 Starwind Modules are not loading.
I am adding the Response Message here while i run the Starwind Import statement from Remote PS.

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
Michael (staff)
Staff
Posts: 317
Joined: Thu Jul 21, 2016 10:16 am

Sat Dec 29, 2018 4:23 am

Hello MANU,
You can write a script and then run PowerShell with -STA parameter.
Try this example: powershell.exe -sta -file "C:\MyScript.ps1"
Please let us know if it helps.
Post Reply