1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

MSDNS Fix pssession; Allow alternative credentials (#1140)

* Add options for PSCredentials
* UTF-8 encoded reading
* Fix cred comparison for session based PSRemoting
* Better conditional
* Fix failing test

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
split-and-join
2021-05-02 11:25:06 -04:00
committed by GitHub
parent 88c05d9484
commit a0bbc66983
3 changed files with 28 additions and 14 deletions

View File

@ -10,7 +10,6 @@ import (
func Test_generatePSZoneAll(t *testing.T) {
type args struct {
dnsserver string
domain string
}
tests := []struct {
name string
@ -50,17 +49,17 @@ func Test_generatePSZoneDump(t *testing.T) {
{
name: "local",
args: args{domainname: "example.com"},
want: `Get-DnsServerResourceRecord -ZoneName "example.com" | ConvertTo-Json -depth 4 > mytemp.json`,
want: `Get-DnsServerResourceRecord -ZoneName "example.com" | ConvertTo-Json -depth 4`,
},
{
name: "remote",
args: args{domainname: "example.com", dnsserver: "mydnsserver"},
want: `Get-DnsServerResourceRecord -ComputerName "mydnsserver" -ZoneName "example.com" | ConvertTo-Json -depth 4 > mytemp.json`,
want: `Get-DnsServerResourceRecord -ComputerName "mydnsserver" -ZoneName "example.com" | ConvertTo-Json -depth 4`,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := generatePSZoneDump(tt.args.dnsserver, tt.args.domainname, "mytemp.json"); got != tt.want {
if got := generatePSZoneDump(tt.args.dnsserver, tt.args.domainname); got != tt.want {
t.Errorf("generatePSZoneDump() = got=(\n%s\n) want=(\n%s\n)", got, tt.want)
}
})