Inventory tool part 3

In the second part of the Inventory tool series I showed how we set and find the information in the Active Directory with the Microsoft PowerShell Active Directory module.

In this part I will show the basics on how to build the Windows Forms GUI with PowerShell Studio.

If you want to test this you can download a trial version at Sapiens PowerShell Studio product page.

I use PowerShell Studio 2019 in my blog posts.
But you can use older versions too.

Start PowerShell Studio as administrator!

Create a New Form Project

Name the project and click Create.

And then just click Open in next dialog box.

Now we have an empty Forms project.
A PowerShell Studio Forms project contains several files.

The PowerShell Studio project file is named .psproj.
And a project contains the files Globals.ps1, MainForm.psf and Startup.pss by default.

When you open the project in PowerShell Studio you will see 3 tabs with the 3 files opened.
As below.

Globals.ps1

Here you can declare Global variables and functions.
When writing Windows Forms scripts in PowerShell it’s very important to set global variables and have lots of functions.

MainForm.psf

This tab is the main tab in a project.

And here you have 2 left tabs.

The Designer tab

It’s in the designer tab you add stuff to the form like buttons.

The script tab

When you add something in the designer tab like a button the code section will be added in the script tab like above.

This was the basic basic of PowerShell Studio.

In the next part I will start to show how to build the inventory application and how to work with the form.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.