I have a folder called c:\application, and a banch of other folders on C: called “application-copy”,“applicationbkp”,“_application” and so on…
C: folder contains offcourse some folder that don’t related to “application”.
I would like to delete all folders with the string “application” in its foldername without deleting the actual “c:\application”
Aviram,
Welcome back to the forum. … long time no see.
What have you tried so far? Please share your code.
Please keep in mind: this forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.
We expect you to make an own attempt to get your task done or to solve your problem. If you have done so already please document here what exactly you have done and show your code. Then we probably might be able to help you step further.
Get-ChildItem -Path c:\ |
Where-Object -Property Name -NotMatch -Value '^application$'
When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.