We’d need to see the contents of Kaz_Inventory.csv to really be able to tell you why computername comes up blank. It stands to reason the CSV column header is a different name or formatting.
As far as the comma, you absolutely want that comma. If it’s not there, that column for that row (where the property is empty) would be populated by the value from the subsequent column. Each column thereafter would also be skewed for those rows. If you have an 8 column CSV and only the 3rd has a value, it should be ,value, so that it can be imported/consumed properly.
Take a look at calculated properties. Select-Object is created a new object, so you are getting the CSV creating a new object and then again creating a new object with the [pscustomobject] accelerator:
As @Doug eluded, we can’t assist you without getting a sample of what is being imported. Does the CSV have a header named Computername? Is it possibly Computer_Name, PCName or something else?
That is quite strange. My guess is it has something to do with language/culture/etc. I also got blank computername property until i copied the column header from the kas_inventory file and pasted it on top of the existing $.computername - then it worked. Here is what I used. Also, you have win10 under the processor column, nothing in the RAM column, and I have no idea what notes = $.Processor += @(‘,’,$_.RAM ) is supposed to accomplish.
I forgot to put some data in the RAM column, there was information about the RAM capacity (8GB and 16GB).
To the column of Notes, I need to list the processor and RAM through the comma, but sometimes this information is missing and therefore only a comma is put, I would like if there is no information about the RAM there would be no comma either
If that column has a header (which it should) you’d call it just like the rest. $_.thatfield and if it has data it will output, and if it doesn’t it wouldn’t output anything. Can you confirm by copying the computername header from the kas_inventory to this command, it now populates the computername data? (there is one row without a computername)