How to write powershell scripting