Reorganizational Update
Reorganizing of the repo for better, more streamlined access
This commit is contained in:
38
Scripts/Remove-IPPool.ps1
Normal file
38
Scripts/Remove-IPPool.ps1
Normal 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)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user