{"id":13710804,"url":"https://github.com/benclaussen/NetboxPS","last_synced_at":"2025-05-06T19:32:40.722Z","repository":{"id":38303772,"uuid":"133978165","full_name":"benclaussen/NetboxPS","owner":"benclaussen","description":"Powershell module for Netbox","archived":false,"fork":false,"pushed_at":"2023-11-09T17:20:28.000Z","size":649,"stargazers_count":34,"open_issues_count":22,"forks_count":21,"subscribers_count":8,"default_branch":"dev","last_synced_at":"2024-11-13T21:44:37.608Z","etag":null,"topics":["api","api-wrapper","dcim","ipam","netbox","powershell","powershell-module"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benclaussen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-05-18T16:20:07.000Z","updated_at":"2024-11-03T15:38:09.000Z","dependencies_parsed_at":"2024-01-20T15:48:27.601Z","dependency_job_id":"b55c7fab-3c19-4d13-920c-02e966d4af68","html_url":"https://github.com/benclaussen/NetboxPS","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benclaussen%2FNetboxPS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benclaussen%2FNetboxPS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benclaussen%2FNetboxPS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benclaussen%2FNetboxPS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benclaussen","download_url":"https://codeload.github.com/benclaussen/NetboxPS/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252753741,"owners_count":21799003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-wrapper","dcim","ipam","netbox","powershell","powershell-module"],"created_at":"2024-08-02T23:01:01.002Z","updated_at":"2025-05-06T19:32:35.692Z","avatar_url":"https://github.com/benclaussen.png","language":"PowerShell","funding_links":[],"categories":["SDKs"],"sub_categories":[],"readme":"# NetboxPS\n###### Powershell Netbox API module\n\n# Disclaimer\nThis module is beta. Use it at your own risk. I have only added functions as I have needed them, so not everything is available.\n\nAll functions are exported at the moment, including internal/private functions.\n\n# Description\nThis module is a wrapper for the [Netbox](https://github.com/netbox-community/netbox) API.\n\n# Usage\n1. Install module from the `netboxPS` folder\n2. Import module\n3. Connect to an API endpoint by using `Connect-NetboxAPI -Hostname netbox.example.com`\n\n## Basic Commands\n\n```powershell\n#Just adding a new IP\nNew-NetboxIPAMAddress -Address 10.0.0.1/24 -Dns_name this.is.thedns.fqdn -Custom_Fields @{CustomFieldID=\"CustomFieldContent\"} -Tenant 1 -Description \"Description\"\n\n#Creating a new VM, add an interface and assign Interface IP\nfunction New-NBVirtualMachine\n{\n    [CmdletBinding()]\n    [Alias()]\n    [OutputType([int])]\n    Param\n    (\n        [string]$Name,\n        [string]$Cluster,\n        [string]$IP,\n        [string]$tenant,\n        [string]$VMNICName\n    )\n\n    Begin\n    {\n        $NBCluster = Get-NetboxVirtualizationCluster -name $Cluster\n        $NBTenant = Get-NetboxTenant -Name $tenant\n    }\n    Process\n    {\n        $vm = New-NetboxVirtualMachine -Name $Name -Cluster $NBCluster.id -Tenant $NBtenant.id\n        $interface = Add-NetboxVirtualMachineInterface -Name $VMNICName -Virtual_Machine $vm.id\n\n\n        $NBip = New-NetboxIPAMAddress -Address $IP -Tenant $NBtenant.id \n        Set-NetboxIPAMAddress -Assigned_Object_Type virtualization.vminterface -Assigned_Object_Id $interface.id -id $NBip.id\n        Set-NetboxVirtualMachine -Primary_IP4 $NBip.id -Id $vm.id\n    }\n}\n\n```\n\n# Notes\nI started this project years ago with Powershell Studio using the built in deployment methods, learning Git, and learning PS best practices. So please forgive any \"obvious\" mistakes 😅\nOver time I have had to adjust my methods for deployment... change the design of functions, and refactor code as I learn new and better things. \n\nThis was built out of a need at my job to interact with Netbox for automation. Only recently has it become a \"public\" project with other collaborators (which I truly appreciate!).\nI have done my best to ensure each function does exactly one thing according to the API. \n\nI will do my best to keep up, but please understand it is given attention as I can at work. As time permits, I will open issues for TODOs for things I have wanted to do for a while, just haven't had time or enough \"need\" to do them.\n\n# Contributing\n- Follow [Powershell Practice and Style Guidelines](https://poshcode.gitbook.io/powershell-practice-and-style/) when writing code\n- Use discussions for general questions\n- Open issues for bug fixes or enhancements\n- Submit all pull requests against the dev branch\n\nI am always open to suggestions for improvement with reasons and data to back up the suggestion.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenclaussen%2FNetboxPS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenclaussen%2FNetboxPS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenclaussen%2FNetboxPS/lists"}