Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Commit

Permalink
fix #130
Browse files Browse the repository at this point in the history
  • Loading branch information
gdbarron committed Apr 9, 2021
1 parent 4912a62 commit 9cd3cbd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions VenafiTppPS/Code/Public/New-TppDevice.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Device description
.PARAMETER CredentialPath
Path to the credential which has permissions to update the device
.PARAMETER IpAddress
IP Address of the device
.PARAMETER Hostname
Hostname or IP Address of the device
.PARAMETER PassThru
Return a TppObject representing the newly created policy.
Expand All @@ -38,7 +38,7 @@ $newPolicy = New-TppDevice -Path '\VED\Policy\MyFolder\device' -PassThru
Create device with full path to device and returning the object created
.EXAMPLE
$policyPath | New-TppDevice -DeviceName 'myDevice' -IpAddress 1.2.3.4
$policyPath | New-TppDevice -DeviceName 'myDevice' -Hostname 1.2.3.4
Pipe policy path and provide device details
.LINK
Expand Down Expand Up @@ -93,7 +93,8 @@ function New-TppDevice {
[string] $CredentialPath,

[Parameter()]
[ipaddress] $IpAddress,
[Alias('IpAddress')]
[string] $Hostname,

[Parameter()]
[switch] $PassThru,
Expand Down Expand Up @@ -122,8 +123,8 @@ function New-TppDevice {
$params.Attribute['Credential'] = $CredentialPath
}

if ( $PSBoundParameters.ContainsKey('IpAddress') ) {
$params.Attribute['Host'] = $IpAddress.ToString()
if ( $PSBoundParameters.ContainsKey('Hostname') ) {
$params.Attribute['Host'] = $Hostname
}

# if no attributes were provided, we need to pull out the attribute key
Expand Down

0 comments on commit 9cd3cbd

Please sign in to comment.