mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 16:23:10 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user