This should process each sub-folder . I've already spent alot of time on this, and would appreciate help .
The output makes no sense to me
function sc_t ([Parameter(ValueFromPipeline)]$path = "") {
process {
function sc1 ([Parameter(ValueFromPipeline)]$sub_psobject, $sub_targetPath = "") {
process {
if ($sub_psobject.PSIsContainer) {
$sub_psobject.fullname
"$sub_targetPath\$($sub_psobject.PSChildName)"
get-childItem -Force $sub_psobject | sc1 -sub_targetPath "$sub_targetPath\$($sub_psobject.PSChildName)"
}
}
}
$psobject = get-item -Force -LiteralPath $path
sc1 $psobject
}
}
sc_t "D:\temporal\1"