Create Functions In Powershell Foreach