📌  相关文章
📜  从字符串 powershell 获取最后一行 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:28.635000             🧑  作者: Mango

代码示例1
(gc "c:\myfile.txt") | % -Begin {$test = (gc "c:\myfile.txt" | select -first 1 -last 1)} -Process {if ( $_ -eq $test[0] -or $_ -eq $test[-1] ) { $_ -replace "-" } else { $_ }} | Set-Content "c:\myfile.txt"