Skip to content

Commit d07dce4

Browse files
committed
prep docs (examples, ReadMe) for wrapping up branch
1 parent e2a39af commit d07dce4

File tree

3 files changed

+27
-12
lines changed

3 files changed

+27
-12
lines changed

ReadMe.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Contents:
66
- [Getting Help](#gettingHelpSection)
77
- [ChangeLog](#changelog)
88

9-
This PowerShell module provides functionality to automate the management of VMware vSphere virtual distributed networking items for which VMware PowerCLI does not already provide support. For example, for the reporting on-, creation of-, and removal of traffic filtering and marking rules at the vDPortgroup level.
9+
This PowerShell module provides functionality to automate the management of VMware vSphere virtual distributed networking items for which VMware PowerCLI does not already provide support. For example, for the reporting on-, creation of-, and removal of traffic filtering and marking rules at the vDPortgroup level. Another capability: managing the VDUplink of which a VMHost VMNIC is a part.
1010

1111
Some of the functionality provided by the cmdlets in this module:
1212
- Get VDPortgroup traffic policy
@@ -15,12 +15,13 @@ Some of the functionality provided by the cmdlets in this module:
1515
- Create traffic policy rule qualifiers, for use in creation of new policy rules
1616
- Create new traffic rules for the ruleset for the given vDPortgroup
1717
- Remove given traffic rule(s) from a vDPortgroup
18+
- Set the VDSwitch Uplink for a VMHost physical NIC ("VMNIC") on the VDSwitch of which the VMNIC is already a part
1819

1920
<a id="quickStart"></a>
2021
### QuickStart
2122
Chomping at the bit to get going with using this module? Of course you are! Go like this:
2223
- This module available in the PowerShell Gallery! To install it on your machine or to save it for inspection, first, use one of these:
23-
- Install the module:
24+
- Install the module (maybe after you've inspected it first with the command after this):
2425

2526
`Find-Module vNugglets.VDNetworking | Install-Module`
2627
- Or, save the module first for further inspection/distribution (always a good idea):
@@ -55,12 +56,3 @@ The cmdlets in this module all have proper help, so you can learn and discover j
5556
<a id="changelog"></a>
5657
### ChangeLog
5758
The [ChangeLog](ChangeLog.md) for this module is, of course, a log of the major changes through the module's history. Enjoy the story.
58-
59-
### Other Notes
60-
A few notes on updates to this repo:
61-
62-
Jan 2018
63-
- initial public "prod" release
64-
65-
Dec 2017
66-
- initial public dev release

docs/examples.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ Get-VDSwitch -Name myVDSw0 | Get-VDPortGroup -Name myVDPG0 | Get-VNVDTrafficFilt
4141
Get-VDSwitch -Name myVDSw0 | Get-VDPortGroup -Name myVDPG0 | Get-VNVDTrafficRuleSet
4242
```
4343

44+
#### `Get-VNVSwitchByVMHostNetworkAdapter`: Get the virtual switch (standard or distributed) with which the given VMHostNetworkAdapter physical NIC is associated, if any.
45+
46+
```PowerShell
47+
## Get the vSwitch with which VMNIC2 on myVMHost0.dom.com is associated
48+
Get-VMHost myVMHost0.dom.com | Get-VMHostNetworkAdapter -Name vmnic2 | Get-VNVSwitchByVMHostNetworkAdapter
49+
```
50+
4451
#### `New-VNVDTrafficRule`: Make new Traffic Rule and add it to the given Traffic Ruleset of a vDPortgroup traffic filter policy
4552

4653
```PowerShell
@@ -100,3 +107,15 @@ Get-VDSwitch -Name myVDSw0 | Get-VDPortGroup -Name myVDPG0 | Get-VNVDTrafficFilt
100107
Get-VDSwitch -Name myVDSw0 | Get-VDPortGroup -Name myVDPG0 | Get-VNVDTrafficRuleSet | Set-VNVDTrafficRuleSet -Enabled:$false
101108
```
102109

110+
#### `Set-VNVMHostNetworkAdapterVDUplink`: Set the VDSwitch Uplink for a VMHost physical NIC ("VMNIC") on the VDSwitch of which the VMNIC is already a part
111+
112+
```PowerShell
113+
## Set the VMNIC "vminic3" from VMHost myVMHost0.dom.com to be in VDUplink "Uplinks-02" on VDS myVDSwitch0 (the vDSwitch of which VMNIC3 is a part)
114+
Get-VMHost myVMHost0.dom.com | Get-VMHostNetworkAdapter -Name vmnic3 | Set-VNVMHostNetworkAdapterVDUplink -UplinkName Uplinks-02
115+
116+
## Set the VMNICs "vminic2", "vminic3" from VMHost myVMHost0.dom.com to be in VDUplinks "Uplinks-01", "Uplinks-02" on VDS myVDSwitch0 (the vDSwitch of which VMNIC2 and VMNIC3 are a part)
117+
## Could then check out the current status like:
118+
## Get-VDSwitch myVDSwitch0 | Get-VDPort -Uplink | Where-Object {$_.ProxyHost.Name -eq "myVMHost0.dom.com"} | Select-Object key, ConnectedEntity, ProxyHost, Name | Sort-Object ProxyHost, Name
119+
Set-VNVMHostNetworkAdapterVDUplink -VMHostNetworkAdapter (Get-VMHost myVMHost0.dom.com | Get-VMHostNetworkAdapter -Name vmnic2, vmnic3) -UplinkName Uplinks-01, Uplinks-02
120+
```
121+

makeExamplesMd.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ Get-Command -Module vNugglets.VDNetworking -PipelineVariable oThisCommand | Fore
66
$oHelp_ThisCommand = Get-Help -Full -Name $oThisCommand.Name
77
## make a string with the example description(s) and example code(s) for this cmdlet
88
$strExampleCodeBlock = ($oHelp_ThisCommand.examples.example | Foreach-Object {
9-
"`n## {0}`n{1}" -f ($($_.remarks.Text | Where-Object {-not [System.String]::IsNullOrEmpty($_)}) -join "`n"), $_.code
9+
## for this example, make a single string that is like:
10+
# ## example's comment line 0 here
11+
# ## example's comment line 1 here
12+
# example's actual code here
13+
"`n{0}`n{1}" -f ($($_.remarks.Text | Where-Object {-not [System.String]::IsNullOrEmpty($_)} | Foreach-Object {$_.Split("`n")} | Foreach-Object {"## $_"}) -join "`n"), $_.code
1014
}) -join "`n"
1115
## make a string that has the cmdlet name and description followed by a code block with example(s)
1216
"#### ``{0}``: {1}`n`n``````PowerShell{2}`n```````n" -f `

0 commit comments

Comments
 (0)