Yes, you can use the == operator in a for loop to compare values. For example: for ($i = 1; $i -le 10; $i++) { if ($i == 5) { Write-Output "Found 5!" } } This loop will iterate through the values 1 to 10, and when it reaches 5, it will output the string "Found 5!". Here's a more complete example that demonstrates how you can use the == operator in a for loop to search for a specific value in an array: $numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 for ($i = 0; $i -lt $numbers.Length; $i++) { if ($numbers[$i] == 7) { Write-Output "Found 7 at index $i" break } } This will output the following: Found 7 at index 6 Note that you can also use the -eq operator to compare values in PowerShell. For example, you could write the above loop like this: for ($i = 0; $i -lt $numbers.Length; $i++) { if ($numbers[$i] -eq 7) { Write-Output "Found 7 at index $i" break } } Both == and -eq are used to test for equality between two values. The main difference is that == is a comparison operator, while -eq is a cmdlet. Some people prefer to use -eq because it is more consistent with the naming conventions used in PowerShell cmdlets.