Skip to content

Instantly share code, notes, and snippets.

@Stephanevg
Last active September 4, 2016 08:56
Show Gist options
  • Save Stephanevg/fe288e1fbcd930713080382d08dbf020 to your computer and use it in GitHub Desktop.
Save Stephanevg/fe288e1fbcd930713080382d08dbf020 to your computer and use it in GitHub Desktop.
Regroups all the necessary elements for the creation of server and client devices in active directory.
{
"Owner":"",
"Type":"",
"Description":"Web Server",
"ServiceOwner":"Marketing"
}
Class ComputerConfiguration {
[string]$Owner
[string]$Type
[string]$Description
[string]$ServiceOwner
ComputerConfiguration ([string]$ConfigFilePath){
$json = gc -Path $ConfigFilePath | convertfrom-json
if (!($json.owner)){
write-error "Could not create object without specifying parameter Owner."
}
$this.owner = $json.owner
$this.Type = $json.type
$this.ServiceOwner = $json.serviceowner
$this.Description = $json.description
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment