Hello,
I tried searching here for a topic related to my inquiry but cannot find one.
I have a file (c:\users\test\test.csv)
that contains a list of names(view tag). In this list of names, I want to check which one is returning an error so I can remove them in my final list. For me to identify if it is returning an error or not, I have to run the command "cleartool
lsview -l -prop <view tag> | find "Last modified" | ForEach-Object { (($_ -split ' ')[2])}".
Currently, I have this code to start with but I am missing the part where it echo or list the name which is returning an error (to ignore that name that will give the standard output)?
$views = get-content c:\users\test\test.csv
foreach ($list in $views){
cleartool lsview -l -prop $list | find "Last modified" | ForEach-Object { (($_ -split ' ')[2])}
}
To give you an idea, when the name has no issue, it will return something like this:
2011-06-30T17:56:48+02:00
If there is an error with the name, it will return this:
cleartool : cleartool: Error: No matching entries found for view tag "trial_only".
At line:3 char:8
+ cleartool lsview -l -prop $list | find "Last modified" | ForEa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (cleartool: Erro...rg_xgold_618s".:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Really hope you can help me with this.
Thank you and best regards,
Maria