Powershell scripts for check and index