Skip to content

Instantly share code, notes, and snippets.

@petersgiles
Forked from gbiellem/SetUnblockPolicy.ps1
Created September 2, 2017 09:44
Show Gist options
  • Save petersgiles/771822f09bba94fc3a8e8b6154e2b2cc to your computer and use it in GitHub Desktop.
Save petersgiles/771822f09bba94fc3a8e8b6154e2b2cc 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