-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
InterfaceMetric: Configure a static metric for an IPv4 Interface (#472)
* Added InterfaceMetric * Create 4-NetIPInterface_SetInterfaceMetric.ps1 * Update DSC_NetIPInterface.data.psd1 * Fixed filenames and changed configuration name for Appveyor tests * Update CHANGELOG.md * Update README.MD * Merge branch 'master' of https://github.com/cohdjn/NetworkingDsc * Update README.MD * Update README.MD * Update README.MD
- Loading branch information
Showing
9 changed files
with
92 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
# Description | ||
|
||
This resource is used to configure the IP interface settings for a network interface. | ||
|
||
## Known Issues | ||
|
||
- If you define a value for `InterfaceMetric`, the `AutomaticMetric` | ||
setting is ignored. PowerShell ignores `AutomaticMetric` when you | ||
use both arguments with the `Set-NetIPInterface` cmdlet. |
46 changes: 46 additions & 0 deletions
46
source/Examples/Resources/NetIPInterface/5-NetIPInterface_SetInterfaceMetric.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<#PSScriptInfo | ||
.VERSION 1.0.0 | ||
.GUID c67b7df4-bafa-4bca-bb43-349b44df3530 | ||
.AUTHOR DSC Community | ||
.COMPANYNAME DSC Community | ||
.COPYRIGHT Copyright the DSC Community contributors. All rights reserved. | ||
.TAGS DSCConfiguration | ||
.LICENSEURI https://github.com/dsccommunity/NetworkingDsc/blob/master/LICENSE | ||
.PROJECTURI https://github.com/dsccommunity/NetworkingDsc | ||
.ICONURI | ||
.EXTERNALMODULEDEPENDENCIES | ||
.REQUIREDSCRIPTS | ||
.EXTERNALSCRIPTDEPENDENCIES | ||
.RELEASENOTES First version. | ||
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core | ||
#> | ||
|
||
#Requires -module NetworkingDsc | ||
|
||
<# | ||
.DESCRIPTION | ||
Set a specified interface metrics for the network adapters with alias 'Ethernet' and 'Ethernet 2'. | ||
#> | ||
Configuration NetIPInterface_SetInterfaceMetric | ||
{ | ||
Import-DscResource -Module NetworkingDsc | ||
|
||
Node localhost | ||
{ | ||
NetIPInterface EthernetMetric | ||
{ | ||
InterfaceAlias = 'Ethernet' | ||
AddressFamily = 'IPv4' | ||
AutomaticMetric = 'Disabled' | ||
InterfaceMetric = 10 | ||
} | ||
|
||
NetIPInterface Ethernet2Metric | ||
{ | ||
InterfaceAlias = 'Ethernet 2' | ||
AddressFamily = 'IPv4' | ||
AutomaticMetric = 'Disabled' | ||
InterfaceMetric = 20 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters