Start a Conversation

Unsolved

This post is more than 5 years old

20795

October 15th, 2013 09:00

Powershell - Compellent "Cannot bind parameter"

So, I am new to the Compellent/Powershell scene and decided that I would try to some simple Volume Folder creations. (We have 3 new units and I don't want to manually create every folder, volume, etc.).  I feel like I am running into a newb problem here, but I have banged my head long enough.

Here's the issue.  I can run:

New-SCVolumeFolder SCRIPT_TEST -Connection $conn

No problems, the folder is created and all is right with the world.  But if I try to get a little complicated:

New-SCVolumeFolder "Auto Tier" -ParentSCVolumeFolder SCRIPT_TEST -Connection $conn

I get this error:

Cannot bind parameter 'SCVolumeFolder'. Cannot convert the "SCRIPT_TEST" value of type "System.String" to type "SCCommandSet.SCObjects.SCVolumeFolder".

I get the same bind error if I try to run:

Remove-SCVolumeFolder SCRIPT_TEST -Connection $conn

This happens whether I enclose the folder name in quotes, or set a variable and pass the variable.  What am I missing?

October 15th, 2013 11:00

Solved.  So, I was trying to be too simple with these scripts.  It did not like me trying to pass the test in, but if I let the system set the variable, it works. Example:

$folder = Get-SCVolumeFolder -Connection $conn -Name SCRIPT_TEST

Now, I can use the output of the folder listing (filtered by the name or even index) and then pass that in to create my multiple volume folders:

New-SCVolumeFolder SCRIPT_TEST -Connection $conn
$folder = Get-SCVolumeFolder -Connection $conn -Name SCRIPT_TEST

$array = "Admin","High Tier","Low Tier","SQL Direct Attached","Auto Tier"
foreach ($item in $array)
{New-SCVolumeFolder $item -ParentSCVolumeFolder $folder -Connection $conn}

Now, on to creating the volumes themselves.

No Events found!

Top