Forum Discussion
Shree2280
Jan 27, 2021Brass Contributor
extract http data
Hi expert, I am trying to extract http:// URL from given file but getting empty file in export here is the code $items = Get-ChildItem -LiteralPath "E:\Backup_Testinstance\" | Where-Obje...
farismalaeb
Jan 27, 2021Iron Contributor
I dont know if I miss a point in your code, but in the first line, the Where-Object {$_.Extension -like "https://"}
I don't think this is a valid file extension.
an Empty file in the export means an empty result, lets try the first step
what is the output of this line
$items = Get-ChildItem -LiteralPath "E:\Backup_Testinstance\" | Where-Object {$_.Extension -eq "http://"}Shree2280
Jan 27, 2021Brass Contributor
I tried this but getting http plus some records i do not want records after space
Get-ChildItem -Path C:\check\two -recurse | Select-String -Pattern "http://" | ` Select-Object -Property Path,LineNumber,Line | ` Export-CSV "C:\check\ResultFile.csv"
Shree