1.

Solve : Powershell Capture Result?

Answer»

PS C:\> $a = [string]"This string CONTAINS a number of letters"
PS C:\> $a -match 'a number'
True

How would I capture the resultant VALUE of "True" in a VARIABLE from match?Couple of WAYS, this might be the easiest:

Code: [Select]$a = [string]"This string contains a number of letters"
$result = $a -match 'a number'
$result





Discussion

No Comment Found