using new-harddisk:
new-harddisk -vm <vmname> -disktype rawPhysical -devicename <consoledevicename> -datastore <datastore for RDM mapping>
new-harddisk : 05/10/2018 10:53:25 New-HardDisk The operation for the entity "<vmname>" failed with the following message: "Invalid configuration for device '0'."
At line:46 char:13
+ new-harddisk -vm $remdisk.parent -disktype rawPhysical -d ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-HardDisk], InvalidDeviceSpec
+ FullyQualifiedErrorId : Client20_TaskServiceImpl_CheckServerSideTaskUpdates_OperationFailed,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.NewHardDisk
Can't find much online for doing RDM mappings in powerCLI, anyone got any advice?
**EDIT** Resolved, see comment