Full Stack LAMP - MEAN Developer, Python developer. Certified Azure Developer. Freelance programmer/consultant/trainer.

PowerShell: Check if a value exists in an array

You can check if a value or string exists in an array using the Contains method from an array.

Below is a simple example:

$languages = "Java","PHP","GO",".net"
$languages.contains("PHP"); # Output: True
$languages.contains("php"); # Output: False
$languages.contains("node.js") # Output: False

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments