internal/parameters/ComputerParameter.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

$mappings = @{
    "microsoft.sqlserver.management.smo.server"            = @("NetName", "DomainInstanceName")
    "deserialized.microsoft.sqlserver.management.smo.server" = @("NetName", "DomainInstanceName")
    "microsoft.sqlserver.management.smo.linkedserver"   = @("Name")
    "deserialized.microsoft.sqlserver.management.smo.linkedserver" = @("Name")
    "microsoft.activedirectory.management.adcomputer"   = @("DNSHostName", "Name")
    "deserialized.microsoft.activedirectory.management.adcomputer" = @("DNSHostName", "Name")
    "Microsoft.DnsClient.Commands.DnsRecord_A"            = @("Name", "IPAddress")
    "Deserialized.Microsoft.DnsClient.Commands.DnsRecord_A" = @("Name", "IPAddress")
    "Microsoft.DnsClient.Commands.DnsRecord_AAAA"        = @("Name", "IPAddress")
    "Deserialized.Microsoft.DnsClient.Commands.DnsRecord_AAAA" = @("Name", "IPAddress")
}


foreach ($key in $mappings.Keys)
{
    Register-PSFParameterClassMapping -ParameterClass 'Computer' -TypeName $key -Properties $mappings[$key]
}