Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

Learn More

Can I modify Firefox config (pref.js) using Powershell

more options

I tried to script a PS to make changes to the Pref.js file; however, the changes do not stick? Is this is expected or done by default is there a way that I can modify the file without going to which single system?

PS Script

$TopDir = "$env:APPDATA\Mozilla\Firefox\Profiles" $FileName = 'prefs.js'

$DefaultProfileDir = (Get-ChildItem -LiteralPath $TopDir -Directory). Where({

  $_.FullName -match '\.default'
  }).FullName

$FullFileName = Join-Path -Path $DefaultProfileDir -ChildPath $FileName

$Data = foreach($line in Get-Content $FullFileName) {

if( ($line.IndexOf('network.automatic-ntlm-auth.trusted-uris')) -ne -1)
{
  If ($line.IndexOf('*') -ne -1) {
    $line = $line.replace( '*' , 'abc.com,.abcd.com,.abcde.com')
  }
}
$line

}

$data | Set-Content $FullFileName -Force

I tried to script a PS to make changes to the Pref.js file; however, the changes do not stick? Is this is expected or done by default is there a way that I can modify the file without going to which single system? PS Script $TopDir = "$env:APPDATA\Mozilla\Firefox\Profiles" $FileName = 'prefs.js' $DefaultProfileDir = (Get-ChildItem -LiteralPath $TopDir -Directory). Where({ $_.FullName -match '\.default' }).FullName $FullFileName = Join-Path -Path $DefaultProfileDir -ChildPath $FileName $Data = foreach($line in Get-Content $FullFileName) { if( ($line.IndexOf('network.automatic-ntlm-auth.trusted-uris')) -ne -1) { If ($line.IndexOf('*') -ne -1) { $line = $line.replace( '*' , 'abc.com,.abcd.com,.abcde.com') } } $line } $data | Set-Content $FullFileName -Force

선택된 해결법

No need to edit prefs.js as you can do this via a policy.

See Authentication

문맥에 따라 이 답변을 읽어주세요 👍 0

모든 댓글 (2)

more options

선택된 해결법

No need to edit prefs.js as you can do this via a policy.

See Authentication

more options

Also, while Firefox is open, any changes to prefs.js are likely to be ignored or overwritten. You would need to make changes while Firefox is not running if you wanted to do it this way.