Fixed win_route module (#46395)

* Changed $IpAddress to $Gateway

* Tweaked win_route unit tests

Checks to see if new static route has the correct gateway

* Create win_route.yaml

* Fixed incorrect variable name
This commit is contained in:
uberjew666 2018-12-06 03:39:06 +00:00 committed by ansibot
commit b72187cd2c
3 changed files with 10 additions and 3 deletions

View file

@ -39,7 +39,7 @@ Function Add-Route {
if (!($Route)){
try {
# Find Interface Index
$InterfaceIndex = Find-NetRoute -RemoteIPAddress $IpAddress | Select -First 1 -ExpandProperty InterfaceIndex
$InterfaceIndex = Find-NetRoute -RemoteIPAddress $Gateway | Select -First 1 -ExpandProperty InterfaceIndex
# Add network route
New-NetRoute -DestinationPrefix $Destination -NextHop $Gateway -InterfaceIndex $InterfaceIndex -RouteMetric $Metric -ErrorAction Stop -WhatIf:$CheckMode|out-null