I have a CSV file, Devices.csv, containing IP Address, DeviceName, SerialNumber, MAC Address, UserName.
The Users column in all the rows of Devices.csv is prepopulated with a value [Unknown]
The code...
{Import-CSV Devices.csv | Where-Object {$_.IPAddress -eq '192.168.2.124'} | Select-Object -last 1 | FT IPAddress, devicveName, SerialNumber, MACAddress, User -AutoSize }
....outputs
IPAddress deviceName SNumber MACAddress User
--------- ----- ------- ---------- ----
192.168.2.124 ComputerA 1ABCDEFG 00xxYYbbCCdd [Unknown]
I want to be able to replace the [Unknown] text with a Username I have retrieved from a different source. Can I update just the User column on this line in Devices.csv using powershell and keep the rest of the CSV file intact ?
Thanks, Brian