PowerShell Hack: Mit diesem PowerShell-Skript kannst du Text in mehreren Dateien ersetzen. Ich habe ein kleines PowerShell-Skript für Windows geschrieben, um Text in einem ganzen Verzeichnis und dessen Unterverzeichnissen zu ersetzen. Das kann manchmal ganz praktisch sein, wenn man zum Beispiel in einem ganzen Ordner mit html-Dateien, etwas in allen Dateien ersetzen möchte und das Projekt nicht in Visual Studio geöffnet hat. Das folgende Skript ersetzt im aktuellen Verzeichnis und dessen Unterverzeichnissen in allen Textdateien (*.txt) den Text "search" mit "substitute". ``` $files = Get-ChildItem . *.txt -rec foreach ($file in $files) { (Get-Content -Raw $file.PSPath) -replace "search", "substitute" | Set-Content $file.PSPath } ``` Vorsicht: Bevor man das Skript verwendet, empfehle ich das angepasste Skript in einem Testordner zu testen und ein Backup des Ordners zu erstellen, auf dem man das Skript anwenden möchte.  ## English ## *PowerShell Hack: With this PowerShell script you can replace text in multiple files.* *I wrote a small PowerShell script for Windows to replace text in an entire directory and its subdirectories.* *This can sometimes come in handy if, for example, you want to replace something in a folder of html files and you don't have the project open in Visual Studio.* *The following script replaces the text "search" with "substitute" in the current directory and its subdirectories in all text files (*.txt).* ``` $files = Get-ChildItem . *.txt -rec foreach ($file in $files) { (Get-Content -Raw $file.PSPath) -replace "search", "substitute" | Set-Content $file.PSPath } ``` *Caution: Before using the script, I recommend testing the customized script in a test folder and making a backup of the folder where you want to apply the script to.* *Live your Secrets and Steem Prosper* 🔥 xx Viki @vikisecrets Blog post: [Text in mehreren Dateien (in einem ganzen Verzeichnis) mit der Windows PowerShell ersetzen](https://virtualnet.at/weblog/250)
author | vikisecrets |
---|---|
permlink | powershell-hack-how-to-replace-text-in-multiple-files |
category | howto |
json_metadata | {"app":"steempeak/2.2.8","format":"markdown","tags":["howto","powershell","technology","windows","deutsch","palnet"],"users":["vikisecrets"],"links":["/@vikisecrets","https://virtualnet.at/weblog/250"],"image":["https://files.steempeak.com/file/steempeak/vikisecrets/wK4Bxrm3-powershell-hero-1.jpg"]} |
created | 2020-01-21 12:07:33 |
last_update | 2020-01-21 12:07:33 |
depth | 0 |
children | 11 |
last_payout | 2020-01-28 12:07:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.734 HBD |
curator_payout_value | 0.706 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2,105 |
author_reputation | 1,203,372,732,503,092 |
root_title | "PowerShell Hack: How to replace text in multiple files 💪" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 94,606,277 |
net_rshares | 6,478,726,475,460 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
mammasitta | 0 | 104,282,410,177 | 20% | ||
remlaps | 0 | 10,184,628,092 | 25% | ||
germansailor | 0 | 140,391,496,372 | 100% | ||
sabine-reichert | 0 | 34,591,268,263 | 100% | ||
miketr | 0 | 12,439,162,137 | 20% | ||
uwelang | 0 | 150,647,530,248 | 15% | ||
freiheit50 | 0 | 87,931,447,783 | 50% | ||
zorg67 | 0 | 1,213,342,580 | 100% | ||
schamangerbert | 0 | 137,278,274,081 | 30% | ||
tarazkp | 0 | 891,753,466,649 | 34% | ||
komischername | 0 | 17,268,574,682 | 100% | ||
xels | 0 | 318,519,131,745 | 50% | ||
techken | 0 | 379,695,804 | 3% | ||
vieanna | 0 | 444,620,588,053 | 75% | ||
edkarnie | 0 | 41,312,855,148 | 10% | ||
leaky20 | 0 | 53,368,008,858 | 100% | ||
vikisecrets | 0 | 1,168,432,387,975 | 100% | ||
lauch3d | 0 | 12,459,345,923 | 100% | ||
syalla | 0 | 25,359,383,354 | 81% | ||
smartcoins | 0 | 9,607,428,244 | 25% | ||
tinoschloegl | 0 | 1,204,172,736 | 100% | ||
nicolerose | 0 | 14,171,087,861 | 100% | ||
investyourvote | 0 | 28,519,644,029 | 40% | ||
smallstepschange | 0 | 0 | 10% | ||
silentscreamer | 0 | 25,960,319,090 | 100% | ||
natha93 | 0 | 7,428,362,626 | 25% | ||
raise-me-up | 0 | 0 | 0.01% | ||
tomhall | 0 | 43,340,893,825 | 30% | ||
melvin7 | 0 | 38,286,942,287 | 100% | ||
backinblackdevil | 0 | 786,291,863,853 | 25% | ||
satren | 0 | 72,075,780,352 | 25% | ||
mima2606 | 0 | 55,770,142,998 | 26% | ||
siamcat | 0 | 27,594,629,430 | 50% | ||
stmdev | 0 | 100,542,737 | 1% | ||
makney | 0 | 2,114,459,421 | 50% | ||
gadrian | 0 | 79,907,380,435 | 30% | ||
lordbutterfly | 0 | 217,835,708,820 | 50% | ||
tonimontana | 0 | 147,803,774 | 5.57% | ||
fotogruppemunich | 0 | 55,688,306,198 | 35% | ||
break-out-trader | 0 | 3,742,906,530 | 25% | ||
yaraha | 0 | 3,617,331,515 | 25% | ||
followmikecee | 0 | 4,531,047,305 | 35% | ||
altobot | 0 | 7,368,560,648 | 50% | ||
nin4i | 0 | 52,816,153 | 100% | ||
bitandi | 0 | 29,384,472,264 | 20% | ||
anteilboerse | 0 | 1,556,483,575 | 30% | ||
zuerich | 0 | 275,664,631,942 | 20% | ||
feuerelfe | 0 | 62,274,897,266 | 50% | ||
laissez-faire | 0 | 27,320,736 | 100% | ||
germanbot | 0 | 47,585,558,334 | 50% | ||
diana.feuerberg | 0 | 7,698,705,276 | 100% | ||
dein-problem | 0 | 0 | -0.5% | ||
rentenbot | 0 | 998,107,746 | 30% | ||
mima260669 | 0 | 1,531,480,141 | 38% | ||
limka | 0 | 75,862,400 | 100% | ||
kokadi | 0 | 19,882,314,580 | 35% | ||
babschnae | 0 | 217,582,443,577 | 100% | ||
constant-flux | 0 | 0 | 45% | ||
ichbins | 0 | 35,932,029,317 | 100% | ||
kryptodenno | 0 | 108,982,453,447 | 15% | ||
maxsieg | 0 | 546,837,976 | 25% | ||
cordulagruen | 0 | 107,589,283 | 100% | ||
steem-hilfe | 0 | 1,812,321,666 | 52% | ||
solomon.grundy | 0 | 2,746,481,393 | 100% | ||
wulff-media | 0 | 1,466,159,352 | 100% | ||
mattgroening | 0 | 17,058,743,293 | 100% | ||
babytarazkp | 0 | 3,207,253,828 | 50% | ||
querdenker | 0 | 3,372,576,180 | 13% | ||
avare | 0 | 11,589,138,712 | 100% | ||
voinvote | 0 | 125,447,967,946 | 70% | ||
voinvote3 | 0 | 139,823,494,707 | 70% | ||
poiscrame | 0 | -7,025,558 | -10% | ||
erangreen | 0 | 192,913,075,739 | 100% | ||
appics.tutorial | 0 | 27,600,979,675 | 100% | ||
toni.pal | 0 | 0 | 0.38% | ||
voinvote.token | 0 | 4,072,991,876 | 40% |
!COFFEEA $trdo For you
author | avare | ||||||
---|---|---|---|---|---|---|---|
permlink | re-vikisecrets-2020121t174530949z | ||||||
category | howto | ||||||
json_metadata | {"tags":["howto","powershell","technology","windows","deutsch","palnet"],"app":"esteem/2.2.2-mobile","format":"markdown+html","community":"esteem.app"} | ||||||
created | 2020-01-21 14:44:54 | ||||||
last_update | 2020-01-21 14:44:54 | ||||||
depth | 1 | ||||||
children | 1 | ||||||
last_payout | 2020-01-28 14:44:54 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 0.013 HBD | ||||||
curator_payout_value | 0.013 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 22 | ||||||
author_reputation | 30,667,607,216,522 | ||||||
root_title | "PowerShell Hack: How to replace text in multiple files 💪" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 94,610,990 | ||||||
net_rshares | 172,121,362,135 | ||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
vikisecrets | 0 | 170,146,685,134 | 15% | ||
coffeea.token | 0 | 1,974,677,001 | 5% |
Congratulations @avare, you successfuly trended the post shared by @vikisecrets! @vikisecrets will receive <b>0.13987688</b> [TRDO](https://steem-engine.com/?p=history&t=TRDO) & @avare will get <b>0.09325125</b> [TRDO](https://steem-engine.com/?p=history&t=TRDO) curation in 3 Days from Post Created Date! <b>"Call [TRDO](https://steem-engine.com/?p=history&t=TRDO), Your Comment Worth Something!"</b> --- <sup>To view or trade TRDO go to [steem-engine.com](https://steem-engine.com/?p=market&t=TRDO) Join [TRDO Discord Channel](https://discord.gg/wySP8T9) or Join [TRDO Web Site](http://www.trendotoken.info/)</sup>
author | trendotoken |
---|---|
permlink | re-avare-re-vikisecrets-2020121t174530949z-20200121t144502880z |
category | howto |
json_metadata | {"tags":["comments-scot","trendo-bot"],"app":"comments-scot/1.1","format":"markdown"} |
created | 2020-01-21 14:45:03 |
last_update | 2020-01-21 14:45:03 |
depth | 2 |
children | 0 |
last_payout | 2020-01-28 14:45:03 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 618 |
author_reputation | 5,546,209,053,433 |
root_title | "PowerShell Hack: How to replace text in multiple files 💪" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 94,610,995 |
net_rshares | 0 |
Cool 👍
author | bitandi | ||||||
---|---|---|---|---|---|---|---|
permlink | re-vikisecrets-2020121t175715511z | ||||||
category | howto | ||||||
json_metadata | {"tags":["howto","powershell","technology","windows","deutsch","palnet"],"app":"esteem/2.2.2-mobile","format":"markdown+html","community":"esteem.app"} | ||||||
created | 2020-01-21 16:57:15 | ||||||
last_update | 2020-01-21 16:57:15 | ||||||
depth | 1 | ||||||
children | 0 | ||||||
last_payout | 2020-01-28 16:57:15 | ||||||
cashout_time | 1969-12-31 23:59:59 | ||||||
total_payout_value | 0.012 HBD | ||||||
curator_payout_value | 0.013 HBD | ||||||
pending_payout_value | 0.000 HBD | ||||||
promoted | 0.000 HBD | ||||||
body_length | 6 | ||||||
author_reputation | 447,713,177,760,555 | ||||||
root_title | "PowerShell Hack: How to replace text in multiple files 💪" | ||||||
beneficiaries |
| ||||||
max_accepted_payout | 1,000,000.000 HBD | ||||||
percent_hbd | 10,000 | ||||||
post_id | 94,615,372 | ||||||
net_rshares | 166,443,794,524 | ||||||
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
vikisecrets | 0 | 166,443,794,524 | 15% |
[](http://bit.ly/2YbNaET) Lucky you @vikisecrets here is your COFFEEA, view all your tokens at [steem-engine.com](https://steem-engine.com/) [Vote for c0ff33a as Witness](http://bit.ly/2YbNaET)
author | coffeea.token |
---|---|
permlink | re-powershell-hack-how-to-replace-text-in-multiple-files-20200121t183224z |
category | howto |
json_metadata | "{"app": "beem/0.21.1"}" |
created | 2020-01-21 18:32:27 |
last_update | 2020-01-21 18:32:27 |
depth | 1 |
children | 0 |
last_payout | 2020-01-28 18:32:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 235 |
author_reputation | 4,292,084,626,291 |
root_title | "PowerShell Hack: How to replace text in multiple files 💪" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 94,617,907 |
net_rshares | 0 |
Du hast ein Upvote von mir bekommen, diese soll die Deutsche Community unterstützen. Wenn du mich unterstützten möchtest, dann sende mir eine Delegation. Egal wie klein die Unterstützung ist, Du hilfst damit der Community. DANKE!
author | germanbot |
---|---|
permlink | re-powershell-hack-how-to-replace-text-in-multiple-files-20200121t121309z |
category | howto |
json_metadata | "{"app": "beem/0.20.19"}" |
created | 2020-01-21 12:13:15 |
last_update | 2020-01-21 12:13:15 |
depth | 1 |
children | 0 |
last_payout | 2020-01-28 12:13:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 231 |
author_reputation | 6,584,993,625,435 |
root_title | "PowerShell Hack: How to replace text in multiple files 💪" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 94,606,441 |
net_rshares | 0 |
@mima2606 denkt du hast ein Vote durch @investinthefutur verdient! ----> [Wer ist investinthefutur ?](https://steemit.com/deutsch/@investinthefutur/wer-ist-investinthefutur)<br>@mima2606 thinks you have earned a vote of @investinthefutur !----> [Who is investinthefutur ?](https://steemit.com/deutsch/@investinthefutur/wer-ist-investinthefutur)
author | investinthefutur |
---|---|
permlink | re-powershell-hack-how-to-replace-text-in-multiple-files-20200121t132029z |
category | howto |
json_metadata | "{"app": "beem/0.22.0"}" |
created | 2020-01-21 13:20:30 |
last_update | 2020-01-21 13:20:30 |
depth | 1 |
children | 0 |
last_payout | 2020-01-28 13:20:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 344 |
author_reputation | 135,729,607,290,395 |
root_title | "PowerShell Hack: How to replace text in multiple files 💪" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 94,608,341 |
net_rshares | 0 |
@querdenker denkt du hast ein Vote durch @investinthefutur verdient! ----> [Wer ist investinthefutur ?](https://steemit.com/deutsch/@investinthefutur/wer-ist-investinthefutur)<br>@querdenker thinks you have earned a vote of @investinthefutur !----> [Who is investinthefutur ?](https://steemit.com/deutsch/@investinthefutur/wer-ist-investinthefutur)
author | investinthefutur |
---|---|
permlink | re-powershell-hack-how-to-replace-text-in-multiple-files-20200122t015744z |
category | howto |
json_metadata | "{"app": "beem/0.22.0"}" |
created | 2020-01-22 01:57:45 |
last_update | 2020-01-22 01:57:45 |
depth | 1 |
children | 0 |
last_payout | 2020-01-29 01:57:45 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 348 |
author_reputation | 135,729,607,290,395 |
root_title | "PowerShell Hack: How to replace text in multiple files 💪" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 94,626,614 |
net_rshares | 0 |
i hope i can be good in programing
author | jaffgrah |
---|---|
permlink | re-vikisecrets-q4favw |
category | howto |
json_metadata | {"tags":["howto"],"app":"steempeak/2.2.8"} |
created | 2020-01-21 20:19:18 |
last_update | 2020-01-21 20:19:18 |
depth | 1 |
children | 0 |
last_payout | 2020-01-28 20:19:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 34 |
author_reputation | -237,855,663,048 |
root_title | "PowerShell Hack: How to replace text in multiple files 💪" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 94,620,413 |
net_rshares | -47,987,367,539 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
steemcleaner | 0 | -21,739,191 | -0.08% | ||
spaminator | 0 | -21,961,214,230 | -0.02% | ||
mack-bot | 0 | -26,004,414,118 | -0.25% |
Echt cool, wusste gar nicht dass du auch Skripte schreibst. LG Michael !invest_vote
author | mima2606 |
---|---|
permlink | re-vikisecrets-q4gkx9 |
category | howto |
json_metadata | {"tags":["howto"],"app":"steempeak/2.2.8"} |
created | 2020-01-21 13:17:36 |
last_update | 2020-01-21 13:17:36 |
depth | 1 |
children | 0 |
last_payout | 2020-01-28 13:17:36 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.013 HBD |
curator_payout_value | 0.013 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 84 |
author_reputation | 178,748,423,282,323 |
root_title | "PowerShell Hack: How to replace text in multiple files 💪" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 94,608,249 |
net_rshares | 170,863,045,575 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
vikisecrets | 0 | 170,863,045,575 | 15% |
Sehr interessant. Versuche mir nur gerade mal einen Use Case vorzustellen. Yours Querdenker !invest_vote
author | querdenker |
---|---|
permlink | re-vikisecrets-q4hiae |
category | howto |
json_metadata | {"tags":["howto"],"app":"steempeak/2.2.8"} |
created | 2020-01-22 01:55:06 |
last_update | 2020-01-22 01:55:06 |
depth | 1 |
children | 0 |
last_payout | 2020-01-29 01:55:06 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 104 |
author_reputation | 8,990,783,240,010 |
root_title | "PowerShell Hack: How to replace text in multiple files 💪" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 94,626,568 |
net_rshares | 0 |
Congratulations @vikisecrets, your post successfully recieved <b>0.13987688</b> [TRDO](https://steem-engine.com/?p=history&t=TRDO) from below listed TRENDO callers:<br> > <sup>@avare earned : **0.09325125** [TRDO](https://steem-engine.com/?p=history&t=TRDO) curation</sup> --- <sup>To view or trade TRDO go to [steem-engine.com](https://steem-engine.com/?p=market&t=TRDO) Join [TRDO Discord Channel](https://discord.gg/wySP8T9) or Join [TRDO Web Site](http://www.trendotoken.info/)</sup>
author | trendotoken |
---|---|
permlink | re-vikisecrets-powershell-hack-how-to-replace-text-in-multiple-files-20200124t125130549z |
category | howto |
json_metadata | {"tags":["trdo","trendo-bot"],"app":"comments-scot/1.1","format":"markdown"} |
created | 2020-01-24 12:52:33 |
last_update | 2020-01-24 12:52:33 |
depth | 1 |
children | 0 |
last_payout | 2020-01-31 12:52:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 490 |
author_reputation | 5,546,209,053,433 |
root_title | "PowerShell Hack: How to replace text in multiple files 💪" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 94,721,202 |
net_rshares | 0 |