# Install for current user
Install-Module -Name PowerNetbox -Scope CurrentUser
# Or install system-wide (requires admin)
Install-Module -Name PowerNetbox -Scope AllUsersGet-Module PowerNetbox -ListAvailable# Import the module
Import-Module PowerNetbox
# Create credential (API token as password)
$credential = Get-Credential -UserName 'api' -Message 'Enter your Netbox API token'
# Connect
Connect-NBAPI -Hostname 'netbox.example.com' -Credential $credentialConnect-NBAPI -Hostname 'netbox.local' -Credential $credential -SkipCertificateCheck# Get Netbox version
Get-NBVersion
# Should return something like:
# netbox-version : 4.4.8
# python-version : 3.12.3All functions follow the pattern: [Verb]-NB[Module][Resource]
| Verb | Action | HTTP Method |
|---|---|---|
Get- |
Retrieve | GET |
New- |
Create | POST |
Set- |
Update | PATCH |
Remove- |
Delete | DELETE |
# Get all sites
Get-NBDCIMSite
# Get a specific device
Get-NBDCIMDevice -Name 'server01'
# Get devices with filter
Get-NBDCIMDevice -Status 'active' -Site 1
# Create a new IP address
New-NBIPAMAddress -Address '10.0.0.1/24' -Description 'Web Server'
# Update a device
Set-NBDCIMDevice -Id 1 -Description 'Updated via PowerNetbox'
# Delete (with confirmation)
Remove-NBDCIMDevice -Id 1# List all available functions
Get-Command -Module PowerNetbox
# Get help for a specific function
Get-Help Get-NBDCIMDevice -Full
# Show examples
Get-Help New-NBIPAMAddress -ExamplesPowerNetbox implements performance optimizations by default:
# Brief mode for minimal response (~90% smaller)
Get-NBDCIMDevice -Brief
# Select specific fields only
Get-NBDCIMDevice -Fields 'id','name','status','site.name'
# config_context is excluded by default for speed
# Include it when needed:
Get-NBDCIMDevice -IncludeConfigContextSee Performance Optimization for detailed guidance.
- Performance Optimization - Optimize your API queries
- Common Workflows - Real-world examples
- DCIM Examples - Device and site management
- IPAM Examples - IP address management