Search notes:

PowerShell cmdLet Unblock-File

unblock-file removes a file's Zone.Identifier alternate data stream whose value of 3 (?) indicates that the file was downloaded from the internet and is possibly unsafe to run.
After unblocking a file, it can be run even if execution policy is set to RemoteSigned.
unblock-file might also be used to execute a PowerShell script that was downloaded from a trusted location and trying to execute the script results in the error message script cannot be loaded. The file … is not digitally signed. You cannot run this script on the current system.

Demonstration

PS C:\> $dll = 'C:\oracle\18c\ODP.NET\managed\common\Oracle.ManagedDataAccess.dll'
PS C:\> add-type -path $dll
add-type : Could not load file or assembly 'file:///C:\oracle\18c\ODP.NET\managed\common\Oracle.ManagedDataAccess.dll'
or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
…
Verifying if the DLL has the Zone.Identifier alternate stream which causes the error:
PS C:\> (get-item $dll -stream zone.identifier -errorAction silentlyContinue).length
103
Open the DLL's property dialog:
PS C:\> (new-object -com shell.application).nameSpace((split-path $dll)).parseName((split-path -leaf $dll)).invokeVerb('properties')
Unblock the DLL
PS C:\> unblock-file $dll
PS C:\> (get-item $dll -stream zone.identifier -errorAction silentlyContinue).length
0
PS C:\> (new-object -com shell.application).nameSpace((split-path $dll)).parseName((split-path -leaf $dll)).invokeVerb('properties')
After unblocking the file, the unblock checkbox is gone from the file's property dialog:
The DLL can now be added:
PS C:\> add-type -path $dll

See also

Set the Zone.Identifier stream in a file to simlate a file being downloaded from the Internet.
Error message: The 'xxx' command was found in the module 'xxx', but the module could not be loaded.
Powershell command noun: executionPolicy
Powershell command noun: file

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1740432126, '3.131.37.220', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/command-inventory/noun/file/unblock(85): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78