I want to add a txt record to dns server, but the record more than 255 char.
This is my cmdlet:
PS C:\Users\Administrator> $txt = "v=DKIM1;k=rsa;p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy6OAXCmjYT823gq+DXRjXdsypt7iepfl4pkvLRVN8wRwoND2Fk2aVlG+CitAeJ0nqWn7JAPjoTXpFtHnOWMN7ay/atQd+DcLLHfJkpRvsYSDQ1jkI2s7CkWF6G+nwLGJcNFndOdB8oawpppyESE7+DiZae8bDicaTK8oPU0J7iogeZ1fgvmutwNtNzZHiSgwF9euCiX6lTmGe+0oZ+gRUJnUmZevh//IZ+NyDkRV2kPxQBtM8brHUpRL1c11q/CA0kC6C3ku+Pqmf6A8CGT+qvlCeQ2lVqlBydQL5UjiixUEwkSrgUEKoKE2Hqw97WrDEJZqngtuqma9hWoAsKVbzwIDAQAB"
PS C:\Users\Administrator> $txt_part1 = $txt.Substring(0,252)
PS C:\Users\Administrator> $txt_part2 = $txt.Substring(252,$txt.Length - 252)
PS C:\Users\Administrator> Add-DnsServerResourceRecord -DescriptiveText "$txt_part1","$txt_part2" -Name test -Txt -ZoneName test.local
Add-DnsServerResourceRecord : Cannot process argument transformation on parameter 'DescriptiveText'. Cannot convert
value to type System.String.
At line:1 char:46
- ... rverResourceRecord -DescriptiveText "$txt_part1","$txt_part2" -Name t ...
- ~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidData: (:) [Add-DnsServerResourceRecord], ParameterBindingArgumentTransformationEx
ception
- FullyQualifiedErrorId : ParameterArgumentTransformationError,Add-DnsServerResourceRecord
What should I do?