PSPHPIPAM
PSPHPIPAM copied to clipboard
Id of Folder
Hi,
I able to create a folder with: New-PhpIpamSubnet -Params @{ description = "Test"; sectionId = 1; isFolder = 1 }
Now I´m struggling with how I can create a subnet within that folder that I´m just ceated as I´m not able to get the Id of this folder.
When I go back to the GUI and get the Id of that folder from the URL and type 'Get-PhpIPamSubnet -Id xxx' nothing is returned. When using the Id of a subnet the subnet is returned.
In addition Get-PhpIpamAllSubnets does not return any subnets/folders.
Am I´m doing anything wrong here?
Thanks Martin
try below code to get all subnets
Invoke-PhpIpamExecute -method get -controller subnets
# or
Invoke-PhpIpamExecute -method get -controller subnets -identifiers @("all")
Thanks for your quick response - it was helpful.
With these lines of code I can get the information I need and procede to create subnets in this newly created folder:
$allFolders= Invoke-PhpIpamExecute -method get -controller folders $folder = $allFolders.data | Where-Object { $_.description -like "Test" } $folderId = $folder.id