-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_edit_files.ps1
More file actions
27 lines (22 loc) · 1.2 KB
/
Copy path_edit_files.ps1
File metadata and controls
27 lines (22 loc) · 1.2 KB
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
# Pull settings from INI file ad define them as variables
$INI = Get-Content -Path 'settings.ini' | Select-Object -Skip 1
$directory = ($INI | Where-Object { $_.Trim() -match '^directory=' }) -replace '^directory=', ''
$temp_list = ($INI | Where-Object { $_.Trim() -match '^temp_list=' }) -replace '^temp_list=|$', ''
# Define your custom text (replace newline `r`n with your custom separator)
$customText = @"
########################################################
##### ADOBE TELEMETRY BLOCK ######
########################################################
# These IPs will only block the telemetry check of Adobe
# apps, and shouldn't interfere with any other network
# option, such as AI generation, downloads, etc.
"@
# Loop through all the .txt files in the directory
Get-ChildItem "$directory\$temp_list" | ForEach-Object {
# Read the content of the file, skipping the first six lines
$fileContent = Get-Content $_.FullName | Select-Object -Skip 6
# Combine the custom text with the rest of the file content
$newContent = $customText + "`r`n" + ($fileContent -join "`r`n")
# Write the new content back to the file
[System.IO.File]::WriteAllText($_.FullName, $newContent)
}