Hi,
New to PowerShell, i hope you can help.
A script i am writing is going to delete files within folders at different locations on different servers. I am counting how many files are there are at the beginning so my log im creating has the information.
$filesInLocation = Get-ChildItem $fileLocation -Recurse | Where-Object { !$_.PSIsContainer } | Measure-Object
$filesInLocation.count
So, imagine this tells me i have X amount of documents within the folders, is there a way to save that result? Because, what i would like to do is once the script completes, and the files are deleted, id like to be told again X amount of documents have been deleted.
Hope this makes sense, please, can anybody help?
KW