Solved

Powershell code

Posted on 2014-03-07
6
229 Views
Last Modified: 2014-03-10
I came across these type of code on a powershell script

[void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[void][System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")

System.Windows.Forms.Form

System.Drawing.Size(1069, 809)

System.Windows.Forms.Label

what type of codes are they and where I can learn more about them?
0
Comment
Question by:Kay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39912274
I presume you come from here:
http://technet.microsoft.com/en-us/library/ff730941.aspx

this is some code to draw some application windows from script, eventually dynamically etc.
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 39912379
[void][System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")

Open in new window

is the old way of loading a .NET assembly. With PowerShell 2.0 and above you usually say
Add-Type -Assembly System.Windows.Forms

Open in new window

instead.
After loading an assembly you are able to use the classes defined in that assembly. In this particular case, as Guy stated correctly, it's code to create a Windows dialog with some labels and  buttons and the like, set the size and position etc, in short all the stuff you have to do to build a Windows Form "manually".
0
 

Author Comment

by:Kay
ID: 39912449
these codes are from the .net framework right?
0
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 250 total points
ID: 39912466
yes, exactly. the .net framework is integral part of the windows installation ...
0
 

Author Comment

by:Kay
ID: 39912501
I c, so if learn .net I can use those codes in powershell?
0
 
LVL 70

Accepted Solution

by:
Qlemo earned 250 total points
ID: 39912591
It is very similar to what you would have to do in C# or VB (?), so the answer should be "yes".
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question