in my powershell script a lot of items are getting printed in the console. I want to copy them and validate a data is present or not. Any way I can do it?
I am yet to get any solution for this. thank you in advance
in my powershell script a lot of items are getting printed in the console. I want to copy them and validate a data is present or not. Any way I can do it?
I am yet to get any solution for this. thank you in advance
One Way to record everything thats going on with your Script is Powershell Transcript
Or you can just Copy the Output from your Console to a Text file in Notepad++ or something like that...
But to be honest I don't quite understand what you are trying to achieve with that, wouldn't be the goal with a script that you don't have to check something like that?
My suggestion would be that you look for a way to validate anything you need within your Script, and maybe implement some sort of Logging to have the Option to review it when something has gone wrong...
if your case is to validate your logs I suggest saving the logs into a file and then validating them and don't use the console for that purpose. if you still want to copy them from the console try this: Copy text from a Windows CMD window to clipboard
In your situation, i would use Start-Transcript into a log file.
And then get information from the log file using filters.