Converting Lun Serial to Serialhex - CMODE using Powershell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I am trying to find a way to convert a LUN SerialNumber to a Serial-hex using powershell - unfortunately this is not an option off the get-nclun applet.
I want to use a CSV column containing Lun Serials as my data source and replace the data with the serial-hex. I initially tried this
However an error of this type is returned for each line - "Cannot convert value "83J6k$UbONg6" to type "System.Int32". Error: "Input string was not in a correct format."
I found this article
However when the concept to CMODE I am getting back an 82 character string as opposed to the 24 character I would expect.
I have also tried format-hex and other functions but what mechanism I use I end up with an incorrect result. Additionally I seem to be encountering is the use of '$' in the Lun Serials which confuses powershell.
Help!
Solved! See The Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use the ConvertTo-HexString function in that linked article. It works just fine with the cluster mode serial. There are several ways to get Powershell to ignore special characters in data.