'use firefox or edge in powershell script

i have a powershell script to open internet explorer and search a specific word and find website and open But regular users complain about being slow I want to change this script to make it work with Firefox or Microsoft Edge

$IE = new-object -com internetexplorer.application
$IE.navigate("https://www.google.com/search?q=news")
$IE.visible=$false
while ($IE.busy) {sleep  20}
$link = $ie.Document.getElementsByTagName('A') | where-object {$_.href -like '*news.google*'}
$Link.click()

Thank you for solving this problem for me Regard.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source