79193804

Date: 2024-11-15 20:05:07
Score: 5.5
Natty:
Report link

This is very useful code, but I need to know how to limit the output to folders. I see there is a -Directory setting, but I'm unable to get it to work.

Below is a sample of my code. Any help would be greatly appreciated.

$FileFirst4Char=$file._Name.substring(0,4)
$FolderSearchStr=$dxfNetworkFolder + $FileFirst4Char+"*"
if (($namefromdir=(get-item "$FolderSearchStr").fullname) | select-object -First 1) {
    $dxfNetworkFolder=$namefromdir
    }
    else {
    $dxfNetworkFolder=$dxfNetworkFolder + "MISCELLANEOUS - DRAWINGS"
}
Reasons:
  • Blacklisted phrase (1): appreciated
  • Blacklisted phrase (0.5): I need
  • Blacklisted phrase (1): Any help
  • RegEx Blacklisted phrase (3): Any help would be greatly appreciated
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: JRDumont