Page 1 of 1

Question about command-script

Posted: Fri Nov 24, 2017 12:08 pm
by kcl
Good morning.
I have the question. Can i write and share command-script to manage StarWind using powershell? (I worried about free license)
It can help to use basic feature. (Add,remove target, image, acl)

By the way, when i update ACL, powershell has a crit error, but add and remove work correctly.

Re: Question about command-script

Posted: Fri Nov 24, 2017 12:51 pm
by Boris (staff)
Feel free to do so.
As StarWind VSAN Free is community supported and StarWindX Powershell scripts are examples of how you can manage the setup, the community will definitely appreciate your input.

Re: Question about command-script

Posted: Mon Nov 27, 2017 9:17 am
by kcl

Re: Question about command-script

Posted: Mon Nov 27, 2017 3:04 pm
by Boris (staff)
Fine, keep the community updated.

Re: Question about command-script

Posted: Wed Feb 07, 2018 2:56 pm
by kcl
I Updated the script. Please write here wishes. I'll try to add them.
Many thanks to StarWind for Great product!

Re: Question about command-script

Posted: Wed Feb 07, 2018 3:36 pm
by Boris (staff)
Great. Keep doing the great work.

Re: Question about command-script

Posted: Tue Jun 26, 2018 2:02 pm
by webguyz
Boris,

In requirements its says -Powershell xD

The only references I found for xD were XenDesk Powershell. Is that what is required?

Ran your script but got errors and was wondering if its because I'm missing something.

Newbie to PowerShell.

Thanks!

Re: Question about command-script

Posted: Tue Jun 26, 2018 2:27 pm
by Boris (staff)
That was a smiley - xD. Nothing related to PowerShell. Interpretation is "It requires PowerShell, which is obvious as long as it is based on the StarWindX PowerShell module".

Re: Question about command-script

Posted: Tue Jun 26, 2018 2:43 pm
by webguyz
When I run the lastest script my PowerStar window comes up but in PS I get the error Below

The variable '$global:one' cannot be retrieved because it has not been set.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:589 char:1
+ $global:one
+ ~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (global:one:String) [], RuntimeException
+ FullyQualifiedErrorId : VariableIsUndefined


I can connect to one of my 2 HA nodes and when I click the HAImagex it does show me the info and sync status, but when I click on the IQN it shows nothing and generates PS Errors:

True v4.0.30319 C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5
0
0


The variable '$global:one' cannot be retrieved because it has not been set.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:589 char:1
+ $global:one
+ ~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (global:one:String) [], RuntimeException
+ FullyQualifiedErrorId : VariableIsUndefined

The variable '$M_TextBox01' cannot be retrieved because it has not been set.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:596 char:5
+ $M_TextBox01.Text
+ ~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (M_TextBox01:String) [], RuntimeException
+ FullyQualifiedErrorId : VariableIsUndefined

The property 'TargetName' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:519 char:5
+ $M_ListBox1.Items.Add(""+$targettemp.TargetName)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'Name' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:520 char:5
+ $M_ListBox1.Items.Add("LuneName: "+$targettemp.Name)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'File' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:521 char:5
+ $M_ListBox1.Items.Add("File: "+$targettemp.File)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'Size' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:522 char:5
+ $M_ListBox1.Items.Add("Size: "+$targettemp.Size)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'DeviceType' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:523 char:5
+ $M_ListBox1.Items.Add("Type: "+$targettemp.DeviceType)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'name' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:524 char:9
+ if ($targettemp.name -like "HA*") {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'TargetName' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:519 char:5
+ $M_ListBox1.Items.Add(""+$targettemp.TargetName)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'Name' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:520 char:5
+ $M_ListBox1.Items.Add("LuneName: "+$targettemp.Name)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'File' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:521 char:5
+ $M_ListBox1.Items.Add("File: "+$targettemp.File)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'Size' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:522 char:5
+ $M_ListBox1.Items.Add("Size: "+$targettemp.Size)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'DeviceType' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:523 char:5
+ $M_ListBox1.Items.Add("Type: "+$targettemp.DeviceType)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'name' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:524 char:9
+ if ($targettemp.name -like "HA*") {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'TargetName' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:519 char:5
+ $M_ListBox1.Items.Add(""+$targettemp.TargetName)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'Name' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:520 char:5
+ $M_ListBox1.Items.Add("LuneName: "+$targettemp.Name)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'File' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:521 char:5
+ $M_ListBox1.Items.Add("File: "+$targettemp.File)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'Size' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:522 char:5
+ $M_ListBox1.Items.Add("Size: "+$targettemp.Size)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'DeviceType' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:523 char:5
+ $M_ListBox1.Items.Add("Type: "+$targettemp.DeviceType)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

The property 'name' cannot be found on this object. Verify that the property exists.
At C:\Windows\system32\WindowsPowerShell\v1.0\Starwind_a_06.ps1:524 char:9
+ if ($targettemp.name -like "HA*") {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

Thanks! This is a very nice script and will be a valuable addition.

Re: Question about command-script

Posted: Mon Jul 02, 2018 4:51 pm
by Boris (staff)
I believe you would need to contact the author of the script - kcl.

Re: Question about command-script

Posted: Mon Jul 02, 2018 5:13 pm
by webguyz
I copied the script to the c:\windows\system32\WindowsPowerShell\v1.0 folder and it worked without error.

Thanks!

Re: Question about command-script

Posted: Mon Jul 02, 2018 5:51 pm
by Boris (staff)
Great to know this simple cheat. Thanks for posting.