Hi Vamsi,
It looks like you are trying to remove a bunch of detached LUNs from your cluster.
obviously, I don't want to do this in my live environment but, you may be able to modify the below to do what you want
$cluster = (read-host "Enter the Cluster name")
foreach ($h in (get-cluster $cluster | get-vmhost)) {
$esxcli = get-esxcli -vmhost $h
$esxcli.storage.core.device.detached.list()
$esxcli.storage.core.device.detached.remove()
}
careful using this for obvious reasons.
If you'd prefer to test from shell, try
$h = YourHostNameHere
$esxcli = get-esxcli -vmhost $h
$esxcli.storage.core.device.detached.list()
$esxcli.storage.core.device.detached.remove()
To see what methods / properties are available to you, use
$esxcli | gm