try Something like this:

$array1=import-csv "C:\temp\log.csv"
$array2=import-csv "C:\temp\log2.csv"

#modify founded and output not founded
$toadd=$array2 | %{
$current=$_
$founded=$array1 | where pc -eq $current.pc | %{$_.date=$current.date;$_}

    if ($founded -eq $null)
    {
      $current.city='UNKNOW' 
      $current 
    }
}

#output of $array1 modified and elements to add
$array1, $toadd
Answer from Esperento57 on Stack Overflow
🌐
SharePoint Diary
sharepointdiary.com › sharepoint diary › powershell › powershell tutorials › powershell arraylist – a beginners guide!
PowerShell ArrayList - A Beginners Guide! - SharePoint Diary
September 30, 2025 - This code will check if the ArrayList contains the element “apple” and print a message if it does. You can easily convert between ArrayList and standard PowerShell arrays:
🌐
Microsoft
devblogs.microsoft.com › dev blogs › scripting blog [archived] › powertip: does powershell array contain a value?
PowerTip: Does PowerShell Array Contain a Value? - Scripting Blog [archived]
June 8, 2014 - Summary: Learn how to verify if a Windows PowerShell array contains a value. I have an array that contains various numbers and I want to see if one of the array elements contains a specific number. Is there an easy way to use Windows PowerShell so I don’t have to […]
🌐
Varonis
varonis.com › blog › powershell-array
PowerShell Array Guide: How to Use and Create
June 9, 2022 - Arrays in PowerShell can contain one or more items. An item can be a string, an integer, an object, or even another array, and one array can contain any combination of these items.
🌐
LazyAdmin
lazyadmin.nl › home › powershell array contains explained
PowerShell Array Contains Explained — LazyAdmin
October 16, 2024 - To check if a value exists in an array, we can use the -Contains operator in PowerShell. This will return return true if the value exists.
🌐
SPGuides
spguides.com › powershell-arraylist
PowerShell ArrayList [Create and Use]
March 26, 2025 - Let’s remove “Florida” from ... and “Texas”. To check if an element exists in an ArrayList, you can use the Contains() method....
🌐
PowerShell Test-Path
powershellfaqs.com › array-contains-in-powershell
Array Contains in PowerShell [With Examples]
February 14, 2025 - Learn how to check if an array contains a value in PowerShell with examples. Follow simple steps to use the -contains operator and streamline your data handling.
🌐
SharePoint Diary
sharepointdiary.com › sharepoint diary › powershell › how to use powershell “contains” – a quick guide!
How to use PowerShell "Contains" - A Quick Guide! - SharePoint Diary
August 8, 2025 - The Contains method in PowerShell helps you see if a specified string or character exists within a string. The PowerShell operator -Contains lets you check if a collection of objects, such as an array, contains a specific object or value.
🌐
Powershell Commands
powershellcommands.com › powershell-array-list
Mastering PowerShell Array List: A Quick Guide
June 14, 2024 - if ($arrayList.Contains("Second Item")) { Write-Host "Item found!" } This checks if "Second Item" exists in the list and prints a message accordingly. If you need a regular array instead of an array list, PowerShell allows you to convert it seamlessly:
Find elsewhere
🌐
Adam the Automator
adamtheautomator.com › powershell-array
PowerShell Arrays, ArrayLists & Collections: Best Practices
Below you can see that you need to explicitly create an ArrayList object using the New-Object cmdlet or by casting a standard array to an ArrayList object. Notice that in this case the BaseType is an object whereas the above examples have BaseTypes of Arrays which exhibit inheritance from the Object class. Ultimately, PowerShell is providing access to the .NET type system.
Published   April 22, 2025
🌐
| How
pipe.how › new-arraylist
PowerShell Collections: ArrayList | How
January 17, 2020 - The collection on today’s topic is however not strongly typed, and therefore it can inherently contain anything. Diving a little deeper, we saw earlier that ArrayList inherits directly from System.Object while Object[] had System.Array as it’s base type.
🌐
EDUCBA
educba.com › home › data science › data science tutorials › powershell tutorial › powershell array of strings
PowerShell Array of Strings | Guide to PowerShell Array of Strings
May 19, 2023 - New-Object -TypeName ... $arrlist.Add("PowerCLI") $arrlist.Add("DevOps") ... We must use the Contains() method to check if the string array contains any specific string....
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
Computer Performance
computerperformance.co.uk › home › powershell
PowerShell Basics -Contains, -CContains & -NotContains | Code Examples
January 21, 2019 - A feature of -Contains is that usually returns “True” or “False. If you are looking for a command to return a list of values, then employ -Match or -Like. # PowerShell -Contains Operator Clear-Host $ArraySimple =@("House","Flat","Bungalow") $ArraySimple -Contains "Flat" # Result PS> True
🌐
Enterprise DNA
blog.enterprisedna.co › powershell-arraylist
Powershell ArrayList: How to Build Better Scripts – Master Data Skills + AI
PowerShell supports various operators for working with ArrayLists: Range operator (..): This enables creating an array containing a range of numbers by specifying the start and end values.
🌐
Powershellexplained
powershellexplained.com › 2018-10-15-Powershell-arrays-Everything-you-wanted-to-know
Everything you wanted to know about arrays - Powershell
October 15, 2018 - Unlike the ArrayList, there is no return value on the Add method so we don’t have to void it. ... And we can still access the elements like other arrays. ... You can have a list of any type, but when you don’t know the type of objects, you can use [List[PSObject]] to contain them.
🌐
Microsoft Learn
learn.microsoft.com › en-us › powershell › scripting › learn › deep-dives › everything-about-arrays
Everything you wanted to know about arrays - PowerShell | Microsoft Learn
July 20, 2024 - By default, an array in PowerShell is created as a [psobject[]] type. This allows it to contain any type of object or value.
🌐
Java2Blog
java2blog.com › home › powershell › powershell array › check if array contains element in powershell
Check if Array Contains Element in PowerShell [5 Ways] - Java2Blog
November 21, 2023 - In this article, we will see different ways to check if array contains element in PowerShell using -contains operator, Contains() method, Where-Object cmdlet, -in operator, indexOf() method, and LINQ.
🌐
PowerShell Forums
forums.powershell.org › powershell help
System.Collection.Arraylists containing objects - PowerShell Help - PowerShell Forums
December 31, 2011 - by Lembasts at 2013-02-13 15:14:49 Greetings, Having been persuaded to use the system.collections.arraylist class instead of boring old arrays, I had a look at the methods and was wondering how to use some of these when your arraylist contains objects. For example, how do I sort on a property ...
🌐
SS64
ss64.com › ps › syntax-arrays.html
Create and use PowerShell Arrays
A PowerShell array holds a list of data items. The data elements of a PowerShell array need not be of the same type, unless the data type is declared (strongly typed). To create an Array just separate the elements with commas. Create an array named $myArray containing elements with a mix of ...