0697デフォルトの名無しさん
2018/04/02(月) 10:47:05.22ID:qOetNhN3$text = "てすと"
$file = @(Get-Content $path)
for($i = $file.count; $i -ge 0; $i--)
{
if($file[$i] -match "^\s*$")
{
continue
}
if($file[$i] -match ".*$($text).*")
{
$file[$i] = $text
} else {
$file[$i] += "`n" + $text
}
break
}
$file | Out-File $path
Powershell勉強中なんだけどこんな感じ?