Adoptou uma abordagem ligeiramente diferente e conseguiu que funcionasse:
#read in the prefs file
#locate the prefs.js files
$PrefsFiles = Get-Item -Path ($env:SystemDrive+"\Users\*\AppData\Roaming\Mozilla\Firefox\Profiles\*\prefs.js")
$out = @()
$out2 = @()
#clear screen
clear
#load changes
$Update= 'user_pref("network.proxy.backup.ftp", "0.0.0.0");
user_pref("network.proxy.backup.ftp_port", 80);
user_pref("network.proxy.backup.socks", "0.0.0.0");
user_pref("network.proxy.backup.socks_port", 80);
user_pref("network.proxy.backup.ssl", "0.0.0.0");
user_pref("network.proxy.backup.ssl_port", 80);
user_pref("network.proxy.ftp", "0.0.0.0");
user_pref("network.proxy.ftp_port", 80);
user_pref("network.proxy.http", "0.0.0.0");
user_pref("network.proxy.http_port", 80);
user_pref("network.proxy.no_proxies_on", "localhost, 127.0.0.1,10.0.0.0/8,192.0.0.0/8");
user_pref("network.proxy.share_proxy_settings", true);
user_pref("network.proxy.socks", "0.0.0.0");
user_pref("network.proxy.socks_port", 80);
user_pref("network.proxy.ssl", "0.0.0.0")
user_pref("network.proxy.ssl_port", 80);
user_pref("network.proxy.type", 1);'
#Read in Prefsjs
$Prefsjs = (Get-Content $PrefsFiles)
#delete all the network proxy settings
foreach ($line in $Prefsjs){
if ($line -like 'user_pref("network.proxy.*') {$line = $null}
Else
{$out+= $line}
}
#add the whole chunk of proxy settings
foreach ($line in $out)
{
if ($line -like 'user_pref("network.cookie.prefsMigrated"*')
{
$out2+=$line+$Update
}
Else
{
$out2+= $line
}
}
$out2
#back up the existing file
Copy-Item $PrefsFiles $PrefsFiles".back"
#writeout the new file
Clear-Content $PrefsFiles
Add-Content $PrefsFiles $out2