Answer the question
In order to leave comments, you need to log in
Where in the if condition, in powershell am I wrong?
Check the instance firewall rules for ip:
PS C:\Users\Administrator> Get-NetFirewallAddressFilter | where RemoteAddress -eq 10.15.0.71 | select InstanceID
InstanceID
----------
{48F93E73-0AE8-476E-ADA3-86AC90361AFF}
PS C:\Users\Administrator> Get-NetFirewallPortFilter | where RemotePort -eq 12440-12499 | select InstanceID
InstanceID
----------
{48F93E73-0AE8-476E-ADA3-86AC90361AFF}
PS C:\Users\Administrator> $IP=Get-NetFirewallAddressFilter | where RemoteAddress -eq 10.15.0.71 | select InstanceID
PS C:\Users\Administrator> $Port=Get-NetFirewallPortFilter | where RemotePort -eq 12440-12499 | select InstanceID
PS C:\Users\Administrator> $IP
InstanceID
----------
{48F93E73-0AE8-476E-ADA3-86AC90361AFF}
PS C:\Users\Administrator> $Port
InstanceID
----------
{48F93E73-0AE8-476E-ADA3-86AC90361AFF}
PS C:\Users\Administrator> if ($IP -eq $Port) {
>> Write-Host "Совпадает"
>> }
>> else{
>> Write-Host "Не совпадает"
>> }
>>
Не совпадает
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question