Right now I'm importing a large .CSV file into powershell and currently just putting all the data into one variable. My question is how do I make it so I split each column into a different variable?
I'm attempting to use ForEach-Object for this, but I'm still rather new at Powershell and could use some help.
Current Code
$file1 = Import-Csv -Path C:\Users\lin\Documents\EndpointScript.csv | select 'System Name', 'Product Version'| where 'Product Version' -eq '5.4.6.220'
$file2 = Import-Csv -Path C:\Users\lin\Documents\EndpointScript.csv | select 'Product Version'| where 'Product Version' -ne '5.4.6.220'
Write-Output $file1
"Up to Date: "; $file1.Count
"Out of Date: "; $file2.Count
"Todays Date: "; Get-Date -Format g
$file1 | export-csv C:\Users\lin\Documents\AgentReport.csv -NoTypeInformation
Attemping to do something like this
$objectArray = Import-Csv -Path C:\Users\tlines\Documents\EndpointScript.csv
$file1 | ForEach-Object {
Attemping to do something like this
I hope for each columns data to be in a different variable so it it's easier to do things with just one of the columns.