vmware-archive / powernsx

PowerShell module that abstracts the VMware NSX-v API to a set of easily used PowerShell functions
173 stars 90 forks source link

Add-NsxLoadBalancerPoolMember Problem #575

Closed eaphilipp closed 5 years ago

eaphilipp commented 5 years ago

Hello,

I am trying to automate a NSX LoadBalancer Pool Member add and I am using the following commandlet:

get-nsxedge TEST-LB | Get-NsxLoadBalancer | Get-NsxLoadBalancerPool -name SYSLOG | Add-NsxLoadBalancerPoolMember -Name NODE-1-5-914 -IpAddress 9.9.9.9 -Weight 1 -MonitorPort 9001 -Port 514

Everything works except for the -Monitor Port. It is not putting 9001 it is putting 514.

What am I doing wrong?

alagoutte commented 5 years ago

Hi,

i look like a bug...

On line 31096 of PowerNSX.psm1

Add-XmlElement -xmlRoot $xmlMember -xmlElementName "monitorPort" -xmlElementText $port

should be

Add-XmlElement -xmlRoot $xmlMember -xmlElementName "monitorPort" -xmlElementText $monitorport
eaphilipp commented 5 years ago

So I altered the .PSM1 file. I found the bad line and it still doesn't work? I have never done this so I am not sure if there is something else I have to do? I reloaded the ISE and the modules were reloaded.

alagoutte commented 5 years ago

I will push a fix soon

You need to may be force reload of module

Import-Module PowerNSX -force