I do, but that's during the re-add of the LUNs. The PowerShell commands I gave are part of a larger process:
1.) Check the backup and unmount filesystems, 2.) Delete disks from the VM and remove the LUNs from ESX host, 3.) Snap the production LUNs, 4.) present the snaps to ESX host, 5.) re-scan the storage and present the disks to the VM.
Deleting the disks from the VM works just fine. (Remove-HardDisk -DeletePermanently -Confirm:$false $rmdisk04) And the command: "$storSys.DetachScsiLun($lunUuid)" does successfully change the LUN state to "off."
If, at this point, I un-present the LUNs from the array-side, vSphere sends an alert.
So I added the command: "$esxcli.storage.core.device.detached.remove.Invoke($detach)" Instead of removing the LUN, it changes the state back to "on". I can see this status with: "$esxcli.storage.core.device.list.invoke() |select device,status"
My only other thought is maybe there's an esxcli command to remove the vmdk.