/ Published in: Windows PowerShell

Sample of declare a simple powershell class with a constructor
thanks to Tome Tanasovski (http://powertoe.wordpress.com)
thanks to Tome Tanasovski (http://powertoe.wordpress.com)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#Sample of declare a simple powershell class with a constructor #thanks to Tome Tanasovski (http://powertoe.wordpress.com) function ExtendedWebClient () { param( [Parameter(Mandatory=$true)] [String]$url, [Parameter(Mandatory=$false)] [string]$timeout ) $webclient = "" | Select url,timeout $webclient.url = $url $webclient.timeout = $timeout $webclient; } cls $extclient = ExtendedWebClient "www.myurl.com" 100 $extclient
Comments
