Q:

Deleting specific folders within folders that have changing names

So my boss needs me to create a script that deletes everything in a directory with the exception of the folders with the name "incoming" and "outgoing," while still deleting all files and directories within those folders. These two folders are also stored in random company name folders so I cant specify each one as the list will keep growing.
How can I delete all the incoming and outgoing folder contents without deleting the folder that those folders are stored in?
Here is the code I have so far: 
Get-ChildItem -Path ("C:\Users\testuser\Desktop\Test") -Exclude "Incoming","Outgoing" | foreach ($_) {
    "CLEANING :" + $_.FullName
    Remove-Item $_.FullName -Force -Recurse
    "CLEANED... :" + $_.FullName
}

Is this the right approach? is there a switch or something that I should be adding to this command to add extra options? This script will be run daily via a Windows task I'm going to setup. Maybe there's a way to specify how deep the deletion script goes?

A:

Hopefully this is what you need. This should delete files and folders that are in under the folders "Incoming" and "Outgoing."
$folders = Get-ChildItem -Path "C:\Users\mkrouse\Desktop\Test" -Recurse -Directory | Where-Object {($_.basename -contains "Incoming") -or ($_.BaseName  -contains "Outgoing")}
foreach($folder in $folders){
    $items = Get-ChildItem -Path $folder.FullName -Recurse
    foreach($file in $items) {
        Remove-Item -Path $file.FullName -Recurse -Force -WhatIf
    }
}

