diff --git a/README.md b/README.md index f163caaa..5a16e2e2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
- +
# VenafiPS - Automate your Venafi TLS Protect Datacenter and Cloud platforms! @@ -10,7 +10,7 @@ [![PowerShell Gallery Version](https://img.shields.io/powershellgallery/v/VenafiPS?style=plastic)](https://www.powershellgallery.com/packages/VenafiPS) ![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/VenafiPS?style=plastic) -Welcome to VenafiPS. Here you will find a PowerShell module to automate Venafi TLS Protect Datacenter (TLSPDC), formerly known as Trust Protection Platform, and TLS Protect Cloud (TLSPC). Please let us know how you are using this module and what we can do to make it better! Ask questions or feel free to [submit an issue/enhancement](https://github.com/Venafi/VenafiPS/issues). +Welcome to VenafiPS (where the PS stands for PowerShell, not Professional Services :smiley:). Here you will find a PowerShell module to automate Venafi TLS Protect Datacenter (TLSPDC), formerly known as Trust Protection Platform, and TLS Protect Cloud (TLSPC). Please let us know how you are using this module and what we can do to make it better! Ask questions or feel free to [submit an issue/enhancement](https://github.com/Venafi/VenafiPS/issues). ## Documentation diff --git a/RELEASE.md b/RELEASE.md index 3fe8482f..d7039ec6 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,7 +1,3 @@ -- Merge all functions into 1 psm1 module. This yields much better performance, especially when running multithreaded. -- Add multithreading support on PS v5 with the Microsoft.PowerShell.ThreadJob module (installed separately). If the module isn't installed, multithreading will be disabled. Set `-ThrottleLimit` to 1 on the functions that support it to disable multithreading on PS v5 and v7. -- Module now available in the GitHub release. This is helpful for those without access to PowerShell Gallery, although that is the preferred option. -- PSSodium, needed for several TLSPC functions for encryption, is no longer directly included in the module. Install it from the Gallery. -- The VenafiSession class has been deprecated and replaced with a PSCustomObject equivalent -- Key based authentication on TLSPDC has been deprecated -- Default `Invoke-VdcCertificateAction -Push` to push to all applications and added an example to override and push to specific applications \ No newline at end of file +- Fix Find-VdcObject documentation page not building, [#302](https://github.com/Venafi/VenafiPS/issues/302) +- Rebranding post CyberArk acquisition +- Add specific exception types when working with invalid paths or access issues on VDC objects \ No newline at end of file diff --git a/Tests/ModuleExports.Tests.ps1 b/Tests/ModuleExports.Tests.ps1 index 17cd5953..b6a4bf24 100644 --- a/Tests/ModuleExports.Tests.ps1 +++ b/Tests/ModuleExports.Tests.ps1 @@ -4,8 +4,7 @@ BeforeAll { } Describe 'ExportedFunctions' { BeforeAll { - $ps1FileNames = Get-ChildItem -Path "$($moduleInfo | Where-Object{$_.name -eq 'venafips'} | Select-Object -exp modulebase)\Public\*.ps1" -Exclude *tests.ps1, *profile.ps1 | - Select-Object -ExpandProperty BaseName + $ps1FileNames = Get-ChildItem -Path "$($moduleInfo | Where-Object{$_.name -eq 'venafips'} | Select-Object -exp modulebase)\Public\*.ps1" -Exclude *tests.ps1, *profile.ps1 | Select-Object -ExpandProperty BaseName $exportedFunctions = Get-Command -Module $moduleInfo.Name -CommandType Function | Select-Object -ExpandProperty Name } diff --git a/VenafiPS/Public/ConvertTo-VdcGuid.ps1 b/VenafiPS/Public/ConvertTo-VdcGuid.ps1 index c18d1dc1..a9160dc1 100644 --- a/VenafiPS/Public/ConvertTo-VdcGuid.ps1 +++ b/VenafiPS/Public/ConvertTo-VdcGuid.ps1 @@ -36,7 +36,8 @@ function ConvertTo-VdcGuid { [ValidateScript( { if ( $_ | Test-TppDnPath ) { $true - } else { + } + else { throw "'$_' is not a valid DN path" } })] @@ -54,9 +55,9 @@ function ConvertTo-VdcGuid { Test-VenafiSession -VenafiSession $VenafiSession -Platform 'VDC' $params = @{ - Method = 'Post' - UriLeaf = 'config/DnToGuid' - Body = @{ + Method = 'Post' + UriLeaf = 'config/DnToGuid' + Body = @{ ObjectDN = '' } } @@ -68,17 +69,31 @@ function ConvertTo-VdcGuid { $response = Invoke-VenafiRestMethod @params - if ( $response.Result -eq 1 ) { - if ( $IncludeType ) { - [PSCustomObject] @{ - Guid = [Guid] $response.Guid - TypeName = $response.ClassName + switch ($response.Result) { + 1 { + # success + if ( $IncludeType ) { + [PSCustomObject] @{ + Guid = [Guid] $response.Guid + TypeName = $response.ClassName + } + } + else { + [Guid] $response.Guid } - } else { - [Guid] $response.Guid } - } else { - throw $response.Error + + 7 { + throw [System.UnauthorizedAccessException]::new($response.Error) + } + + 400 { + throw [System.Management.Automation.ItemNotFoundException]::new($response.Error) + } + + Default { + throw $response.Error + } } } } \ No newline at end of file diff --git a/VenafiPS/Public/Find-VdcObject.ps1 b/VenafiPS/Public/Find-VdcObject.ps1 index c32ecee8..d22da243 100644 --- a/VenafiPS/Public/Find-VdcObject.ps1 +++ b/VenafiPS/Public/Find-VdcObject.ps1 @@ -17,7 +17,7 @@ function Find-VdcObject { If the Attribute parameter is provided, this will filter against an object's attribute/custom field values instead of the path. Follow the below rules: - - To list DNs that include an asterisk (*) or question mark (?), prepend two backslashes (\\). For example, \\*.MyCompany.net treats the asterisk as a literal character and returns only certificates with DNs that match *.MyCompany.net. + - To list DNs that include an asterisk or question mark, prepend the character with two backslashes. - To list DNs with a wildcard character, append a question mark (?). For example, "test_?.mycompany.net" counts test_1.MyCompany.net and test_2.MyCompany.net but not test12.MyCompany.net. - To list DNs with similar names, prepend an asterisk. For example, *est.MyCompany.net, counts Test.MyCompany.net and West.MyCompany.net. You can also use both literals and wildcards in a pattern. diff --git a/VenafiPS/VenafiPS.psd1 b/VenafiPS/VenafiPS.psd1 index 59a3d7e9..87e1a9ee 100644 --- a/VenafiPS/VenafiPS.psd1 +++ b/VenafiPS/VenafiPS.psd1 @@ -69,7 +69,7 @@ PowerShellVersion = '5.1' # NestedModules = @() # Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. -FunctionsToExport = '*' +FunctionsToExport = @('Add-VcCertificateAssociation','Add-VcTeamMember','Add-VcTeamOwner','Add-VdcAdaptableHash','Add-VdcCertificateAssociation','Add-VdcEngineFolder','Add-VdcTeamMember','Add-VdcTeamOwner','Convert-VdcObject','ConvertTo-VdcGuid','ConvertTo-VdcPath','Export-VcCertificate','Export-VdcCertificate','Export-VdcVaultObject','Find-VcCertificate','Find-VcCertificateInstance','Find-VcCertificateRequest','Find-VcLog','Find-VcMachine','Find-VcMachineIdentity','Find-VdcCertificate','Find-VdcClient','Find-VdcEngine','Find-VdcIdentity','Find-VdcObject','Find-VdcVaultId','Get-VcApplication','Get-VcCertificate','Get-VcConnector','Get-VcIssuingTemplate','Get-VcMachine','Get-VcMachineIdentity','Get-VcSatellite','Get-VcTag','Get-VcTeam','Get-VcUser','Get-VcWebhook','Get-VdcAttribute','Get-VdcCertificate','Get-VdcClassAttribute','Get-VdcCredential','Get-VdcCustomField','Get-VdcEngineFolder','Get-VdcIdentity','Get-VdcIdentityAttribute','Get-VdcObject','Get-VdcPermission','Get-VdcSystemStatus','Get-VdcTeam','Get-VdcVersion','Get-VdcWorkflowTicket','Import-VcCertificate','Import-VdcCertificate','Invoke-VcCertificateAction','Invoke-VcWorkflow','Invoke-VdcCertificateAction','Invoke-VenafiRestMethod','Move-VdcObject','New-VcApplication','New-VcCertificate','New-VcConnector','New-VcMachine','New-VcMachineCommonKeystore','New-VcMachineIis','New-VcTeam','New-VcWebhook','New-VdcCapiApplication','New-VdcCertificate','New-VdcCustomField','New-VdcDevice','New-VdcObject','New-VdcPolicy','New-VdcTeam','New-VdcToken','New-VenafiSession','Read-VdcLog','Remove-VcApplication','Remove-VcCertificate','Remove-VcConnector','Remove-VcIssuingTemplate','Remove-VcMachine','Remove-VcMachineIdentity','Remove-VcTag','Remove-VcTeam','Remove-VcTeamMember','Remove-VcTeamOwner','Remove-VcWebhook','Remove-VdcCertificate','Remove-VdcCertificateAssociation','Remove-VdcClient','Remove-VdcEngineFolder','Remove-VdcObject','Remove-VdcPermission','Remove-VdcTeam','Remove-VdcTeamMember','Remove-VdcTeamOwner','Rename-VdcObject','Revoke-VdcGrant','Revoke-VdcToken','Search-VdcHistory','Set-VcApplication','Set-VcConnector','Set-VcTeam','Set-VdcAttribute','Set-VdcCredential','Set-VdcPermission','Set-VdcWorkflowTicketStatus','Test-VdcIdentity','Test-VdcObject','Test-VdcToken','Write-VdcLog') # Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. CmdletsToExport = @() diff --git a/docs/images/full-venafi-logo.png b/docs/images/full-venafi-logo.png new file mode 100644 index 00000000..ae8e9071 Binary files /dev/null and b/docs/images/full-venafi-logo.png differ diff --git a/docs/index.md b/docs/index.md index f163caaa..5a16e2e2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,5 +1,5 @@- +
# VenafiPS - Automate your Venafi TLS Protect Datacenter and Cloud platforms! @@ -10,7 +10,7 @@ [![PowerShell Gallery Version](https://img.shields.io/powershellgallery/v/VenafiPS?style=plastic)](https://www.powershellgallery.com/packages/VenafiPS) ![PowerShell Gallery](https://img.shields.io/powershellgallery/dt/VenafiPS?style=plastic) -Welcome to VenafiPS. Here you will find a PowerShell module to automate Venafi TLS Protect Datacenter (TLSPDC), formerly known as Trust Protection Platform, and TLS Protect Cloud (TLSPC). Please let us know how you are using this module and what we can do to make it better! Ask questions or feel free to [submit an issue/enhancement](https://github.com/Venafi/VenafiPS/issues). +Welcome to VenafiPS (where the PS stands for PowerShell, not Professional Services :smiley:). Here you will find a PowerShell module to automate Venafi TLS Protect Datacenter (TLSPDC), formerly known as Trust Protection Platform, and TLS Protect Cloud (TLSPC). Please let us know how you are using this module and what we can do to make it better! Ask questions or feel free to [submit an issue/enhancement](https://github.com/Venafi/VenafiPS/issues). ## Documentation diff --git a/images/full-venafi-logo.png b/images/full-venafi-logo.png new file mode 100644 index 00000000..ae8e9071 Binary files /dev/null and b/images/full-venafi-logo.png differ diff --git a/images/full_venafi_logo.png b/images/full_venafi_logo.png deleted file mode 100644 index ca5d0783..00000000 Binary files a/images/full_venafi_logo.png and /dev/null differ