Array Setup and Networking
1752295 Members
5317 Online
108786 Solutions
New Discussion юеВ

Re: PowerShell Module

 
jrich52352
Trusted Contributor

PowerShell Module

jrich523/NimblePowerShell ┬╖ GitHub

Built and tested in Version 3 (v2 compatibility will be validated but it should be fine)

Install

Run the following line in PowerShell

iex (new-object System.Net.WebClient).DownloadString('https://raw.github.com/jrich523/NimblePowerShell/master/Install.ps1')

Load

In powershell load the module by typing:

Import-Module Nimble

This might prompt for loading depending on what your execution policy is.

To get a list of commands type:

Get-Command -module Nimble

currently the help files are not populated but once I get basic functionality up and running I'll start to sure up the code and populate help details.

Examples

##Connect to array first, currently only handles one array

Connect-NSArray -SystemName 192.168.1.55 -Password p@ssw0rd   ##currently password is just clear text, will change that soon


#List volumes

Get-NSVolume


#New volume

New-NSVolume -Name testvol -Size 1tb -Description "powershell test" -PerformancePolicy default



#a more detailed example, assume you have a "clonetest" volume:


Get-NSVolume

Get-NSSnapShot -Volume clonetest

Get-NSVolume -Name clonetest| New-NSSnapshot -Name CloneTest2 | New-NSClone -Name CloneTest2

Get-NSSnapShot -Volume clonetest

Get-NSVolume

Get-NSVolume clonetest2 | Get-NSVolumeACL

Get-NSInitiatorGroup

Add-NSInitiatorGroupToVolume -InitiatorGroup esx -Volume clonetest2 -Access Volume

Get-NSVolume clonetest2 | Get-NSVolumeACL

Get-NSVolume clonetest2 | Get-NSVolumeACL | Get-NSInitiatorGroup

Remove-NSVolume clonetest2 -Force

Get-NSVolume clonetest | Get-NSSnapShot | Remove-NSSnapShot



example.gif


Requests

If you have a special need let me know i can probably easily add it in, just trying to get base functionality and work towards replication the UI functionality.

Message was edited by: Justin Rich
module version 1.1 uploaded

79 REPLIES 79
jrich52352
Trusted Contributor

Re: PowerShell Module

I have made some updates, mostly around docs so that cmdlets should have their help populated.

Also I added some functions around the performance policy stuff.

There will be a few more updates coming.

gmiller132
New Member

Re: PowerShell Module

Good stuff!

I have a question about the module. There is a file called GroupMgmt.dll. Are you the author of this? Is source available?

jrich52352
Trusted Contributor

Re: PowerShell Module

Nimble actually works off SOAP calls so this is an automatically generated dll from visual studio.

gmiller132
New Member

Re: PowerShell Module

That's very interesting. Does Nimble publish a WSDL with the available interfaces?

jrich52352
Trusted Contributor

Re: PowerShell Module

Not really, which is whats been making this so tricky, however today i should have a new version published with full examples!

The only thing (I think) that will be left will be CHAPS and creating protection plans/schedules.

clint_mcguire
Occasional Advisor

Re: PowerShell Module

I get an error when I load the module.

Import-Module : The module manifest nimble.psd1 could not be processed because it is not a valid Windows PowerShell restricted language file. Remove the elements that are not permitted by the restricted language:

At C:\...\Modules\nimble\nimble.psd1:64 char:22

+ FormatsToProcess = @(Nimble.format.ps1xml)

+                      ~~~~~~~~~~~~~~~~~~~~

The command 'Nimble.format.ps1xml' is not allowed in restricted language mode or a Data section.

At line:1 char:1

I unblocked the zip file before extracting and I've also tried using -force on the Import-Module cmdlet...

Anything I'm missing?

jrich52352
Trusted Contributor

Re: PowerShell Module

hmm could have sworn i fixed that before i uploaded it, its a simple problem, just need to quote it, the line should look like

FormatsToProcess = @('Nimble.format.ps1xml')


im not so good at the whole git thing


i should actually have a newer, and much better, version in the next hour or two.

clint_mcguire
Occasional Advisor

Re: PowerShell Module

Thanks!

That fixed it.

jrich52352
Trusted Contributor

Re: PowerShell Module

There an update and an installer! not sure how well it would work with updating, but a clean install works great. I've had a chance to test most of the cmdlets pretty well.

a large portion of the help test is populated but not all of it.

let me know if you have any problems or suggestions!