Currently im trying to create a script that will open a file and if any lines begin with the text i supply, it will delete the entire line. I keep getting convoluted information on escape characters and how they should be applied
My script is as follows:
Powershell
try{cd$env:APPDATA\Mozilla\Firefox\Profiles\*.default-ErrorActionStopGet-Content.\prefs.js|Where{$_-notmatch'user_pref`(`"network`.automatic`-ntlm`-auth`.trusted`-uris`"'}|Set-Contentfilteredfile.txt}catch{$ErrorMessage=$_.Exception.Message$FailedItem=$_.Exception.ItemName}finally{Echo$ErrorMessageEcho$FailedItem}
What im trying to do is delete any line that begins with:
user_pref("network.automatic-ntlm-auth.trusted-uris"