# Content Filtering with Powershell command

**URL:** <https://forums.powershell.org/t/content-filtering-with-powershell-command/20596>\
**Category:** PowerShell Help\
**Created:** [October 9, 2022, 1:15pm UTC](https://forums.powershell.org/t/content-filtering-with-powershell-command/20596 "2022-10-09T13:15:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gsing1987](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@gsing1987](https://forums.powershell.org/u/gsing1987)\
**Post date:** [October 9, 2022, 1:15pm UTC](https://forums.powershell.org/t/content-filtering-with-powershell-command/20596/1 "2022-10-09T13:15:43Z")

</div>

Hello,

I am new to powershell and working on one of the project where i have to gather the password from the Cyberark using its API.

I am getting below Output when i execute the CyberArk API for password.

{“Content”:“ **n\>\*\<Dy8uM$b.4F3h** ”,“PolicyID”:“JAMES\_AD\_WIN\_SVC\_Managed\_C90”,“LastTask”:“ChangeTask”,“UserName”:“SVC\_T_**JOIN",“CPMStatus”:“success”,“Folder”:“Root”,“Safe”:“HELLO\_PROD\_WIN\_Myhouse”,“Address”:“[hello.bye.hello.com](http://hello.bye.hello.com)”,“Name”:"Operating System-JAMES\_AD\_WIN\_SVC\_Managed\_C90-hello.bye.hello.com-SVC\_T**_JOIN”,“LogonDomain”:“ONE”,“DeviceType”:“Operating System”,“RetriesCount”:“-1”,“LastSuccessChange”:“1663434325”,“CreationMethod”:“PVWA”,“PasswordChangeInProcess”:“False”}

In above output **n\>\*\<Dy8uM$b.4F3h** is the password and rest of the content i wanted to delete and only that password i want to use.

I am not sure how i can do this, Can you pls guide me on this?

---

<div class="post-metadata">

**Author:** ![matt-bloomfield](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@matt-bloomfield](https://forums.powershell.org/u/matt-bloomfield)\
**Post date:** [October 9, 2022, 10:04pm UTC](https://forums.powershell.org/t/content-filtering-with-powershell-command/20596/2 "2022-10-09T22:04:29Z")

</div>

Hi, welcome to the forum 👋

Firstly, when posting code in the forum, please can you use the preformatted text \</\> button. It really helps us with readability, and copying and pasting your code (we don’t have to faff about replacing curly quote marks to get things working).

[How to format code on PowerShell.org](https://aws1.discourse-cdn.com/business5/uploads/powershell/original/2X/b/bee50c628238f2c076c0504efb6b15f2fb11f002.gif)

That looks like a JSON response so something like this should work:

```auto
$response = Invoke-RestMethod <API Stuff>
$password = $response.Content

```

---

<div class="post-metadata">

**Author:** ![gsing1987](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@gsing1987](https://forums.powershell.org/u/gsing1987)\
**Post date:** [October 10, 2022, 2:18pm UTC](https://forums.powershell.org/t/content-filtering-with-powershell-command/20596/3 "2022-10-10T14:18:41Z")

</div>

Thanks, will make sure of it and thanks it worked for me.

> Formatting

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:16pm UTC](https://forums.powershell.org/t/content-filtering-with-powershell-command/20596/4 "2024-05-16T20:16:33Z")

</div>

Closed on May 16, 2024, 8:16pm UTC


