I have 3 folders and need to check each folder if there are some files in
I did something like this
$directory = "C:\Folder1","C:\Folder2","C:\Folder3"
$directoryInfo = Get-ChildItem $directory | Measure-Object
$directoryInfo.count
if($directoryInfo.Count -gt '0')
{
Write-host "Files in folders" -foregroundcolor RED
}
Else
{
Write-host "No files here" -foregroundcolor Green
}
I need to add for each command in and also need to know if there are some "files" in that folder show me that folder in RED like Write-host "Files in folder $directory"
but now I'm lost in this for each command... i know that's not so hard, but...
thanks for any help here