Sample of declare a simple powershell class with a constructor (Another sample)


/ Published in: Windows PowerShell
Save to your folder(s)

Sample of declare a simple powershell class with a constructor
Thanks to http://www.peterhenell.se/


Copy this code and paste it in your HTML
  1. #Sample of declare a simple powershell class with a constructor
  2. #Thanks to http://www.peterhenell.se/
  3. function ExtendedWebClient ($url,$timeout)
  4. {
  5. $webclient = "" | Select url,timeout
  6. $webclient.url = $url
  7. $webclient.timeout = $timeout
  8.  
  9. $webclient;
  10. }
  11.  
  12. cls
  13. $extclient = ExtendedWebClient "www.myurl.com" 100
  14. $extclient

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.