Powershell Select String Count Function In C