From e7d045471804b04916e70ae4cf06231ff41da62a Mon Sep 17 00:00:00 2001 From: Greg Brownstein Date: Thu, 24 Jun 2021 22:47:35 +0000 Subject: [PATCH] Update manifest and docs to 3.1.0 ***NO_CI*** --- VenafiPS/VenafiPS.psd1 | 4 +- docs/changelog.md | 7 +++ docs/functions/Find-TppCertificate.md | 75 +++++++++-------------- docs/functions/Find-TppIdentity.md | 8 +-- docs/functions/Invoke-VenafiRestMethod.md | 19 +++++- docs/functions/Read-TppLog.md | 12 ++-- docs/functions/Set-TppPermission.md | 2 +- 7 files changed, 67 insertions(+), 60 deletions(-) diff --git a/VenafiPS/VenafiPS.psd1 b/VenafiPS/VenafiPS.psd1 index 82930b6a..e3e7fff2 100644 --- a/VenafiPS/VenafiPS.psd1 +++ b/VenafiPS/VenafiPS.psd1 @@ -3,7 +3,7 @@ # # Generated by: Greg Brownstein # -# Generated on: 6/14/2021 +# Generated on: 6/24/2021 # @{ @@ -12,7 +12,7 @@ RootModule = 'VenafiPS.psm1' # Version number of this module. -ModuleVersion = '3.1' +ModuleVersion = '3.1.0' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/docs/changelog.md b/docs/changelog.md index bb788d49..830cada6 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,3 +1,10 @@ +## 3.1.0 +- Add `-CountOnly` to `Find-TppCertificate` to return the number of certificates found based on the filters provided, [#12](https://github.com/gdbarron/VenafiPS/issues/12) +- Move from `Invoke-RestMethod` to `Invoke-WebRequest` in `Invoke-VenafiRestMethod` so we get response headers, to be used with `-CountOnly` above. `Invoke-VenafiRestMethod` has a new parameter, `-FullResponse`, to retrieve the complete response, not just content value. +- Add `New-HttpQueryString` private function to support HEAD api calls which require a query string and not body. +- Fix `Test-TppIdentityFormat` which was failing when the identity guid was surrounded with curly braces +- Replace `-Limit` parameter and standardize on `-First` + ## 3.0.3 - Fix [#10](https://github.com/gdbarron/VenafiPS/issues/10), Get-VenafiCertificate not recognizing session. diff --git a/docs/functions/Find-TppCertificate.md b/docs/functions/Find-TppCertificate.md index bdc89643..7a1ce219 100644 --- a/docs/functions/Find-TppCertificate.md +++ b/docs/functions/Find-TppCertificate.md @@ -7,7 +7,7 @@ Find certificates based on various attributes ### NoPath (Default) ``` -Find-TppCertificate [-Limit ] [-Offset ] [-Country ] [-CommonName ] +Find-TppCertificate [-First ] [-Offset ] [-Country ] [-CommonName ] [-Issuer ] [-KeyAlgorithm ] [-KeySize ] [-KeySizeGreaterThan ] [-KeySizeLessThan ] [-Locale ] [-Organization ] [-OrganizationUnit ] [-State ] [-SanDns ] [-SanEmail ] [-SanIP ] [-SanUpn ] @@ -16,28 +16,13 @@ Find-TppCertificate [-Limit ] [-Offset ] [-Country ] [-Com [-Enabled] [-InError ] [-NetworkValidationEnabled ] [-CreatedDate ] [-CreatedAfter ] [-CreatedBefore ] [-ManagementType ] [-PendingWorkflow] [-Stage ] [-StageGreaterThan ] - [-StageLessThan ] [-ValidationEnabled] [-ValidationState ] + [-StageLessThan ] [-ValidationEnabled] [-ValidationState ] [-CountOnly] [-VenafiSession ] [] ``` -### ByObject -``` -Find-TppCertificate -InputObject [-Recursive] [-Limit ] [-Offset ] - [-Country ] [-CommonName ] [-Issuer ] [-KeyAlgorithm ] [-KeySize ] - [-KeySizeGreaterThan ] [-KeySizeLessThan ] [-Locale ] [-Organization ] - [-OrganizationUnit ] [-State ] [-SanDns ] [-SanEmail ] [-SanIP ] - [-SanUpn ] [-SanUri ] [-SerialNumber ] [-SignatureAlgorithm ] - [-Thumbprint ] [-IssueDate ] [-ExpireDate ] [-ExpireAfter ] - [-ExpireBefore ] [-Enabled] [-InError ] [-NetworkValidationEnabled ] - [-CreatedDate ] [-CreatedAfter ] [-CreatedBefore ] - [-ManagementType ] [-PendingWorkflow] [-Stage ] - [-StageGreaterThan ] [-StageLessThan ] [-ValidationEnabled] - [-ValidationState ] [-VenafiSession ] [] -``` - ### ByPath ``` -Find-TppCertificate -Path [-Recursive] [-Limit ] [-Offset ] [-Country ] +Find-TppCertificate -Path [-Recursive] [-First ] [-Offset ] [-Country ] [-CommonName ] [-Issuer ] [-KeyAlgorithm ] [-KeySize ] [-KeySizeGreaterThan ] [-KeySizeLessThan ] [-Locale ] [-Organization ] [-OrganizationUnit ] [-State ] [-SanDns ] [-SanEmail ] [-SanIP ] @@ -47,12 +32,12 @@ Find-TppCertificate -Path [-Recursive] [-Limit ] [-Offset ] [-CreatedAfter ] [-CreatedBefore ] [-ManagementType ] [-PendingWorkflow] [-Stage ] [-StageGreaterThan ] [-StageLessThan ] [-ValidationEnabled] - [-ValidationState ] [-VenafiSession ] [] + [-ValidationState ] [-CountOnly] [-VenafiSession ] [] ``` ### ByGuid ``` -Find-TppCertificate -Guid [-Recursive] [-Limit ] [-Offset ] [-Country ] +Find-TppCertificate -Guid [-Recursive] [-First ] [-Offset ] [-Country ] [-CommonName ] [-Issuer ] [-KeyAlgorithm ] [-KeySize ] [-KeySizeGreaterThan ] [-KeySizeLessThan ] [-Locale ] [-Organization ] [-OrganizationUnit ] [-State ] [-SanDns ] [-SanEmail ] [-SanIP ] @@ -62,7 +47,7 @@ Find-TppCertificate -Guid [-Recursive] [-Limit ] [-Offset ] [-CreatedDate ] [-CreatedAfter ] [-CreatedBefore ] [-ManagementType ] [-PendingWorkflow] [-Stage ] [-StageGreaterThan ] [-StageLessThan ] [-ValidationEnabled] - [-ValidationState ] [-VenafiSession ] [] + [-ValidationState ] [-CountOnly] [-VenafiSession ] [] ``` ## DESCRIPTION @@ -79,14 +64,14 @@ Find all certificates expiring before a certain date ### EXAMPLE 2 ``` -Find-TppCertificate -ExpireBefore "2018-01-01" -Limit 5 +Find-TppCertificate -ExpireBefore "2018-01-01" -First 5 ``` Find 5 certificates expiring before a certain date ### EXAMPLE 3 ``` -Find-TppCertificate -ExpireBefore "2018-01-01" -Limit 5 -Offset 2 +Find-TppCertificate -ExpireBefore "2018-01-01" -First 5 -Offset 2 ``` Find 5 certificates expiring before a certain date, starting at the 3rd certificate found. @@ -114,7 +99,7 @@ Find all certificates in a specific path and all subfolders ### EXAMPLE 7 ``` -Find-TppCertificate -ExpireBefore "2018-01-01" -Limit 5 | Get-TppCertificateDetail +Find-TppCertificate -ExpireBefore "2018-01-01" -First 5 | Get-TppCertificateDetail ``` Get detailed certificate info on the first 5 certificates expiring before a certain date @@ -128,21 +113,6 @@ Renew all certificates expiring before a certain date ## PARAMETERS -### -InputObject -TppObject of type 'Policy' which represents a starting path - -```yaml -Type: TppObject -Parameter Sets: ByObject -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - ### -Path Starting path to search from @@ -154,7 +124,7 @@ Aliases: DN Required: True Position: Named Default value: None -Accept pipeline input: True (ByValue) +Accept pipeline input: True (ByPropertyName, ByValue) Accept wildcard characters: False ``` @@ -178,7 +148,7 @@ Search recursively starting from the search path. ```yaml Type: SwitchParameter -Parameter Sets: ByObject, ByPath, ByGuid +Parameter Sets: ByPath, ByGuid Aliases: Required: False @@ -188,7 +158,7 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Limit +### -First Limit how many items are returned. Default is 0 for no limit. It is definitely recommended to filter on another property when searching with no limit. @@ -196,7 +166,7 @@ It is definitely recommended to filter on another property when searching with n ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Limit Required: False Position: Named @@ -766,6 +736,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -CountOnly +Return the count of certificates found from the query as opposed to the certificates themselves + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -VenafiSession Session object created from New-VenafiSession method. The value defaults to the script session object $VenafiSession. @@ -787,10 +772,10 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## INPUTS -### InputObject, Path, Guid +### Path, Guid ## OUTPUTS -### TppObject +### TppObject, Int when CountOnly provided ## NOTES ## RELATED LINKS diff --git a/docs/functions/Find-TppIdentity.md b/docs/functions/Find-TppIdentity.md index 25bb017c..ca6f6e3a 100644 --- a/docs/functions/Find-TppIdentity.md +++ b/docs/functions/Find-TppIdentity.md @@ -7,7 +7,7 @@ Search for identity details ### Find (Default) ``` -Find-TppIdentity -Name [-Limit ] [-IncludeUsers] [-IncludeSecurityGroups] +Find-TppIdentity -Name [-First ] [-IncludeUsers] [-IncludeSecurityGroups] [-IncludeDistributionGroups] [-VenafiSession ] [] ``` @@ -53,13 +53,13 @@ Accept pipeline input: True (ByValue) Accept wildcard characters: False ``` -### -Limit -Limit how many items are returned, the default is 500, but is limited by the provider. +### -First +First how many items are returned, the default is 500, but is limited by the provider. ```yaml Type: Int32 Parameter Sets: Find -Aliases: +Aliases: Limit Required: False Position: Named diff --git a/docs/functions/Invoke-VenafiRestMethod.md b/docs/functions/Invoke-VenafiRestMethod.md index 662b5873..a9a42545 100644 --- a/docs/functions/Invoke-VenafiRestMethod.md +++ b/docs/functions/Invoke-VenafiRestMethod.md @@ -8,13 +8,13 @@ Generic REST API call ### Session (Default) ``` Invoke-VenafiRestMethod -VenafiSession [-Method ] [-UriRoot ] -UriLeaf - [-Header ] [-Body ] [] + [-Header ] [-Body ] [-FullResponse] [] ``` ### URL ``` Invoke-VenafiRestMethod -ServerUrl [-UseDefaultCredentials] [-Method ] [-UriRoot ] - -UriLeaf [-Header ] [-Body ] [] + -UriLeaf [-Header ] [-Body ] [-FullResponse] [] ``` ## DESCRIPTION @@ -153,6 +153,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -FullResponse +{{ Fill FullResponse Description }} + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +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](http://go.microsoft.com/fwlink/?LinkID=113216). diff --git a/docs/functions/Read-TppLog.md b/docs/functions/Read-TppLog.md index 45f84735..e7646b34 100644 --- a/docs/functions/Read-TppLog.md +++ b/docs/functions/Read-TppLog.md @@ -8,21 +8,21 @@ Read entries from the TPP log ### Default (Default) ``` Read-TppLog [-Severity ] [-StartTime ] [-EndTime ] [-Text1 ] - [-Text2 ] [-Value1 ] [-Value2 ] [-Limit ] [-VenafiSession ] + [-Text2 ] [-Value1 ] [-Value2 ] [-First ] [-VenafiSession ] [] ``` ### ByObject ``` Read-TppLog -InputObject [-Severity ] [-StartTime ] - [-EndTime ] [-Text1 ] [-Text2 ] [-Value1 ] [-Value2 ] [-Limit ] + [-EndTime ] [-Text1 ] [-Text2 ] [-Value1 ] [-Value2 ] [-First ] [-VenafiSession ] [] ``` ### ByPath ``` Read-TppLog -Path [-Severity ] [-StartTime ] [-EndTime ] - [-Text1 ] [-Text2 ] [-Value1 ] [-Value2 ] [-Limit ] + [-Text1 ] [-Text2 ] [-Value1 ] [-Value2 ] [-First ] [-VenafiSession ] [] ``` @@ -33,7 +33,7 @@ Read entries from the TPP log ### EXAMPLE 1 ``` -Read-TppLog -Limit 10 +Read-TppLog -First 10 ``` Get the most recent 10 log items @@ -183,14 +183,14 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Limit +### -First Specify the number of items to retrieve, starting with most recent. The default is 100 and there is no maximum. ```yaml Type: Int32 Parameter Sets: (All) -Aliases: +Aliases: Limit Required: False Position: Named diff --git a/docs/functions/Set-TppPermission.md b/docs/functions/Set-TppPermission.md index a81188e6..6a3e25e5 100644 --- a/docs/functions/Set-TppPermission.md +++ b/docs/functions/Set-TppPermission.md @@ -38,7 +38,7 @@ Permission a user/group on an object specified by path ### EXAMPLE 3 ``` -$id = Find-TppIdentity -Name 'brownstein' | Select-Object -ExpandProperty IdentityId +$id = Find-TppIdentity -Name 'brownstein' | Select-Object -ExpandProperty Id ``` Find-TppObject -Path '\VED' -Recursive | Get-TppPermission -IdentityId $id | Set-TppPermission -Permission $TppPermObject -Force