Solved

Powershell code

Posted on 2014-03-07
6
228 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
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 …

739 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