Posted By

jatubio on 02/23/15


Tagged

oop PowerShell


Versions (?)

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


 / Published in: Windows PowerShell
 

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

  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  

You need to login to post a comment.