Change Download settings | Change the download settings using the Power Shell

Welcome Forums General PowerShell Q&A Change Download settings | Change the download settings using the Power Shell

Viewing 0 reply threads
  • Author
    Posts
    • #213222
      Participant
      Topics: 1
      Replies: 0
      Points: -8
      Rank: Member

      Hi,

      I am trying to change the Chrome download settings using Power Shell. This is required to be setup before the user opens Google chrome.
      The browser should prompt user download path, and not automatically download to download location.
      I do not want to change registry. With the below Power Shell script, I am unable to change the preference. What is the issue here? Please help.
      Power Shell Script
      $LocalAppData = [Environment]::GetFolderPath( [Environment+SpecialFolder]::LocalApplicationData )
      $ChromeDefaults = Join-Path $LocalAppData “Google\Chrome\User Data\default”
      $ChromePrefFile = Join-Path $ChromeDefaults “Preferences”
      $ChromeSettings = Get-Content $ChromePrefFile | ConvertFrom-Json
      $ChromeSettings.download.prompt_for_download=$True
      $ChromeSettings | ConvertTo-Json -depth 32 | set-content $ChromePrefFile
      
      Thanks
      Harish
      • This topic was modified 1 month, 3 weeks ago by kvprasoon. Reason: code formatting
Viewing 0 reply threads
  • You must be logged in to reply to this topic.