From 51548a047bbf78d9fd9bd0c6148b4d2bfd4fa002 Mon Sep 17 00:00:00 2001 From: Adam Robinson Date: Mon, 18 Nov 2024 12:43:04 -0500 Subject: [PATCH] ensure hex values have leading zeros --- powershell/create_custom_vsan_esa_hcl_json.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/powershell/create_custom_vsan_esa_hcl_json.ps1 b/powershell/create_custom_vsan_esa_hcl_json.ps1 index 94eb460..a416149 100644 --- a/powershell/create_custom_vsan_esa_hcl_json.ps1 +++ b/powershell/create_custom_vsan_esa_hcl_json.ps1 @@ -28,10 +28,10 @@ foreach ($storageDevice in $storageDevices) { $pciDevice = $pciDevices | where {$_.Id -eq $storageAdapter.Pci} # Convert from Dec to Hex - $vid = ('{0:x}' -f $pciDevice.VendorId).ToLower() - $did = ('{0:x}' -f $pciDevice.DeviceId).ToLower() - $svid = ('{0:x}' -f $pciDevice.SubVendorId).ToLower() - $ssid = ('{0:x}' -f $pciDevice.SubDeviceId).ToLower() + $vid = ('{0:x4}' -f $pciDevice.VendorId).ToLower() + $did = ('{0:x4}' -f $pciDevice.DeviceId).ToLower() + $svid = ('{0:x4}' -f $pciDevice.SubVendorId).ToLower() + $ssid = ('{0:x4}' -f $pciDevice.SubDeviceId).ToLower() $combined = "${vid}:${did}:${svid}:${ssid}" if($storageAdapter.Driver -eq "nvme_pcie" -or $storageAdapter.Driver -eq "pvscsi") {