mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07: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:
parent
a74449b05f
commit
b72187cd2c
3 changed files with 10 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue