hello, can anyone tell me what's wrong with this PowerShell code?
Someone made this code for me. Basically, it use a regex to change some lines from a html file. I think it must be filled with something to work. can anyone correct it, as to work good?
$Content = Get-Content -Path $Path "c:\Users\Castel\Videos\Captures" -Filter "*.html" Set-Content -Path $Path -Value $Content# Get each page as a HTML file/ assign to a variable #$Htmltext = (Invoke-WebRequest -Uri $MainUrl)# This is the link to the webpage #$HtmlPage.contentforeach($Line in $HtmlPage) { $GetTitle = [regex] "$RegexForTitle" $PageTitle = $FindTitle.Match($HtmlPage) $PageTitle.Captures[0].Value$Title = $PageTitle.Captures[0].Value -ireplace '\<[^\>]*\>' } #end foreach file