-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Convert-TppObject, Find-TppObject path tweak, other fixes (#49)
- Loading branch information
Showing
12 changed files
with
214 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
- Add `-All` option to `Get-TppAttribute` to get ALL effective attribute values for an object. This will provide the values as well as the path where the policy was applied | ||
- Add getting policies (policy attributes) with `Get-TppAttribute` | ||
- Add setting policies (policy attributes) with `Set-TppAttribute` | ||
- Add `Invoke-VenafiCertificateAction`. This is your one stop shop for certificate actions on TPP or VaaS. You can Retire, Reset, Renew, Push, Validate, or Revoke. | ||
- Cleanup output and verbose logging with `Remove-TppCertificate` | ||
- Fix parameter set issue in `New-VenafiSession`, ensure version and custom field info retrieval doesn't occur when creating a VaaS session | ||
- BREAKING CHANGE: change parameter `-NewName` to `-NewPath` in `Rename-TppObject` to allow moving an object in addition to renaming | ||
- Add `Convert-TppObject` to change the class/type of an existing object | ||
- Fix typos in examples for `Add-TppCertificateAssociation` and `Remove-TppCertificateAssociation` | ||
- Set the default for `-Path` in `Find-TppObject` to \ved\policy. Running `Find-TppObject` without a path will now recursively search from \ved\policy. | ||
- Add additional pipeline options to `Get-TppAttribute` | ||
- Add help and examples to `Invoke-VenafiRestMethod`, [#48](https://github.com/gdbarron/VenafiPS/issues/48) | ||
- Set VenafiSession default value in `Invoke-VenafiRestMethod`, [#47](https://github.com/gdbarron/VenafiPS/issues/47) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<# | ||
.SYNOPSIS | ||
Change the class/object type of an existing object | ||
.DESCRIPTION | ||
Change the class/object type of an existing object | ||
.PARAMETER Path | ||
Path to the object | ||
.PARAMETER Class | ||
New class/type | ||
.PARAMETER VenafiSession | ||
Session object created from New-VenafiSession method. The value defaults to the script session object $VenafiSession. | ||
.INPUTS | ||
Path | ||
.OUTPUTS | ||
None | ||
.EXAMPLE | ||
Convert-TppObject -Path '\ved\policy\' -Class 'X509 Device Certificate' | ||
Convert an object to a different type | ||
#> | ||
function Convert-TppObject { | ||
|
||
[CmdletBinding()] | ||
|
||
param ( | ||
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] | ||
[ValidateNotNullOrEmpty()] | ||
[ValidateScript( { | ||
if ( $_ | Test-TppDnPath ) { | ||
$true | ||
} | ||
else { | ||
throw "'$_' is not a valid path" | ||
} | ||
})] | ||
[String] $Path, | ||
|
||
[Parameter(Mandatory)] | ||
[ValidateNotNullOrEmpty()] | ||
[String] $Class, | ||
|
||
[Parameter()] | ||
[VenafiSession] $VenafiSession = $script:VenafiSession | ||
) | ||
|
||
begin { | ||
|
||
$VenafiSession.Validate('tpp') | Out-Null | ||
|
||
$params = @{ | ||
VenafiSession = $VenafiSession | ||
Method = 'Post' | ||
UriLeaf = 'config/MutateObject' | ||
Body = @{ | ||
Class = $Class | ||
} | ||
} | ||
} | ||
|
||
process { | ||
|
||
$params.Body.ObjectDN = $Path | ||
|
||
$response = Invoke-TppRestMethod @params | ||
|
||
if ( $response.Result -ne [TppConfigResult]::Success ) { | ||
throw $response.Error | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.