Turn Powershell Script Into Function Stack And Cognitive Functions