【发布时间】:2017-04-21 06:51:42
【问题描述】:
我只希望在 $_.Skuname 不是 Null 且不是空白的情况下应用正则表达式,这样它就不会将 Null 转换为字符串。这可能吗,如果可以,怎么做?
(Get-SQLInstance -Computername $Computer | foreach { $_.Skuname }) -replace '(\w+) .+', '$1'
【问题讨论】:
标签: regex string powershell replace null