This file contains hidden or 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
| function Get-WebFile { | |
| <# | |
| .SYNOPSIS | |
| Download a file from the internet. | |
| .DESCRIPTION | |
| Download a file from the internet. | |
| .PARAMETER Url | |
| URL of file being downloaded |
This file contains hidden or 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
| function Write-PluralString{ | |
| <# | |
| .SYNOPSIS | |
| Write string with built-in handling of plural-s for variable integer. | |
| .DESCRIPTION | |
| Write string with built-in handling of plural-s for variable integer. | |
| .EXAMPLE | |
| Write-PluralString "$($computer): " $num 'file' 'processed' |
This file contains hidden or 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
| function ConvertTo-DataTable { | |
| <# | |
| .SYNOPSIS | |
| Convert regular PowerShell objects to a DataTable object. | |
| .DESCRIPTION | |
| Convert regular PowerShell objects to a DataTable object. | |
| .EXAMPLE | |
| $myDataTable = $myObject | ConvertTo-DataTable |
This file contains hidden or 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
| function Test-Connection { | |
| [CmdletBinding(DefaultParameterSetName='Default', HelpUri='http://go.microsoft.com/fwlink/?LinkID=135266', RemotingCapability='OwnedByCommand')] | |
| param( | |
| [Parameter(ParameterSetName='Default')] | |
| [Parameter(ParameterSetName='Source')] | |
| [switch] | |
| ${AsJob}, | |
| [System.Management.AuthenticationLevel] | |
| ${Authentication}, |
This file contains hidden or 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
| # pingMonitor | |
| # http://learn-powershell.net/2013/04/19/sharing-variables-and-live-objects-between-powershell-runspaces/ | |
| # http://www.zerrouki.com/powershell-menus-host-ui-promptforchoice-defined-or-dynamic/ | |
| $ComputerName = 'HCB-MSYS02' | |
| $code = { | |
| param ( | |
| [System.String] $ComputerName, |
This file contains hidden or 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
| function New-RunspacePool{ | |
| <# | |
| .SYNOPSIS | |
| Create a new runspace pool | |
| .DESCRIPTION | |
| This function creates a new runspace pool. This is needed to be able to run code multi-threaded. | |
| .EXAMPLE | |
| $pool = New-RunspacePool | |
| Description |
This file contains hidden or 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
| function Get-VMWareResourceStatus { | |
| <# | |
| .SYNOPSIS | |
| Get resource status from VMWare vSphere | |
| .DESCRIPTION | |
| Get overall status, configuration status and any configuration issues on VMWare resources by querying vSphere. | |
| .EXAMPLE | |
| Get-VMWareResourceStatus -VIServer 'VIServer01' -ResourceType 'VirtualMachine' |
This file contains hidden or 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
| function Get-VMWareSnapshot { | |
| [CmdletBinding()] | |
| param ( | |
| # vSphere server(s) to connect to | |
| [Parameter()] | |
| [string[]] $VIServer, | |
| # Filter snapshots on VM Name | |
| [Parameter()] | |
| [string[]] $VMName |
This file contains hidden or 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
| function New-DataTable { | |
| <# | |
| .SYNOPSIS | |
| Create a new DataTable. | |
| .DESCRIPTION | |
| Create a new DataTable. | |
| .EXAMPLE | |
| ` | |
| $myColumns = [ordered] @{ | |
| ID = [int32] |
This file contains hidden or 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
| function Compare-DataTable { | |
| <# | |
| .SYNOPSIS | |
| Compare two DataTables. | |
| .DESCRIPTION | |
| Compare two DataTables. | |
| .EXAMPLE | |
| Compare-DataTable -ReferenceTabel $table1 -DifferenceTable $table2 -CompareMode 'Full' | |
| Performes a full compare of $table1 and $table2 | |
| .NOTES |