Array Setup and Networking
1752866 Members
3482 Online
108791 Solutions
New Discussion юеВ

Re: PowerShell Module

 
casey_jones
New Member

Re: PowerShell Module

Hello Justin,

I am attempting to use a PS script to create multiple volumes on an array using this module. However, when attempting to set the performance policy name I receive errors. It appears that it does not like the spaces in the performance policy name. Please see the error below:

New-NSVolume : Cannot validate argument on parameter 'PerformancePolicy'. The argument "Exchange 2010 data store" does not belong to the set "default,DPM,'Exchange 2003 data store','Exchange 2007 data store','Exchange 2010 data store','Exchange log','Hyper-V CSV','Oracle OLTP',SharePoint,'SQL Server','SQL Server 2012','SQL Server Logs','VMware ESX','VMware ESX 5','VMware VDI','Windows File Server'" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.

At line:3 char:67 + New-NSVolume -Name $_.LunName -Size $_.LunSize -PerformancePolicy $_.Preformance ...

Is there any way around this?

Thanks!

jrich52352
Trusted Contributor

Re: PowerShell Module

Did you try to manually quote it? Im trying to find a good way around the space problem, its actually a bug with powershell and the dynamic validation sets.

If you did try the quotes and it still doesnt work, then you arent the only one.

Im working through this problem with someones else (here Re: Automate ESX Datastore creation with Nimble PowerShell Module) and i've suggested they reinstall the module. Im not sure when you pulled it down, but there might have been a bug in one of the posted versions. close powershell, remove the Nimble folder from your module path (my documents\windowspowershell\modules) and then run the installer again.

also what version of powershell are you using?

casey_jones
New Member

Re: PowerShell Module

Justin,

I have tried with single quotes, double quotes and both single inside double but the same result every time. I first downloaded the module on 1/28 in the afternoon.

I'm using powercli 5.5 release 1 and powershell ISE has the same result.

Thanks!

jrich52352
Trusted Contributor

Re: PowerShell Module

What version of powershell though? 2, 3 or 4?

I did all my testing in 3 and 4.

casey_jones
New Member

Re: PowerShell Module

I am running version 3

jrich52352
Trusted Contributor

Re: PowerShell Module

weird, i've tested with both 3 and 4, and it doesnt populate the quotes as it should, but it does run correctly when i give it the quotes.

the code was last published on the 22nd.

I'll clear out everything i've got and run a few more tests.

jrich52352
Trusted Contributor

Re: PowerShell Module

do you tab complete it and then slap quotes around it or have you been typing it out?

jrich52352
Trusted Contributor

Re: PowerShell Module

Just made a modification to the utility.ps1, which might help fix the issue, not completely, you'll still have to manually add quotes, but it should at least make that work now.

also, make sure you are connected to the unit first, I just realized that if its not connected it wont create the param, i'll have to find a way around this.

casey_jones
New Member

Re: PowerShell Module

Justin,

So far so good. I have not tried it with the script variables but definitely works when manually specifying with quotes.

Thanks!

jrich52352
Trusted Contributor

Re: PowerShell Module

Great let me know if you run in to any other issues