Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PS E:\Documents\temp> $a.GetType()
- IsPublic IsSerial Name BaseType
- -------- -------- ---- --------
- True True Object[] System.Array
- PS E:\Documents\temp> $a | % { Set-Content -Path "$_-AA" -Value ($_*10)}
- PS E:\Documents\temp> dir
- ディレクトリ: E:\Documents\temp
- Mode LastWriteTime Length Name
- ---- ------------- ------ ----
- -a---- 2018/05/17 23:54 4 1-AA
- -a---- 2018/05/17 23:54 4 2-AA
- -a---- 2018/05/17 23:54 4 3-AA
- -a---- 2018/05/17 23:54 4 4-AA
- PS E:\Documents\temp> dir | Get-Content
- 10
- 20
- 30
- 40
- PS E:\Documents\temp> dir | % { Get-Content $_ | %{ $_ -replace "0","--AAA" } | Set-Content -Path "$_-BB" }
- PS E:\Documents\temp> dir
- ディレクトリ: E:\Documents\temp
- Mode LastWriteTime Length Name
- ---- ------------- ------ ----
- -a---- 2018/05/17 23:54 4 1-AA
- -a---- 2018/05/17 23:55 8 1-AA-BB
- -a---- 2018/05/17 23:54 4 2-AA
- -a---- 2018/05/17 23:55 8 2-AA-BB
- -a---- 2018/05/17 23:54 4 3-AA
- -a---- 2018/05/17 23:55 8 3-AA-BB
- -a---- 2018/05/17 23:54 4 4-AA
- -a---- 2018/05/17 23:55 8 4-AA-BB
- PS E:\Documents\temp> dir *BB* | Get-Content
- 1--AAA
- 2--AAA
- 3--AAA
- 4--AAA
- PS E:\Documents\temp>
- PS E:\Documents\temp> dir *BB | % { Write-Host -NoNewline $_.Name; Write-Host -NoNewline " -> "; Get-Content $_}
- 1-AA-BB -> 1--AAA
- 2-AA-BB -> 2--AAA
- 3-AA-BB -> 3--AAA
- 4-AA-BB -> 4--AAA
Add Comment
Please, Sign In to add comment