Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion PowerAlto/Classes/Main/PaTag.Class.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,31 @@ class PaTag {
$Mapping.color14 = 'Black'
$Mapping.color15 = 'Gold'
$Mapping.color16 = 'Brown'
$Mapping.color17 = 'Green'
$Mapping.color17 = 'Olive'
$Mapping.color19 = 'Maroon'
$Mapping.color20 = 'Red-Orange'
$Mapping.color21 = 'Yellow-Orange'
$Mapping.color22 = 'Forest Green'
$Mapping.color23 = 'Turquoise Blue'
$Mapping.color24 = 'Azure Blue'
$Mapping.color25 = 'Cerulean Blue'
$Mapping.color26 = 'Midnight Blue'
$Mapping.color27 = 'Medium Blue'
$Mapping.color28 = 'Cobalt Blue'
$Mapping.color29 = 'Violet Blue'
$Mapping.color30 = 'Blue Violet'
$Mapping.color31 = 'Medium Violet'
$Mapping.color32 = 'Medium Rose'
$Mapping.color33 = 'Lavender'
$Mapping.color34 = 'Orchid'
$Mapping.color35 = 'Thistle'
$Mapping.color36 = 'Peach'
$Mapping.color37 = 'Salmon'
$Mapping.color38 = 'Magenta'
$Mapping.color39 = 'Red Violet'
$Mapping.color40 = 'Mahogany'
$Mapping.color41 = 'Burnt Sienna'
$Mapping.color42 = 'Chestnut'

$ReturnedName = $null
$FriendlyName = $null
Expand Down
4 changes: 4 additions & 0 deletions PowerAlto/Classes/Main/PaloAltoDevice.Class.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ class PaloAltoDevice {
$queryString.element = $Element
continue
}
'rename' {
$queryString.newname = $Element
continue
}
}

$result = $this.invokeApiQuery($queryString)
Expand Down
8 changes: 8 additions & 0 deletions PowerAlto/Public/Invoke-PaApiConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ function Invoke-PaApiConfig {
[Parameter(ParameterSetName = "set", Mandatory = $True, Position = 0)]
[switch]$Set,

# rename parameters
[Parameter(ParameterSetName = "rename", Mandatory = $True, Position = 0)]
[switch]$Rename,
[Parameter(ParameterSetName = "set", Mandatory = $True, Position = 1)]
[Parameter(ParameterSetName = "edit", Mandatory = $True, Position = 1)]
[Parameter(ParameterSetName = "rename", Mandatory = $True, Position = 1)]
[string]$Element,

# move parameters
Expand Down Expand Up @@ -51,6 +55,10 @@ function Invoke-PaApiConfig {
$Global:PaDeviceObject.invokeConfigQuery('edit', $Xpath, $Element)
continue
}
'rename' {
$Global:PaDeviceObject.invokeConfigQuery('rename', $Xpath, $Element)
continue
}
'move' {
$Global:PaDeviceObject.invokeConfigQuery('move', $Xpath, $Location)
continue
Expand Down
19 changes: 19 additions & 0 deletions PowerAlto/Public/Rename-PaTag.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
function Rename-PaTag {
[CmdletBinding()]
Param (
[Parameter(Mandatory = $True, Position = 0)]
[string]$Name,
[Parameter(Mandatory = $True, Position = 1)]
[string]$NewName
)

BEGIN {
$XPathNode = 'tag'
$Xpath = $Global:PaDeviceObject.createXPath($XPathNode, $Name)
}

PROCESS {
$Rename = Invoke-PaApiConfig -Rename -Xpath $XPath -Element $NewName
$Rename
}
}
2 changes: 1 addition & 1 deletion PowerAlto/Public/Set-PaTag.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Set-PaTag {
[string]$Name,

[Parameter(ParameterSetName = "name", Mandatory = $False, Position = 1)]
[ValidateSet('Red', 'Green', 'Blue', 'Yellow', 'Copper', 'Orange', 'Purple', 'Gray', 'Light Green', 'Cyan', 'Light Gray', 'Blue Gray', 'Lime', 'Black', 'Gold', 'Brown', 'Green')]
[ValidateSet('Red', 'Green', 'Blue', 'Yellow', 'Copper', 'Orange', 'Purple', 'Gray', 'Light Green', 'Cyan', 'Light Gray', 'Blue Gray', 'Lime', 'Black', 'Gold', 'Brown', 'Olive', 'Maroon', 'Red-Orange', 'Yellow-Orange', 'Forest Green', 'Turquoise Blue', 'Azure Blue', 'Cerulean Blue', 'Midnight Blue', 'Medium Blue', 'Cobalt Blue', 'Violet Blue', 'Blue Violet', 'Medium Violet', 'Medium Rose', 'Lavender', 'Orchid', 'Thistle', 'Peach', 'Salmon', 'Magenta', 'Red Violet', 'Mahogany', 'Burnt Sienna', 'Chestnut')]
[string]$Color,

[Parameter(ParameterSetName = "name", Mandatory = $False, Position = 2)]
Expand Down
38 changes: 38 additions & 0 deletions PowerAlto/en-US/PowerAlto-help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2225,6 +2225,44 @@
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>Invoke-PaApiConfig</maml:name>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none">
<maml:name>Rename</maml:name>
<maml:Description>
<maml:para>rename parameters</maml:para>
</maml:Description>
<dev:type>
<maml:name>SwitchParameter</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
<maml:name>Element</maml:name>
<maml:Description>
<maml:para>{{Fill Element Description}}</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
<maml:name>XPath</maml:name>
<maml:Description>
<maml:para>XPath of desired configuration.</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>Invoke-PaApiConfig</maml:name>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="0" aliases="none">
Expand Down
38 changes: 38 additions & 0 deletions PowerAlto/en-US/PowerAlto4-help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,44 @@
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>Invoke-PaApiConfig</maml:name>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="1" aliases="none">
<maml:name>Rename</maml:name>
<maml:Description>
<maml:para>rename parameters</maml:para>
</maml:Description>
<dev:type>
<maml:name>SwitchParameter</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>False</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none">
<maml:name>Element</maml:name>
<maml:Description>
<maml:para>{{Fill Element Description}}</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
<command:parameter required="true" variableLength="true" globbing="false" pipelineInput="False" position="2" aliases="none">
<maml:name>XPath</maml:name>
<maml:Description>
<maml:para>XPath of desired configuration.</maml:para>
</maml:Description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue>None</dev:defaultValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>Invoke-PaApiConfig</maml:name>
Expand Down