Created
November 20, 2018 17:52
-
-
Save nohwnd/b6cdb8901c1617824bb0e45734538f5b to your computer and use it in GitHub Desktop.
Rename file with scriptblock for newname
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "a" | Set-Content "c:\temp\abc.txt" -Force | |
| Remove-Item "c:\temp\bbc.txt" | |
| Get-Item "C:\temp\abc.txt" | | |
| Rename-Item -NewName { $_.Name -replace "a","b"} | |
| Get-Content "c:\temp\bbc.txt" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment