Reorganizational Update

Reorganizing of the repo for better, more streamlined access
This commit is contained in:
Kyle Ruddy
2016-07-07 21:04:40 -04:00
parent 79581976d1
commit cb35edea02
17 changed files with 5 additions and 0 deletions

38
Scripts/Remove-IPPool.ps1 Normal file
View File

@@ -0,0 +1,38 @@
Function Remove-IPPool {
<#
.Synopsis
This function will remove IP-Pools from vCenter
.Description
This function will remove IP-Pools from vCenter based on the inputs provided
.Example
Assuming my datacenter was 'westwing' and my IPPool was 'IPPool1'
remove-ippool westwing IPPool1
.Notes
Author: Brian Graf
Role: Technical Marketing Engineer, VMware
Last Edited: 05/01/2014
#>
[cmdletbinding()]
Param (
[Parameter(ValueFromPipeline = $true, valuefrompipelinebypropertyname = $true)]
[String]$Datacenter,
[Parameter(ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)]
[String]$PoolName
)
Process {
$dc = (Get-datacenter $Datacenter)
$dcenter = New-Object VMware.Vim.ManagedObjectReference
$dcenter.type = $dc.ExtensionData.moref.type
$dcenter.Value = $dc.ExtensionData.moref.value
$IPPoolManager = Get-View -Id 'IpPoolManager'
$SelectedPool = ($IPPoolManager.QueryIpPools($dc.ID) | Where-Object { $_.Name -like $PoolName })
$IPPool = Get-View -Id 'IpPoolManager-IpPoolManager'
$IPPool.DestroyIpPool($dcenter, $SelectedPool.id, $true)
}
}