Hi,
From the below script, SCSI ID shows blank, For Example, it should shows as (1:1)
From,when, I execute the script, getting error, SCSI ID field shows blank
You cannot call a method on a null-valued expression.
At C:\VM_RDM_Info.ps1:23 char:29
+ $ScsiId = &{$strControllerKey = $_.ControllerKey.ToString(); "{0 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Cannot index into a null array.
At C:\VM_RDM_Info.ps1:23 char:78
+ $ScsiId = &{$strControllerKey = $_.ControllerKey.ToString(); "{0 ...
+ ~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : NullArray
Please help.
My mistake, the last part should also say $dev instead of $_.
I corrected it above, try again
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That line should be
$row.ScsiId = &{$strControllerKey = $dev.ControllerKey.ToString(); "{0}`:{1}" -f $strControllerKey[$strControllerKey.Length - 1], $dev.Unitnumber}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks for your reply,
I am getting output as 00:00 which is not correct for that disk. (correct SCSI ID is 1:0)
Am I missing something ?
Thanks
Madhu
My mistake, the last part should also say $dev instead of $_.
I corrected it above, try again
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference