I'm hoping to use Powershell to:
- Recurse through directories, of various depths, with the current PS script's directory being root
- Apply an app to those directories (which in turn will process the files within it)
- Which also requires an input of a new subdir to make base
The command I want to apply to each directory takes the format: c:\xrv\fileprocess.exe -folderIn [dir] -foldorOut [newdir]
I'm at a bit of a loss on how to make this happen. I've tried to hash together something from snippets online but I never seem to have success. I've kind of made a part hodgepodge snippet part pseudo code attempt to explain what I'm trying to do below.
I'd also note that the paths are looong!
Thanks all!
Clear-Host
$StartDirectory = '\.'
echo $StartDirectory
$files = Get-ChildItem -LiteralPath $StartDirectory -Recurse -Directory `|
foreach($dir in $dirs){
c:\xrv\fileprocess.exe -folderIn $dir -foldorOut "$dir\pd"
}