我正在学习PowerShell并希望匹配变量中的字符串。考虑这个例子:Select-String返回多行
$string = ipconfig
Select-String -InputObject $string -Pattern '127.0.0.1'
返回整个字符串。不只是'127.0.0.1'.
所以我试过:
Select-String -InputObject $string -SimpleMatch '127.0.0.1' -AllMatches
这也返回整个字符串。我究竟做错了什么?我只想看看比赛,而不是其他线路。
'$ string |选择字符串'127.0.0.1''的帮助? – arco444