Page 1 of 1

Virtual SAN - Remote- Powershell

Posted: Thu Dec 27, 2018 8:48 am
by MANU
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

Re: Virtual SAN - Remote- Powershell

Posted: Sat Dec 29, 2018 4:23 am
by Michael (staff)
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.