Remove-Item -Path "C:\Downloads\file.exe" -Stream Zone.Identifier -Force This does the same thing as Unblock-File . $folder = "C:\Downloads" Get-ChildItem -Path $folder -File -Recurse | ForEach-Object if (Get-Item -Path $_.FullName -Stream Zone.Identifier -ErrorAction SilentlyContinue) Unblock-File -Path $_.FullName Write-Host "Unblocked: $($_.FullName)"