-
Notifications
You must be signed in to change notification settings - Fork 79
/
unblock_downloaded_files.ps1
48 lines (29 loc) · 1.15 KB
/
unblock_downloaded_files.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<#
Purpose: Recursively removes the "this file was downloaded from the Internet" flag from all files
Requirements: Place script in the directory you want to start from
Author: reddit.com/user/vocatus ( [email protected] ) // PGP key: 0x07d1490f82a211a2
Version: 1.0.0
#>
#############
# VARIABLES # ---------------------- Set these to match your environment ------------------------ #
#############
# Rules for variables:
# * NO trailing slashes on paths! (bad: c:\directory\ )
# * Spaces are okay (okay: c:\my folder\with spaces )
# * Network paths are okay (okay: \\server\share name )
param (
# Logging information (currently unused, the unblock-file command doesn't output any text
[string]$logpath = "c:\logs",
[string]$logfile = "unblock_downloaded_files.log"
)
# ----------------------------- Don't edit anything below this line ----------------------------- #
###################
# PREP AND CHECKS #
###################
$SCRIPT_VERSION = "1.0.0"
$SCRIPT_UPDATED = "2024-05-28"
$CUR_DATE=get-date -f "yyyy-MM-dd"
###########
# EXECUTE #
###########
dir "." -recurse | unblock-file