- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2021 06:06 AM
Hi,
We are customizing the certificate discovery for our client. "Get-ChildItem -path Cert:\CurrentUser\Root | select *" is the command we're making use of in the pattern to get the certificate details. We are using powershell.exe in cmd to execute this. But we are having trouble including this whole line. We are only able to include till Root and get the output.
If we include " | select *" we are getting the error "'select is not recognized as an internal or external command,
operable program or batch file." How do I execute this command in the pattern step?
Regards,
Akshatha
Solved! Go to Solution.
- Labels:
-
Discovery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2021 07:39 AM
Answering my own question, the solution is to escape the pipe operator by using ^|
The command is failing because the pipe | is being interpreted by the cmd shell and not by PowerShell as explained here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2021 07:39 AM
Answering my own question, the solution is to escape the pipe operator by using ^|
The command is failing because the pipe | is being interpreted by the cmd shell and not by PowerShell as explained here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2022 08:24 AM
Hi @Akshatha Ballal,
I also have a similar requirement from user, Is there any particular format to insert PowerShell command inside set command details? Getting error while doing so.
Thanks