Enter-NBBranch
Since
v4.4.10.0
SYNOPSIS
Enters a branch context for subsequent Netbox API operations.
SYNTAX
ByName (Default)
Enter-NBBranch [-Name] <String> [-PassThru] [-ProgressAction <ActionPreference>] [<CommonParameters>]
ById
Enter-NBBranch -Id <UInt64> [-PassThru] [-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
Sets the active branch context so that all subsequent Netbox API calls will operate within the specified branch. This works like Push-Location and can be nested. Use Exit-NBBranch to leave the branch context.
The branching plugin must be installed on the Netbox server.
EXAMPLES
EXAMPLE 1
Enter-NBBranch -Name "feature/new-datacenter"
Enter the branch named "feature/new-datacenter".
EXAMPLE 2
``` Enter-NBBranch -Name "outer" Enter-NBBranch -Name "inner"
Now in "inner" context
Exit-NBBranch # Back to "outer" Exit-NBBranch # Back to main Demonstrates nested branch contexts. ```
EXAMPLE 3
$branch = Enter-NBBranch -Name "feature" -PassThru
Enter branch and capture the branch object.
PARAMETERS
-Name
The name of the branch to enter.
```yaml Type: String Parameter Sets: ByName Aliases:
Required: True Position: 1 Default value: None Accept pipeline input: False Accept wildcard characters: False ```
-Id
The ID of the branch to enter.
```yaml Type: UInt64 Parameter Sets: ById Aliases:
Required: True Position: Named Default value: 0 Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ```
-PassThru
Return the branch object after entering.
```yaml Type: SwitchParameter Parameter Sets: (All) Aliases:
Required: False Position: Named Default value: False Accept pipeline input: False Accept wildcard characters: False ```
-ProgressAction
{{ Fill ProgressAction Description }}
```yaml Type: ActionPreference Parameter Sets: (All) Aliases: proga
Required: False Position: Named Default value: None Accept pipeline input: False Accept wildcard characters: False ```
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
[PSCustomObject] If -PassThru is specified, returns the branch object.
NOTES
AddedInVersion: v4.4.10.0