Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. # default constructor - has no parameters
  2.  
  3. # method 1 - new and then set properties
  4. $Configuration = [Foo.ConfigurationObject]::new()
  5. $Configuration.Domain = $DomainName
  6. $Configuration.Token = $Token
  7.  
  8. # method 2 - add properties via New-Object
  9. $Configuration = New-Object Foo.ConfigurationObject -Property @{
  10. Domain = $DomainName
  11. Token = $Token
  12. }
  13.  
  14. # method 3 - hashtable instantiation if properties are settable
  15. [Foo.ConfigurationObject]@{
  16. Domain = $DomainName
  17. Token = $Token
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement