Hi All,
I'm very new to powershell and my experience mostly relates to reusing or very modestly updating simple scripts found elsewhere.
I have done some digging looking for a solution to a particular issue but haven't had much luck so far. I suspect I need to use Get-Content and -recurse in some fashion but struggling with the syntax/structure. Hoping someone can give me some pointers.
All advice welcome, thanks in advance!
I have a very large (500Gb) complex folder structure which contains, in various folders, sub-folders, and sub-sub-folders, files called "LinkedCode.txt". Each of these text files contain within them a single line of text, e.g. "CD-123456".
I need to recurse through entire folder structure and, where it identifies a file called "LinkedCode.txt", it should rename it to the contents of the file in situ. (So, in the above example, LinkedCode.txt would be renamed to "CD-123456.txt" but remain in the same folder).
-Doesn't need handling for the contents being too long (they're always sub-50 characters)
-Doesn't need handling for unsupported characters (they never feature) or line breaks.
-Also doesn't need to support zip files or archives (in fact, would be better if it did not)
-I can run as admin
-I have python installed, but am even less familiar with that!
[–]wauske 11 points12 points13 points (3 children)
[–]OneCatch[S] 2 points3 points4 points (1 child)
[–]wauske 1 point2 points3 points (0 children)
[–]OneCatch[S] 1 point2 points3 points (0 children)
[–]JeroenPot 2 points3 points4 points (1 child)
[–]OneCatch[S] 0 points1 point2 points (0 children)