PowerNetbox is a powerful PowerShell module designed to work seamlessly with the Netbox REST API. Offering complete 100% coverage of all Netbox 4.x API endpoints, this module facilitates efficient management of network resources. Built on the foundation of the original NetboxPS, it ensures compatibility and extends functionality for users.
PowerNetbox is a comprehensive PowerShell module designed to interact with the Netbox REST API, providing full support for all endpoints in Netbox 4.4.8. With 100% API coverage, this module is essential for managing network infrastructure effectively.
Key Features
- Full API Support: Seamlessly integrates with all Netbox 4.x API endpoints, allowing for complete CRUD operations on resources.
- Cross-Platform Compatibility: Operable on Windows, Linux, and macOS, ensuring versatility across different environments.
- Extensive Function Library: Contains over 504 functions that facilitate all necessary actions within the Netbox framework.
- PowerShell Pipeline Integration: Supports efficient scripting and command-line workflows utilizing the power of PowerShell's pipeline.
- Security Focused: Implements token-based authentication with support for TLS 1.2/1.3, ensuring secure communication with the API.
- Well-Tested: Comes with 946 unit tests to ensure reliability and maintainability.
Supported Modules Overview
This module comprises various components, each with dedicated functionality:
| Module | Endpoints | Functions | Status |
|---|---|---|---|
| DCIM | 45 | 180 | ✅ Full |
| IPAM | 18 | 72 | ✅ Full |
| Virtualization | 5 | 20 | ✅ Full |
| Circuits | 11 | 44 | ✅ Full |
| Tenancy | 5 | 20 | ✅ Full |
| VPN | 10 | 40 | ✅ Full |
| Wireless | 3 | 12 | ✅ Full |
| Extras | 12 | 45 | ✅ Full |
| Core | 5 | 8 | ✅ Full |
| Users | 4 | 16 | ✅ Full |
| Branching* | 3 | 16 | ✅ Full |
*Branching capability requires the netbox-branching plugin for staging changes.
Quick Start Guide
Connecting to Netbox is straightforward:
# Import the module
Import-Module PowerNetbox
# Connect using API token
$credential = Get-Credential -UserName 'api' -Message 'Enter your Netbox API token'
Connect-NBAPI -Hostname 'netbox.example.com' -Credential $credential
Example Commands
Manage devices and IP addresses effortlessly:
# Retrieve all devices
Get-NBDCIMDevice
# Create a new IP address
New-NBIPAMAddress -Address '10.0.0.1/24' -Description 'Web Server'
# Update a device's description
Set-NBDCIMDevice -Id 1 -Description 'Updated description'
# Remove a device with confirmation
Remove-NBDCIMDevice -Id 1
Advanced Functionality
PowerNetbox also supports advanced operations, including branching for staging changes. For example:
# Create and enter a new branch
New-NBBranch -Name "feature/new-datacenter" -Description "Planning new DC"
Enter-NBBranch -Name "feature/new-datacenter"
New-NBDCIMSite -Name "DC-New" -Slug "dc-new"
New-NBDCIMDevice -Name "server01" -DeviceType 1 -Site 1
Exit-NBBranch
Migration from NetboxPS or NetboxPSv4
For users transitioning from earlier versions, the following command ensures a smooth update:
# Uninstall old modules
Remove-Module NetboxPS, NetboxPSv4 -Force -ErrorAction SilentlyContinue
Uninstall-Module NetboxPS, NetboxPSv4 -Force -ErrorAction SilentlyContinue
# Install PowerNetbox
Install-Module -Name PowerNetbox -Scope CurrentUser
# Import new module
Import-Module PowerNetbox
Access comprehensive documentation, examples, and troubleshooting tips on the PowerNetbox Wiki or consult the official Netbox API Documentation.
PowerNetbox represents a significant enhancement for network management professionals utilizing PowerShell, offering a stable and feature-rich environment for interacting with Netbox.
No comments yet.
Sign in to be the first to comment.