I am still learning my way round Powershell and not using the pipeline or foreach command in circumstances I probably should be, so hoping for a little layman guidance here. I am migrating some data from an old domain to a new one and the old data I have been given is layed out in folder structure like this:
I want to delete the D:\Homes\Users\%OldUsername%\appdata directory before I move the data to its new home
before I probably would have opened excel and created a line by line .bat file looking like this
Is there a better way I do this using PowerShell using the pipeline and / or a for-eachobject loop?
Can you please give any answers as verbose as possible so I can better understand the syntax. thanks in advance