Patching File System Trees with PowerShell(tellingmachine.com)

submitted by KlausKlaus(755) 3 years, 8 months ago

While working on a elaborate PowerShell script I needed to find a solution for the following problem: I wanted to do a string replace operation on a file system path name and have the resulting new string be reflected by the file system. For example the path name "C:\dogs\dog food\my favorites\hot dogs\Who let the dogs out.mp3" should be renamed by replacing "dog" with "cat". The resulting path name would be "C:\cats\cat food\my favorites\hot cats\Who let the cats out.mp3". Sounds easy, but how do I move the folders and files that are referred to in the path to their new locations? And even better, how can I do this recursively? This short blog post demonstrates two possible approaches.

add a comment |category: |Views: 3

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

No comments so far

information Login or create an account to comment on this story