You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### ChangeLog for vNugglets.Utility PowerShell module
2
+
3
+
#### Release v1.0
4
+
5
+
- created module from many of the juicy snippets/functions that we shared at [vNugglets.com](http://vNugglets.com) over the years
6
+
- updated `Copy-VNVIRole` to be a safer function overall by removing old `Invoke-Expression` methodology
7
+
- standardized parameter names across cmdlets in the module and expanded some previously truncated/cryptic parameter names (go, usability and discoverability!)
8
+
- added/updated "by name regular expression pattern" and "by liternal name string" parameters to several cmdlets
9
+
- modernized cmdlets to use capabilities of somewhat newer PowerShell releases (like ordered hashtables) and built-in property return iteration, breaking PowerShell v2.0 compatibility (it's time to upgrade, right?)
10
+
- updated `Invoke-VNEvacuateDatastore`:
11
+
- added feature that uses any/all datastores in datastore cluster (when specifying a datastore cluster for Destination parameter value) for potential destination _per object_ (this allows for a potentially different datastore for each virtual disk on a VM)
12
+
- added ability to exclude a VM/template's files from evacuation process (via parameter)
13
+
- added `-WhatIf` support
14
+
- updated cmdlet names to use standard/approved verbs where they were not already in use. Renamed functions/snippets as follows:
15
+
-`Get-VNVMByRDM` was "Get-VMWithGivenRDM"
16
+
-`Get-VNVMByVirtualPortGroup` was "Get-VMOnNetworkPortGroup"
17
+
-`Get-VNVMHostBrokenUplink` was "Get-BustedVmnic"
18
+
-`Invoke-VNEvacuateDatastore` was "Evacuate-Datastore"
19
+
- started writing the Pester tests for the cmdlets (many more to go, still)
20
+
- added proper comment-based help to all cmdlets (as described in PowerShell Help topic `about_Comment_Based_Help`)
21
+
- included "about" help topic, `about_vNugglets.Utility`
This is the PowerShell module created from the nugglets from [vNugglets.com](http://vNugglets.com). This repo is meant to be a place where the vNugglets.com code can reside, separate from the blog, for easier/central consumption and collaboration.
9
+
10
+
Some of the functionality provided by the cmdlets in this module:
11
+
- VIRole management (copying/duplicating)
12
+
- Finding VMs in inventory by attributes other than "name", like by the guest IP address, by the RDMs it may have, by the virtual portgroup to which it is connected
13
+
- Mining VMHost information, like host and peripheral firmware information, HBA WWNs, logical drive information, information about "broken" vmnics
14
+
- Establishing VM network to virtual portgroup physical uplink relationship information (which of the active uplinks is VM0 actually currently using?)
15
+
- Mining VM information, like standard and RDM disks, EVC setting
16
+
- vCenter connection information (in title of PowerShell window)
17
+
- Datastore evacuation, template evacuation from VMHosts
18
+
- Mining virtual portgroup information (cluster-locations)
19
+
20
+
<aid="quickStart"></a>
21
+
### QuickStart
22
+
Chomping at the bit to get going with using this module? Of course you are! Go like this:
23
+
- download the module, either from the latest release's .zip file on the [vNugglets.Utility Releases](https://github.com/vNugglets/vNuggletsPSMod/releases) page, or by cloning the project to some local folder with Git via:
- put the actual PowerShell module directory in some place that you like to keep your modules, say, like this, which copies the module to your personal Modules directory:
There are examples of some of the usages of the cmdlets in this PowerShell module at the module's GitHub Pages page [https://vNugglets.github.io/vNuggletsPSMod](https://vNugglets.github.io/vNuggletsPSMod/)
35
+
36
+
### Getting Help
37
+
The cmdlets in this module all have proper help, so you can learn and discover just as you would and do with any other legitimate PowerShell module:
38
+
-`Get-Command -Module <moduleName>`
39
+
-`Get-Help -Full <cmdlet-name>`
40
+
41
+
<aid="changelog"></a>
42
+
### ChangeLog
43
+
The [ChangeLog](ChangeLog.md) for this module is, of course, a log of the major changes through the module's hitory. Enjoy the story.
44
+
45
+
### Other Notes
46
+
A few notes on updates to this repo:
47
+
48
+
Dec 2016
49
+
- initial public release
50
+
51
+
Nov 2016
52
+
- started whole hog on creating PowerShell module to try to contain all of this goodness
53
+
54
+
Sep 2016
55
+
- created repository, populated with first nugglet
- use `VMware.Vim.SearchIndex` for speed for FindAllByIp (does support wildcard, though)
10
+
- support searching by guest DNS name (also using `VMware.Vim.SearchIndex`, via the `FindAllByDnsName` method)
11
+
- update function `Get-VNVMByVirtualPortGroup` to take a standard- or distributed virtual portgroup as a parameter (and, from pipeline)
12
+
- update function `Copy-VNVIRole` to take SourceVIRole as VIRole object, and to accept it from pipeline
13
+
- update function `Get-VNVMEVCInfo` to take Cluster object from pipeline
14
+
- update function `Get-VNUplinkNicForVM` to give more meaningful VDSwitch identification (currently returns something to the effect of `DvsPortset-1` for the VDSwitch name)
- function-ize the snippets on vNugglets, improving them as suitable
3
+
- improved:
4
+
-`Get-VNVMHostBrokenUplink` -- added more properties to returned object for more easily relating the given vmnic to the VMHost and vSwitch of which it is a part
## when setting value for DefaultCommandPrefix in module, need to account for that when setting value for Aliases anywhere (need to code those to point at what the functions _will_ be called when the DefaultCommandPrefix is applied)
10
+
#DefaultCommandPrefix = ""
11
+
#FormatsToProcess = "SomeModule.format.ps1xml"
12
+
ModuleToProcess="vNuggletsUtilityMod.psm1"
13
+
ModuleVersion="1.0.0"
14
+
## scripts (.ps1) that are listed in the NestedModules key are run in the module's session state, not in the caller's session state. To run a script in the caller's session state, list the script file name in the value of the ScriptsToProcess key in the manifest
Description="Module with the functions that have previously been scattered about the web by the vNugglets team (particularly, at vNugglets.com"
18
+
## specifies script (.ps1) files that run in the caller's session state when the module is imported. You can use these scripts to prepare an environment, just as you might use a login script
## using -PassThru so as to pass the generated module manifest contents to a var for later output as ASCII (instead of having a .psd1 file of default encoding, Unicode)
## have to do in separate step, as PSD1 file is "being used by another process" -- the New-ModuleManifest cmdlet, it seems
29
+
# in order to have this module usable (importable) via PowerShell v2, need to update the newly created .psd1 file, replacing the 'RootModule' keyword with 'ModuleToProcess'
if (-not ($oModuleInfo-is [System.Management.Automation.PSModuleInfo])) {Throw"Could not load module '$strNameOfModuleToTest' -- is it available in the PSModulePath? You can manually load the module and start tests again"}
8
+
} ## end if
9
+
Write-Verbose-Verbose ("Starting testing of module '{0}' (version '{1}' from '{2}')"-f$oModuleInfo.Name,$oModuleInfo.Version,$oModuleInfo.Path)
10
+
11
+
## ensure that this session is connected to at least one vCenter server (prompt to do so if not already connected)
## does the array of names of NoteProperties in the set of return objects have only the values expected for return objects? (does the comparison of the arrays return no difference objects?)
0 commit comments