pspete / psPAS

PowerShell module for CyberArk Privileged Access Security REST API
https://pspas.pspete.dev
MIT License
291 stars 91 forks source link

Get-PASplatform not showing active platforms #359

Closed PhilDR007 closed 3 years ago

PhilDR007 commented 3 years ago

Describe the issue After installing version 5.1.16, the command Get-PASplatform -active $true
returns the error: CyberArk 11.1.0 does not meet the minimum version requirement of 11.4 for Get-PASPlatform (using ParameterSet: targets)

Obviously, the command defaults to the "targets" parameterset but I have found no way to force the use of the "platforms" parameterSet, except by using explicitly -platformID but it does not accept wildcards and -search is no longer available

To Reproduce N/A

Expected behavior The list of active platforms should be listed without error. It works using psPAS version 4.0.0. In other words, based on the CyberArk version it should default to "parameters" and not "targets" parameterSet or provide a switch to force the parameterset for backward compatibility.

Screenshots & Console Output N/A

Your Environment

Additional context N/A

pspete commented 3 years ago

Backward compatibility is always an aim of the module and a consideration for each update and release. All of the following will work when executed against version 11.1:

$ActivePlatforms = Get-PASPlatform -PlatformType Regular -Active $true
#or
$AllPlatforms = Get-PASPlatform -PlatformType Regular
#or
$SomePlatform = Get-PASPlatform -Search oracle
#or
$SinglePlatform = Get-PASPlatform -PlatformID oracle

The change in operation is detailed in the project's changelog here: https://github.com/pspete/psPAS/blob/master/CHANGELOG.md#4111-july-14th-2020

However, whilst validating this issue, it was noted that no output was displayed, it appears when the function was updated last year and parametersets were renamed, this was not reflected in part of the function's logic used to format the returned data. The data can still be displayed by piping into select-object:

$ActivePlatforms | Select-Object *
$AllPlatforms | Select-Object *
$SomePlatform | Select-Object *
$SinglePlatform | Select-Object *

The issue with the output will be fixed in the next module release, a related update is already present in the dev branch.