I found a long coded answer for specific column "Free" with groups,
clear-host
Function Get-FreeAddress
{ #Example call:
#Get-FreeAddress -Env:"Prod" -Container:"H07" -NumIPs:3 -GiveInfo:$false
PARAM(
[Parameter(Mandatory=$true,ValueFromPipeline=$true,HelpMessage="Environment info (Prod or NonProd)")]
[ValidateNotNullOrEmpty()]
[System.String]$Env,
[Parameter(Mandatory=$false,HelpMessage="Container Info (ie. H01, H02, etc,,")]
[ValidateNotNullOrEmpty()]
[System.String]$Container,
[Parameter(Mandatory=$false,HelpMessage="IP Count to return")]
[ValidateNotNullOrEmpty()]
[Int]$NumIPs,
[switch]$GiveInfo = $False
)
Begin {
If ($NumIPs -eq "" -or $NumIPs -eq $null) {$NumIPs = 1}
#Nothing Necessary to process
} #Begin
Process {
$cnt = 1
$IPOut = @()
$Check = "Env=$($Env);*$($Container)*"
$Ranges = Get-IpamRange -AddressFamily IPv4 | Where{$_.customconfiguration -like $check} | Sort Customconfiguration
:RangeLoop Foreach ($Rng in $Ranges)
{
if($GiveInfo){Write-Host "Range: "$Rng.networkid}
$ipaddinfo = Get-Ipamsubnet -networkid $Rng.networkid | get-ipamaddress | Where{$_.IPAddressState -eq 'Free'}
:IPLoop foreach ($ipinfo in $ipaddinfo)
{
If ($cnt -le $NumIPs)
{
if($GiveInfo){Write-Host "`t$($cnt):" $ipinfo.Address " : " $ipinfo.IPAddressState}
$cnt = $cnt + 1
$IPOut += $ipinfo.Address
}
Else
{Break RangeLoop}
}
}
Return $IPOut
}
}
Get-FreeAddress -Env:"Prod" -Container:"H07" -NumIPs:2 -GiveInfo:$false