Creating a service using Powershell in C#

Currently I am modifying the C#/Powershell-project for NAV-Services from the MS Dynamics NAV Team Blog.

While adding some more functionality I realized that it is not quite easy to create new services on a remote computer using powershell.
After some days of searching and testing I succeded using this small piece of code. (It is based on the linked project)

private void btn_CreateService_Click(object sender, EventArgs e)
    string StartType = "Manual";
    string DefinitionScript = "$service = [wmiclass]('\\" + ComputerName + @"\ROOT\CIMV2:Win32_Service')";
    string Script = "$service.Create("+txtName.Text+","+txtDisplay.Text+","+txt_ApplicationPath.Text+",16,0,"+StartType+",'false')";

    using (Runspace runSpace = RunspaceFactory.CreateRunspace())
        Pipeline pipeLine = runSpace.CreatePipeline();

See this MSDN-article for definition of parameters and other StartTypes.