Can anyone help me to write PowerShell scripts that do the following:
- Report and alert on site and subsite size
- Report and alert on individual file size
- Collect search statistics
I take it you got a good reason for doing this in PowerShell -realize that you will only get a warning/report each time you run this script unless you in the script generate event log entries or similar for other monitoring devices.
Also consider using the OOB functionality for Quota and Quota warnings where you get notifications when site collections are getting near quotas.
If you use SharePoint 2010 consider using the Health Monitoring features. Besides the OOB rules and health checks you can define your own rules. You can get output as logs or reports.
Check out the Monitoring section of SharePoint 2010 on TechNet for an overview on what you can monitor.