function Get-LogAggregate {
    param(
        [switch]$CWS,

        [datetime]$FromDate = (Get-Date).AddDays(-7)
    )


    if($CWS) {
        5..8 | foreach {  Get-Item "\\rejk-p-web00$_\d-drive\ifsbosystem\log\cws.log*" } | where { $_.LastWriteTime -gt $FromDate }
    }
}


$logs = Get-LogAggregate -CWS