You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I 've been experimenting with various parameters and so fat no luck. I have a Powershell array in a script, which collects computer data such as Hostname Ipv4address,serial number and mac address
when i try to export data to Excel the ipv4 format shows as a whole number (eg 10.16.166.1 shows as 10161661)
I know this happens because of Excel default column data format set to General and the way it interprets numbers but i have no way to "pre" set the column format to Text before injecting the data to worksheet.
Same thing happens if i export to CSV and then import to Excel
So far the only solution that works is the single quote prefix method in the ip variable inside my script.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I 've been experimenting with various parameters and so fat no luck. I have a Powershell array in a script, which collects computer data such as Hostname Ipv4address,serial number and mac address
when i try to export data to Excel the ipv4 format shows as a whole number (eg 10.16.166.1 shows as 10161661)
I know this happens because of Excel default column data format set to General and the way it interprets numbers but i have no way to "pre" set the column format to Text before injecting the data to worksheet.
Same thing happens if i export to CSV and then import to Excel
So far the only solution that works is the single quote prefix method in the ip variable inside my script.
My data array looks like this
$results += [PSCustomObject]@{ IPAddress = "'$ipAddress" ComputerName = $computerName SerialNumber = $serialNumber MACAddress = $macAddress Status = "Success"Is there any other way to export ipv4 values without losing the original format?
Beta Was this translation helpful? Give feedback.
All reactions