To present the results in a readable format, you can use the Format-List cmdlet. This will provide a detailed view of the output.
$result | Format-List *
Here is an example output from the AQL query that finds items created or modified in the last day:
The full command input is as follows:
For more information, refer to the AQL documentation.
$result | Format-List *
Here is an example output from the AQL query that finds items created or modified in the last day:
results : {@{repo=tst-gems-remote-cache; path=.; name=specs.4.8.gz; type=file; size=5018252; created=2023-05-30T14:30:44.584Z; created_by=_system_; modified=2023-06-07T08:21:30.062Z; modified_by=_system_; updated=2023-06-07T08:21:30.290Z}, @{repo=tst-gems-remote-cache; path=.; name=latest_specs.4.8.gz; type=file; size=1494120; created=2023-05-30T14:30:44.630Z; created_by=_system_; modified=2023-06-07T08:21:30.318Z; modified_by=_system_; updated=2023-06-07T08:21:30.381Z},
The full command input is as follows:
$username = "<username>" $password = "<password>" $platformUrl = "http://<url>/artifactory/api/search/aql" $base64Auth = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes("${username}:${password}")) $headers = @{ "Authorization" = "Basic $base64Auth" "Content-Type" = "text/plain" } $data = @' <AQL query> '@ $result = Invoke-RestMethod -Uri $platformUrl -Method POST -Headers $headers -Body $data $result | Format-List *
For more information, refer to the AQL documentation.