Skip to content

Commit

Permalink
prep docs (examples, ReadMe) for wrapping up branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mtboren committed Jun 21, 2018
1 parent e2a39af commit d07dce4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
14 changes: 3 additions & 11 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Contents:
- [Getting Help](#gettingHelpSection)
- [ChangeLog](#changelog)

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.
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.

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

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

`Find-Module vNugglets.VDNetworking | Install-Module`
- Or, save the module first for further inspection/distribution (always a good idea):
Expand Down Expand Up @@ -55,12 +56,3 @@ The cmdlets in this module all have proper help, so you can learn and discover j
<a id="changelog"></a>
### ChangeLog
The [ChangeLog](ChangeLog.md) for this module is, of course, a log of the major changes through the module's history. Enjoy the story.

### Other Notes
A few notes on updates to this repo:

Jan 2018
- initial public "prod" release

Dec 2017
- initial public dev release
19 changes: 19 additions & 0 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ Get-VDSwitch -Name myVDSw0 | Get-VDPortGroup -Name myVDPG0 | Get-VNVDTrafficFilt
Get-VDSwitch -Name myVDSw0 | Get-VDPortGroup -Name myVDPG0 | Get-VNVDTrafficRuleSet
```

#### `Get-VNVSwitchByVMHostNetworkAdapter`: Get the virtual switch (standard or distributed) with which the given VMHostNetworkAdapter physical NIC is associated, if any.

```PowerShell
## Get the vSwitch with which VMNIC2 on myVMHost0.dom.com is associated
Get-VMHost myVMHost0.dom.com | Get-VMHostNetworkAdapter -Name vmnic2 | Get-VNVSwitchByVMHostNetworkAdapter
```

#### `New-VNVDTrafficRule`: Make new Traffic Rule and add it to the given Traffic Ruleset of a vDPortgroup traffic filter policy

```PowerShell
Expand Down Expand Up @@ -100,3 +107,15 @@ Get-VDSwitch -Name myVDSw0 | Get-VDPortGroup -Name myVDPG0 | Get-VNVDTrafficFilt
Get-VDSwitch -Name myVDSw0 | Get-VDPortGroup -Name myVDPG0 | Get-VNVDTrafficRuleSet | Set-VNVDTrafficRuleSet -Enabled:$false
```

#### `Set-VNVMHostNetworkAdapterVDUplink`: Set the VDSwitch Uplink for a VMHost physical NIC ("VMNIC") on the VDSwitch of which the VMNIC is already a part

```PowerShell
## 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)
Get-VMHost myVMHost0.dom.com | Get-VMHostNetworkAdapter -Name vmnic3 | Set-VNVMHostNetworkAdapterVDUplink -UplinkName Uplinks-02
## 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)
## Could then check out the current status like:
## Get-VDSwitch myVDSwitch0 | Get-VDPort -Uplink | Where-Object {$_.ProxyHost.Name -eq "myVMHost0.dom.com"} | Select-Object key, ConnectedEntity, ProxyHost, Name | Sort-Object ProxyHost, Name
Set-VNVMHostNetworkAdapterVDUplink -VMHostNetworkAdapter (Get-VMHost myVMHost0.dom.com | Get-VMHostNetworkAdapter -Name vmnic2, vmnic3) -UplinkName Uplinks-01, Uplinks-02
```

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

0 comments on commit d07dce4

Please sign in to comment.