Hello -
I am trying to create a simple powershell script that will walk the steps of create a volume and a share otuside of the UI and force to go through each step along the way.
At first I was trying to make it so you would just fill in the $variables at the top of the script for what you want and then have it run the various new-ncvol commands- but this kept erroring.
Then when i just input New-NcVol it behaved exactly as i wanted to too by then prompting me for voume name, aggragate, juntion path, and size <-- this is exactly what i want- somthing that a co worker could run and just type in the information / details of the share they want to create - But i always get the same error right after inputting the size?
PS C:\WINDOWS\system32> New-NcVol
cmdlet New-NcVol at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
Name: test99
Aggregate: aggr4
JunctionPath: /test99
Size: 10
New-NcVol : Value in $global:CurrentNcController is not of type NetApp.Ontapi.Filer.C.NcController
At line:1 char:1
+ New-NcVol
+ ~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-NcVol], ArgumentException
+ FullyQualifiedErrorId : ControllerNotSpecified,DataONTAP.C.PowerShell.SDK.Cmdlets.Volume.NewNcVol
PS C:\WINDOWS\system32>
I am not looking to do bulk deployments or mass automation - just a way for a simple CLI script to walk through the vol / share creattion process so that anyone with some details could enter them in and it would get made - e.g. I send a mail to Joe saying hey man, can you run ( import ontap module etc ) new-ncvol with the following details ( name, size , aggr, svm ) and he would be able to do so for me?
Any help would be most appreciated!
Thanks
jordan