Skip to content

Instantly share code, notes, and snippets.

@gbiellem
Created September 2, 2017 03:41
Show Gist options
  • Save gbiellem/7e08792652cc7af3c6ab868c7ce780bf to your computer and use it in GitHub Desktop.
Save gbiellem/7e08792652cc7af3c6ab868c7ce780bf to your computer and use it in GitHub Desktop.
Turn off Downloads being "Blocked"
$reg = @{
Path = 'Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments'
Name = 'SaveZoneInformation'
PropertyType = 'DWORD'
Value = 1
}
if (-not (Test-Path -Path $reg.Path)) {
New-Item $reg.Path
}
try
{
New-ItemProperty @reg -ErrorAction Stop
}
catch
{
Set-ItemProperty -Path $reg.Path -Name $reg.Name -Value $reg.Value
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment