ディレクトリ内のファイルを読み込んで文字列を置換したコピーを作成するスクリプト
Get-ChildItem .\ | ForEach-Object{
$target = $_
echo $target
Get-Content $target | %{$_ -ireplace "from", "to"} > .\20190926\$target
}
対象ファイル内の文字列を置換してコピーを作成する
Get-Content .\FromFile.txt | %{$_ -ireplace "from1", "to1"} | %{$_ -ireplace "from2","to2"} > .\20190926\ToFile.txt
参照
下記のサイトにファイルの文字列置換についての記述を参考にさせて頂きました。
https://qiita.com/mindwood/items/66207426904d02bd3359
以上です。