I am getting the following error when trying to apply the following regex on this Exchange command.
@(Get-ExchangeServer | Format-List AdminDisplayVersion) | % { [regex]::Match($_, "^\sVersion (\d+\.\d+(\.\d+)?)\s").Success }
The command Get-ExchangeServer | Format-List AdminDisplayVersion returns the following:
[PS] C:\Windows\system32>Get-ExchangeServer | Format-List AdminDisplayVersion
AdminDisplayVersion : Version 14.0 (Build 442.3)
AdminDisplayVersion : Version 14.0 (Build 442.3)
And when applying the regex to it I get all false:
[PS] C:\Windows\system32>@(Get-ExchangeServer | Format-List AdminDisplayVersion) | % { [regex]::Match($_, "^\sVersion (\
d+\.\d+(\.\d+)?)\s").Success }
False
False
False
False
False
False
Any pointers as of what am I doing wrong?