Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $filePath = "D:\dwg";
- $dwg = @(Get-ChildItem -Recurse -Path $filePath | Where-Object { $_.Extension -eq ".dwg" });
- if ($dwg.length -eq 0) {
- write-host "no files found" -foregroundcolor "Red";
- }
- else {
- foreach ($file in $dwg) {
- $name = $file.name;
- $directory = $file.DirectoryName;
- write-host "$directory\$name" -foregroundcolor "Red";
- write-output "$directory\$name" | out-file -append -filepath D:\output.txt -encoding ASCII
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement