Powershell how to run windows form application?

Filip 831 Reputation points
2021-06-28T19:35:03.027+00:00

Hello.

I wanna to run my windows for application with powershell is it possible?.
This is my code:

Add-Type -TypeDefinition @"
using System;
using System.Windows.Forms;

namespace Test1
{
    public partial class Form1
    {

        public Form test = new Form();

        public Padding a = new Padding();

        public void Main(){
            test.Text = "HEllo world";

            test.Padding = a;
            Console.WriteLine("Hello world!");
        }
    }
}


"@ -ReferencedAssemblies System.Windows.Forms

Thanks for help.

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. MotoX80 36,401 Reputation points
    2021-06-28T19:44:04.54+00:00
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.