Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Edit powershell scripts to search entire volume

$
0
0

Hi guys,

I found the following script that works well, but it will only search the first level of folders. Any way t o edit this guy to search the entire C: drive? thanks!!

function delete-remotefile {
    PROCESS {
                $file = "\\$_\c$\**\*.pst"
                if (test-path $file)
                {
                echo "$_ *.pst exists"
                Remove-Item $file -force -Recurse
                echo "$_ *.pst file deleted"
                }
            }
}

Get-Content C:\Scripts\Active_Computers.txt | delete-remotefile


Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>