324 Commits
v0.1 ... v0.2

Author SHA1 Message Date
1008477d9d Update list-credits.ps1 2021-05-04 19:48:25 +02:00
164cc3ba80 Fix typo 2021-05-04 16:41:47 +02:00
7c41820f13 Rename to list-memos.ps1 2021-05-04 16:39:06 +02:00
d12a27ace0 Rename to add-memo.ps1 2021-05-04 16:31:15 +02:00
489b0608e2 Change the emoji 2021-05-03 10:31:01 +02:00
8947cbed1f Enhance the error message 2021-05-02 21:30:48 +02:00
2f53d5c1d6 Improve warning of the cd-* scripts 2021-05-02 11:51:41 +02:00
042f45439d Add cd-recycle-bin.ps1 2021-05-02 11:38:19 +02:00
b098205d9c Improve output of clear-recycle-bin.ps1 2021-05-02 11:25:54 +02:00
f12b44fb48 Add clear-recycle-bin.ps1 2021-05-02 11:21:43 +02:00
bc7ed352fa Add list-recycle-bin.ps1 2021-05-02 11:14:48 +02:00
9c7a29cc8c Add open-recycle-bin.ps1 2021-05-02 11:07:39 +02:00
5d76870f03 Improve speed of simulate-matrix.ps1 2021-05-01 18:21:12 +02:00
b9351c40c2 Fixed typo 2021-05-01 10:23:46 +02:00
a378f3ae47 Add play-files.ps1 2021-05-01 09:26:26 +02:00
9bd33214b1 Enhance play-mp3.ps1 and play-m3u.ps1 2021-04-30 20:39:06 +02:00
cd34307547 Add Abbr directory 2021-04-29 20:19:07 +02:00
b73da7c2f7 Improve my-profile.ps1 2021-04-28 17:36:47 +02:00
53efcf0fc8 Improve the prompt 2021-04-28 17:27:23 +02:00
2345cc14c8 Enhance list-latest-tag.ps1 2021-04-28 13:07:20 +02:00
478d62aa89 Add list-latest-tag.ps1 2021-04-28 13:01:05 +02:00
cfaa7b48da Add stopwatch to pull-repo.ps1 2021-04-28 07:41:12 +02:00
b29648cd42 Add songs to list-credits.ps1 2021-04-27 21:03:39 +02:00
dc01730a4e Add what-is.ps1 2021-04-27 15:54:52 +02:00
c927d7263c Improve sync-repo.ps1 2021-04-27 15:26:00 +02:00
0f9dcffc68 Improve the output 2021-04-27 11:12:51 +02:00
e2188fa160 Improve output of create-branch.ps1 2021-04-26 14:38:39 +02:00
dc7dd8d410 Improve upload-file.ps1 2021-04-26 12:44:33 +02:00
3ea4432a38 Improve output of pull-repo.ps1 2021-04-26 08:12:16 +02:00
6f5af190c9 Add list-os-updates.ps1 2021-04-26 07:41:22 +02:00
8dff4e1012 Remove --all, it's too much 2021-04-25 20:19:58 +02:00
be5d5b88a1 Improve the output 2021-04-25 19:57:19 +02:00
be825c1787 Improve my-profile.ps1 2021-04-25 19:25:00 +02:00
96ff3574c2 Improve list-weather.ps1 2021-04-25 19:20:33 +02:00
1a30fef459 Improve list-credits.ps1 2021-04-25 19:07:02 +02:00
40d9935794 Merge branch 'master' of github.com:fleschutz/PowerShell 2021-04-25 18:51:55 +02:00
c9582b8209 Rename to list-credits.ps1 2021-04-25 18:51:36 +02:00
a9de7630da Add mute and unmute aliases 2021-04-25 10:25:03 +02:00
f1d3bc31ec Improve list-weather.ps1 2021-04-23 13:06:23 +02:00
44414a6135 Improved output of clean-repo.ps1 2021-04-23 09:25:03 +02:00
1f87722c2e Improve upload-file.ps1 2021-04-23 09:11:39 +02:00
c5bb8480f7 Improve switch-branch.ps1 2021-04-23 08:56:09 +02:00
d01aa17c1f Improved my-profile.ps1 2021-04-22 17:46:40 +02:00
b24f7f9b5e Improve my-profile.ps1 2021-04-22 17:40:04 +02:00
8afe073e7e Improved output of list-weather.ps1 2021-04-22 14:06:58 +02:00
ea2c047548 Rename to list-weather.ps1 2021-04-22 10:26:30 +02:00
c46fed2d97 Improved output of sync-repo.ps1 2021-04-22 10:22:29 +02:00
c58b33b7d8 Add max-count to list-news.ps1 2021-04-22 10:13:58 +02:00
6406e4360b Improve output of switch-branch.ps1 2021-04-22 09:55:54 +02:00
1a2abfaf61 Improve output of switch-branch.ps1 2021-04-22 09:47:48 +02:00
f37ada4a70 Improve output of fetch-repos.ps1 2021-04-22 09:31:58 +02:00
67845aaf95 Fix typo 2021-04-22 09:27:23 +02:00
9791fe0c78 Add Git 2021-04-22 09:26:03 +02:00
07fdba4d1d Improve the output 2021-04-22 09:24:19 +02:00
6b66cb1b6c Fixed typo 2021-04-22 09:06:10 +02:00
1cc59bdce8 Improve show-credits.ps1 2021-04-22 09:03:17 +02:00
d9ab4a2fbc Add show-credits.ps1 2021-04-22 08:56:07 +02:00
1a9fdfb337 Fix typo 2021-04-21 20:03:25 +02:00
855251d922 Fix typo 2021-04-21 19:58:27 +02:00
450869a593 Remove the #!/usr/bin/pwsh line 2021-04-21 19:53:52 +02:00
7ab2795778 Improve the cd-*.ps1 scripts 2021-04-21 19:15:41 +02:00
5706a11bdd Add cd-onedrive.ps1 2021-04-21 18:58:21 +02:00
df4db74657 Fix typo in fetch-repos.ps1 2021-04-21 16:47:59 +02:00
b90f8cc67a Fix stop watch 2021-04-21 16:43:08 +02:00
f156c432e0 Fix stop watch 2021-04-21 16:20:49 +02:00
26bdaf68f5 Improve simulate-matrix.ps1 2021-04-21 13:05:41 +02:00
d735015fb8 Improve simulate-matrix.ps1 2021-04-21 13:03:36 +02:00
f170bc831c Improve the output 2021-04-21 12:22:41 +02:00
0c50ee42d5 Improve output of build-repo.ps1 2021-04-21 12:05:53 +02:00
0317186fc7 Improve output of clone-repos.ps1 2021-04-21 11:59:13 +02:00
ee93d55dc1 Improve output of clone-repos.ps1 2021-04-21 11:28:12 +02:00
0c543d5fd7 Add cmatrix 2021-04-21 11:17:43 +02:00
8f5b4a7337 Improve both scripts 2021-04-21 10:54:53 +02:00
59a7e492fe Improve output of play-m3u.ps1 2021-04-21 10:33:38 +02:00
94455bb7c5 Improve output of play-mp3.ps1 2021-04-21 10:14:57 +02:00
e99cf0d32b Change encoding to UTF-8-BOM 2021-04-21 09:20:34 +02:00
e98cae2a85 Improve play-m3u.ps1 2021-04-21 09:03:42 +02:00
506e9b334d Improve create-branch.ps1 2021-04-21 08:57:08 +02:00
2041a385fa Add cd-videos.ps1 2021-04-21 08:22:47 +02:00
96635e4911 Add cd-pics.ps1 2021-04-21 08:18:40 +02:00
01dfa3b83c Add cd-docs.ps1 2021-04-21 08:14:25 +02:00
c556e36e69 Add cd-up2.ps1, cd-up3.ps1 and cd-up4.ps1 2021-04-21 07:47:41 +02:00
91bd47182f Improve cd-up.ps1 2021-04-21 07:39:15 +02:00
2e22ac6c62 Merge branch 'master' of github.com:fleschutz/PowerShell 2021-04-21 07:30:31 +02:00
6daa6a19ca Add cd-up.ps1 2021-04-21 07:29:52 +02:00
dec2cddd39 Fix list-emojis.ps1 2021-04-20 19:32:30 +02:00
ea29869403 Add list-emojis.ps1 2021-04-20 19:26:39 +02:00
89a44fc88f Improve my-profile.ps1 2021-04-20 17:04:52 +02:00
df0696bdfb Improve my-profile.ps1 2021-04-20 17:01:23 +02:00
505b981eb6 Rename to list-dir.ps1 2021-04-20 16:59:34 +02:00
fdd695f136 Improve my-profile.ps1 2021-04-20 16:47:44 +02:00
296ed2a05a Improve list-hourly-weather.ps1 2021-04-20 16:38:04 +02:00
63d5f5c796 Update README.md 2021-04-20 11:06:03 +02:00
6e6348ce7b Update FAQ.md 2021-04-20 11:04:36 +02:00
c16b33c558 Update FAQ.md 2021-04-20 10:59:03 +02:00
abebe6146b Update FAQ.md 2021-04-20 10:48:40 +02:00
f228fb49e5 Update FAQ.md 2021-04-20 10:45:56 +02:00
d1afd6d3c4 Update README.md 2021-04-20 10:38:18 +02:00
32693adfb8 Update README.md 2021-04-20 10:36:11 +02:00
02bea3708f Improve output of list-workdir.ps1 2021-04-20 08:39:57 +02:00
5807a52423 Merge branch 'master' of https://github.com/fleschutz/PowerShell 2021-04-20 08:28:51 +02:00
5526385a7b Improve the output 2021-04-20 08:28:29 +02:00
4130f3657d Update FAQ.md 2021-04-20 08:21:29 +02:00
7a918d799e Fix go-root.ps1 2021-04-20 08:11:57 +02:00
acd26206a0 Nicer output 2021-04-20 08:09:01 +02:00
e9dd4329b0 Improve output of fetch-repo.ps1 and pull-repo.ps1 2021-04-20 08:06:33 +02:00
bb5e5d4b82 Improve clone-repos.ps1 2021-04-19 19:39:52 +02:00
f8eaf73614 Rename to check-weather.ps1 2021-04-19 19:20:49 +02:00
5eaef30837 Improve list-hourly-weather.ps1 2021-04-19 13:56:30 +02:00
cb6679392b Improve list-hourly-weather.ps1 2021-04-19 11:16:43 +02:00
27899b0a2c Add list-hourly-weather.ps1 2021-04-19 11:12:21 +02:00
9ac2dfad35 Improve the output 2021-04-19 09:04:17 +02:00
139e7a4dd9 Improve build-repos.ps1 2021-04-19 08:51:06 +02:00
6678dea5f7 Improve clean-repo.ps1 2021-04-19 08:48:29 +02:00
b078b794e3 Improve list-profiles.ps1 2021-04-18 18:12:19 +02:00
7e476ca1cb Merge branch 'master' of github.com:fleschutz/PowerShell 2021-04-18 17:45:59 +02:00
42512ee54a Add go-desktop.ps1 and go-dropbox.ps1 2021-04-18 17:45:02 +02:00
8e1a552dc2 Improve list-formatted.ps1 2021-04-18 17:29:25 +02:00
f83042c654 Improve the scripts 2021-04-18 13:55:53 +02:00
7ffe1aae95 Improve list-news.ps1 2021-04-18 12:02:37 +02:00
e273ec2d9e Rename to list-city-weather.ps1 2021-04-18 11:39:32 +02:00
fbad5259f7 Add sync-repo.ps1 2021-04-18 11:01:38 +02:00
41ccb7867b Improve the scripts 2021-04-18 10:55:37 +02:00
139ceab42f Merge branch 'master' of github.com:fleschutz/PowerShell 2021-04-18 10:35:02 +02:00
fbec2c8587 Add list-workdir.ps1 2021-04-18 10:34:46 +02:00
567a0a4e69 Improve the output 2021-04-17 20:05:39 +02:00
6f9eb23523 Improve clone-repos.ps1 2021-04-17 20:01:47 +02:00
f78a9390cb Improve the scripts 2021-04-17 18:54:45 +02:00
9aa997ebf5 Rename to list-timezone.ps1 2021-04-17 18:38:38 +02:00
370fe6c7dc Add unicode character 2021-04-17 18:13:23 +02:00
76e6cc1118 Improve the scripts 2021-04-17 17:47:15 +02:00
2030dc3820 Improve my-profile.ps1 2021-04-17 13:12:27 +02:00
bea6e65d49 Improve the scripts 2021-04-17 11:29:32 +02:00
9e1c96d46f Add unicode character 2021-04-17 11:23:41 +02:00
a67bff3cc8 Add unicode character 2021-04-17 09:34:20 +02:00
52d81a2bed Add unicode character 2021-04-16 20:01:38 +02:00
ef5367ed53 Add unicode characters 2021-04-16 19:30:13 +02:00
357ae2cea9 Add unicode characters 2021-04-16 18:58:19 +02:00
46f7fd7b9c Add unicode characters 2021-04-16 18:46:03 +02:00
f43dc498e4 Improve list-dir-tree.ps1 2021-04-16 17:27:13 +02:00
8fe002a867 Fix list-dir-tree.ps1 2021-04-16 17:23:18 +02:00
4de2d69d8f Rename to list-dir-tree.ps1 2021-04-16 17:22:26 +02:00
5694bced66 Improve show-dir-tree.ps1 2021-04-16 17:18:50 +02:00
66131f8157 Merge branch 'master' of github.com:fleschutz/PowerShell 2021-04-16 17:10:05 +02:00
c9d8fb3947 Improve list-formatted.ps1 2021-04-16 17:09:48 +02:00
f4ccf7806f Update FAQ.md 2021-04-16 17:04:19 +02:00
50cabecd57 Add go-repos.ps1 2021-04-16 16:51:46 +02:00
c0d474a674 Update FAQ.md 2021-04-16 16:51:04 +02:00
a7206cb353 Update FAQ.md 2021-04-16 16:43:41 +02:00
a65be7a067 Convert to UTF-8 BOM 2021-04-16 16:31:55 +02:00
1542765c41 Improve the scripts 2021-04-15 16:54:59 +02:00
24fffac7b8 Change to use fetch-repo.ps1 2021-04-15 16:40:10 +02:00
e9c4c6415f Add --jobs=4 to git fetch 2021-04-15 13:47:00 +02:00
55f9c2e19f Improve both scripts 2021-04-15 13:37:42 +02:00
df7cbfab55 Update convert-txt2wav.ps1 2021-04-15 08:52:28 +02:00
e0a8a3b53b Update README.md 2021-04-15 08:46:16 +02:00
2b7b6fdf1a Improve the time measurement 2021-04-15 08:41:37 +02:00
edb2bc56e6 Improve build-repo.ps1 2021-04-15 08:25:20 +02:00
a829a7c92d Improve both scripts 2021-04-14 20:02:04 +02:00
6e5d0d05cb Improve both scripts 2021-04-14 19:23:34 +02:00
a2a0c914fe Add build-repos.ps1 2021-04-14 19:01:47 +02:00
f9a479b0f9 Add build-repo.ps1 2021-04-14 17:50:35 +02:00
980a169bfc Improve the scripts 2021-04-14 16:18:23 +02:00
e3c9ab459e Improve fetch-repos.ps1 and pull-repos.ps1 2021-04-14 16:08:10 +02:00
f8ca4ed78b Rename to convert-txt2wav.ps1 2021-04-14 14:16:15 +02:00
392bfe11f8 Add write-lowercase.ps1 2021-04-14 14:10:43 +02:00
2e5ee3f7eb Update scripts.csv 2021-04-14 14:05:13 +02:00
62741a1fba Improve list-random-passwords.ps1 and list-random-pins.ps1 2021-04-14 13:52:19 +02:00
c5fa0b574d Improve list-random-passwords.ps1 2021-04-14 13:44:59 +02:00
e1951f0089 Add download-file.ps1 and download-dir.ps1 2021-04-14 13:40:04 +02:00
24707fbaca Merge branch 'master' of https://github.com/fleschutz/PowerShell 2021-04-14 13:29:55 +02:00
46b4b6b34f Add folder.jpg 2021-04-14 13:29:34 +02:00
00d65402a9 Improve upload-file.ps1 2021-04-14 10:43:48 +02:00
505c5e35f3 Add upload-file.ps1 2021-04-14 10:23:14 +02:00
992afad02c Add enter-chat.ps1 2021-04-12 18:58:18 +02:00
231e9431da Add missing first line 2021-04-12 12:25:48 +02:00
093bcf7c26 Update README.md 2021-04-10 11:43:16 +02:00
6ec26b78b7 Add list-cheat-sheet.ps1 2021-04-10 11:42:06 +02:00
1d0cae88bb Add search-filename.ps1 2021-04-10 11:07:40 +02:00
330fb1366a Add install-google-chrome.ps1 2021-04-10 10:57:52 +02:00
2536c282bb Add list-mysql-tables.ps1 and list-sql-tables.ps1 2021-04-10 10:51:05 +02:00
d3e82db87a Add convert-sql2csv.ps1 2021-04-10 10:40:03 +02:00
38f7ddb157 Rename to convert-csv2txt.ps1 2021-04-10 10:17:09 +02:00
a73e6d9885 Add convert-mysql2csv.ps1 2021-04-10 10:10:58 +02:00
99197dfc29 Add list-system-info.ps1 2021-04-10 09:52:55 +02:00
27aeeb9806 Improve list-formatted.ps1 and my-profile.ps1 2021-04-10 09:11:56 +02:00
b351e570d9 Add translate-files.ps1 2021-04-09 12:53:22 +02:00
e0204a009b Add ISO 639-1 language codes 2021-04-09 10:32:47 +02:00
bb5bb64827 Improve the scripts 2021-04-08 13:27:03 +02:00
f18ff005f6 Add speak-countdown.ps1 2021-04-08 13:06:38 +02:00
39d253adf3 Update README.md 2021-04-08 12:56:18 +02:00
2ae727019b Improve translate-file.ps1 and translate-text.ps1 2021-04-08 11:19:53 +02:00
b2e571ec15 Add translate-file.ps1 2021-04-08 08:39:13 +02:00
1907062856 Add list-services.ps1 2021-04-07 15:42:56 +02:00
154a753707 Omit the ./ in the syntax metadata 2021-04-07 15:17:49 +02:00
381c3b850f Improve executing other scripts 2021-04-07 14:45:10 +02:00
6cf41e4221 Improve the close- scripts 2021-04-07 14:37:12 +02:00
c65d4455e6 Add open-file-explorer.ps1 2021-04-07 14:12:57 +02:00
777fe6d09e Add admin hint 2021-04-07 13:57:53 +02:00
1841a8a931 Improved the output 2021-04-07 13:55:58 +02:00
ee7fd35b75 Improved my-profile.ps1 2021-04-07 13:42:00 +02:00
2d7eb6f5a4 Merge branch 'master' of github.com:fleschutz/PowerShell 2021-04-07 12:01:33 +02:00
7b5ac5313b Remove clear-host 2021-04-07 12:01:19 +02:00
951242b201 Update FAQ.md 2021-04-07 11:58:57 +02:00
009949ee76 Change to #!/usr/bin/pwsh 2021-04-07 11:53:57 +02:00
958265793c Update FAQ.md 2021-04-07 11:37:16 +02:00
ae17cdef1f Update FAQ.md 2021-04-07 11:36:19 +02:00
590eedbb19 Update FAQ.md 2021-04-07 11:33:14 +02:00
e393ceb329 Update FAQ.md 2021-04-07 11:19:16 +02:00
31d4d2bf2d Update FAQ.md 2021-04-07 11:06:16 +02:00
c4626a57ff Update README.md 2021-04-07 11:03:36 +02:00
663a487e0c Update FAQ.md 2021-04-07 11:03:03 +02:00
52e3ea66a3 Improved check-file-system.ps1 2021-04-05 11:03:12 +02:00
d10466f01c Added check-file-system.ps1 2021-04-05 10:48:34 +02:00
cfbad6f2d7 Improved check-health.ps1 2021-04-04 11:33:57 +02:00
f8b4a31a5e Improved check-cpu-temp.ps1 2021-04-03 17:27:19 +02:00
fae4bad30f Improved my-profile.ps1 2021-04-03 16:14:28 +02:00
dba5880e41 Improved my-profile.ps1 2021-04-03 15:46:30 +02:00
e113db34f4 Improved my-profile.ps1 2021-04-03 15:24:18 +02:00
20c1d4beec Rename to clean-repo.ps1 2021-04-01 14:27:45 +02:00
d0e2939a73 Add create-tag.ps1 2021-04-01 14:20:18 +02:00
49d81b01f2 Improved switch-branch.ps1 2021-04-01 14:10:20 +02:00
f02f1e726b Improve create-branch.ps1 2021-03-31 16:25:46 +02:00
b1c3295c48 Add create-branch.ps1 2021-03-31 15:51:55 +02:00
4cd9a5a4e2 Fix check-ping.ps1 2021-03-30 09:47:21 +02:00
5e1daeea5d Improve check-ping.ps1 2021-03-30 09:43:58 +02:00
25dd316328 Remove domain 2021-03-30 09:36:28 +02:00
2a743d6e63 Improve check-dns-resolution.ps1 2021-03-30 09:34:52 +02:00
3dddcf947b Disable check-windows-system-files.ps1 2021-03-30 09:19:21 +02:00
67f114831d Add check-ping.ps1 2021-03-30 09:06:30 +02:00
3a0daeb85a Improve check-swap-space.ps1 2021-03-30 08:23:51 +02:00
d3b6934da7 Fix file permissions 2021-03-29 19:30:56 +02:00
4a4c074c83 Add edit.ps1 and introduce-powershell.ps1 2021-03-29 19:26:42 +02:00
b4ba271ff2 Improved both scripts 2021-03-29 17:09:59 +02:00
c297f70046 Improved check-dns-resolution.ps1 2021-03-29 16:34:51 +02:00
dbea806772 Improved check-cpu-temp.ps1 2021-03-29 16:21:03 +02:00
3e4abf7b30 Update FAQ.md 2021-03-29 12:40:02 +02:00
a0fd0c984f Merge branch 'master' of https://github.com/fleschutz/PowerShell 2021-03-29 12:21:41 +02:00
8313e34cc1 Improved download.ps1 2021-03-29 12:20:57 +02:00
896e424b28 Update FAQ.md 2021-03-29 11:52:30 +02:00
19d0788e32 Update FAQ.md 2021-03-29 11:51:06 +02:00
2d54d2216b Update FAQ.md 2021-03-29 11:37:02 +02:00
6abed7f4a3 Update FAQ.md 2021-03-29 11:33:47 +02:00
6fdc479d96 Add list-tasks.ps1 2021-03-27 10:02:38 +01:00
0d3f421d3a Add restart mechanism 2021-03-27 09:08:49 +01:00
4d952583fd Update README.md 2021-03-27 09:01:15 +01:00
40081477db Add admin check 2021-03-26 12:44:13 +01:00
3acf39c851 Add enable-ssh-client.ps1 2021-03-25 17:28:16 +01:00
565c45febe Add enable-ssh-server.ps1 2021-03-25 17:24:31 +01:00
8f59a7fd0f Update README.md 2021-03-25 17:09:17 +01:00
1db1f5a0ec Update README.md 2021-03-25 17:07:19 +01:00
39fe061102 Update clean-branch.ps1 2021-03-24 11:46:15 +01:00
f7baec4716 Update clean-branch.ps1 2021-03-24 11:45:30 +01:00
6efc805a7d Replace tabs by spaces in meta header 2021-03-22 20:10:18 +01:00
5d372fc184 Update enable-god-mode.ps1 2021-03-22 19:02:31 +01:00
8590dbcc55 Update both scripts 2021-03-22 18:59:59 +01:00
5af77ba065 Add enable-god-mode.ps1 2021-03-22 18:37:33 +01:00
690c28a4e9 Improved ipfs-server.sh 2021-03-21 11:53:29 +01:00
0813763857 Update daily-tasks.sh 2021-03-20 16:44:17 +01:00
4f95388537 Update check-cpu-temp.ps1 2021-03-20 16:35:40 +01:00
424629ef94 Improve the scripts 2021-03-20 16:32:26 +01:00
6a0e3eb002 Improve the scripts 2021-03-20 16:23:49 +01:00
1fc4d5af0e Add check-cpu-temp.ps1 2021-03-20 16:13:54 +01:00
85d3137b14 Add check-health.ps1 2021-03-20 15:51:03 +01:00
296886b362 Improve check-swap-space.ps1 2021-03-20 15:15:57 +01:00
2a2320603c Improve fetch-repos.ps1 and pull-repos.ps1 2021-03-20 14:36:45 +01:00
c0f1301ac4 Fix file permissions 2021-03-19 17:56:43 +01:00
311b5571a3 Improve list-scripts.ps1 2021-03-19 17:55:20 +01:00
9fad979652 Add pull-repo.ps1 2021-03-19 17:47:07 +01:00
60351adce2 Rename to pull-repos.ps1 2021-03-19 17:43:28 +01:00
5603555d48 Improve list-tags.ps1 2021-03-19 11:36:46 +01:00
d572bf467c Update fetch-repos.ps1 2021-03-19 07:32:43 +01:00
bbc19d1116 Update fetch-repo.ps1 2021-03-19 07:31:35 +01:00
447973357a Merge branch 'master' of https://github.com/fleschutz/PowerShell 2021-03-18 16:59:06 +01:00
e29e0c1c14 Add list-tags.ps1 2021-03-18 16:58:41 +01:00
81098b2627 Update README.md 2021-03-18 12:02:21 +01:00
34d0066163 Update README.md 2021-03-18 11:13:03 +01:00
54d9084c0e Improve error message 2021-03-17 16:33:22 +01:00
673779a2b9 Add git fetch 2021-03-17 10:45:19 +01:00
dd5b74feed Update switch-branch.ps1 2021-03-16 15:44:36 +01:00
556beb2e9e Update list-branches.ps1 and list-commits.ps1 2021-03-16 15:40:49 +01:00
757694029c Update fetch-repo.ps1 and fetch-repos.ps1 2021-03-16 15:35:38 +01:00
480dc16e64 Update cherry-picker.ps1 2021-03-16 15:27:00 +01:00
83aa3ab77f Added cherry-picker.ps1 2021-03-16 14:27:55 +01:00
8d6f38ff40 Update the scripts 2021-03-16 08:45:53 +01:00
153bdabaec Add list-drives.ps1 2021-03-15 17:22:33 +01:00
be123b5af8 Update check-drive-space.ps1 and check-swap-space.ps1 2021-03-15 17:14:33 +01:00
17d4943291 Update check-drive-space.ps1 and check-swap-space.ps1 2021-03-15 16:58:14 +01:00
73f0adffe6 Add check-swap-space.ps1 2021-03-15 16:41:26 +01:00
5cb182921c Update my-profile.ps1 2021-03-15 16:21:59 +01:00
a13800df86 Update my-profile.ps1 2021-03-15 16:11:57 +01:00
cbfec35915 Update my-profile.ps1 2021-03-15 16:05:50 +01:00
c2f7e55177 Update list-commits.ps1 2021-03-15 14:49:11 +01:00
b2a3d9c052 Update fetch-repo.ps1 2021-03-15 14:48:43 +01:00
a234770e97 Update list-branches.ps1 2021-03-15 14:47:58 +01:00
1231ba7f26 Update fetch-repos.ps1 2021-03-15 14:46:08 +01:00
de1b241593 Update fetch-repo.ps1 2021-03-15 14:45:10 +01:00
242da20345 Update the description 2021-03-15 14:00:11 +01:00
27e4dfb3da Update list-commits.ps1 2021-03-15 13:51:55 +01:00
b8042d7368 Merge branch 'master' of https://github.com/fleschutz/PowerShell 2021-03-15 13:44:03 +01:00
ffabb1c8c6 Updated list-branches.ps1 and list-commits.ps1 2021-03-15 13:43:35 +01:00
ae5e4440c3 Update list-commits.ps1 2021-03-15 13:08:38 +01:00
3ce85ad903 Update list-branches.ps1 2021-03-15 13:06:04 +01:00
3485a5c4b8 Update list-branches.ps1 and list-commits.ps1 2021-03-15 13:02:58 +01:00
c1376ed2bb Update list-commits.ps1 2021-03-15 12:46:49 +01:00
8826b75506 Update list-branches.ps1 2021-03-15 12:35:47 +01:00
925e0a1d35 Update README.md 2021-03-15 08:37:52 +01:00
7eea75db52 Update README.md 2021-03-15 08:36:46 +01:00
3af684d749 Add create-shortcut.ps1 2021-03-15 08:06:37 +01:00
8b608c57a2 Add go-root.ps1 2021-03-15 08:00:38 +01:00
01df13393a Updated list-os-release.ps1 2021-03-13 12:32:24 +01:00
d32de25b58 Update README.md 2021-03-13 12:15:29 +01:00
026b81cb9a Improved list-commits.ps1 2021-03-10 16:18:48 +01:00
71d4dff132 Merge branch 'master' of https://github.com/fleschutz/PowerShell 2021-03-10 16:02:07 +01:00
df7587b122 Improved list-commits.ps1 2021-03-10 16:00:16 +01:00
26087b76ae Update fetch-repos.ps1 2021-03-10 15:16:28 +01:00
6fdea381c3 Update fetch-repo.ps1 2021-03-10 15:15:50 +01:00
9d4b5a7b18 Added list-commits.ps1 2021-03-10 11:22:47 +01:00
6fa8ed3a78 Improved both scripts 2021-03-10 10:51:59 +01:00
68711177c5 Updated fetch-repo.ps1 2021-03-10 07:48:24 +01:00
db26503982 Added fetch-repo.ps1 2021-03-10 07:45:21 +01:00
d221ab23bd Improved ipfs-publish.sh 2021-03-08 18:57:00 +01:00
4ae46363dd Update README.md 2021-03-05 12:55:20 +01:00
b42a8ecf70 Update check-symlinks.ps1 2021-03-05 09:09:39 +01:00
242 changed files with 9607 additions and 1847 deletions

31
Data/Abbr/Aviation.csv Normal file
View File

@ -0,0 +1,31 @@
Abbr,Description
AB,Air Base
AC,Aircraft
ACAS,Airborne Collision Avoidance System
AF,Air Field
AFM,Aircraft Flight Manual
AIP,Aeronautical Information Publication
AMAN,Arrival Manager
AOA,Angle of Attack
AOM,Airplane Operating Manual
AOR,Area of Responsibility
AFIS,Aerodrome Flight Information Service
AFM,Airplane Flight Manual
AGL,Above Ground Level
AIP,Aeronautical Information Publication
ANSP,Air Navigation Service Provider
ATA,Actual Time of Arrival
ATIS,Automatic Terminal Information Service
ATO,Air Traffic Organization
BAF,Belgian Air Force
CAAC,Civil Aviation Administration of China
CAAS,Civil Aviation Authorization of Singapore
CANSO,Civil Air Navigation Services Organization (founded 1996, located in Amsterdam)
CAS,Calibrated Airspeed
CAT,Category of aircraft
CAVOK,Ceiling And Visibility OK
COG,Center of Gravity
CRDA,Converging Runway Display Aid
CTA,Controlled Time of Arrival
CTOT,Calculated Take-Off Time
IAS,Indicated Air Speed
Can't render this file because it has a wrong number of fields in line 23.

5843
Data/Abbr/Misc.csv Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,185 @@
alpha2,English
aa,Afar
ab,Abkhazian
ae,Avestan
af,Afrikaans
ak,Akan
am,Amharic
an,Aragonese
ar,Arabic
as,Assamese
av,Avaric
ay,Aymara
az,Azerbaijani
ba,Bashkir
be,Belarusian
bg,Bulgarian
bh,Bihari languages
bi,Bislama
bm,Bambara
bn,Bengali
bo,Tibetan
br,Breton
bs,Bosnian
ca,Catalan; Valencian
ce,Chechen
ch,Chamorro
co,Corsican
cr,Cree
cs,Czech
cu,Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic
cv,Chuvash
cy,Welsh
da,Danish
de,German
dv,Divehi; Dhivehi; Maldivian
dz,Dzongkha
ee,Ewe
el,"Greek, Modern (1453-)"
en,English
eo,Esperanto
es,Spanish; Castilian
et,Estonian
eu,Basque
fa,Persian
ff,Fulah
fi,Finnish
fj,Fijian
fo,Faroese
fr,French
fy,Western Frisian
ga,Irish
gd,Gaelic; Scottish Gaelic
gl,Galician
gn,Guarani
gu,Gujarati
gv,Manx
ha,Hausa
he,Hebrew
hi,Hindi
ho,Hiri Motu
hr,Croatian
ht,Haitian; Haitian Creole
hu,Hungarian
hy,Armenian
hz,Herero
ia,Interlingua (International Auxiliary Language Association)
id,Indonesian
ie,Interlingue; Occidental
ig,Igbo
ii,Sichuan Yi; Nuosu
ik,Inupiaq
io,Ido
is,Icelandic
it,Italian
iu,Inuktitut
ja,Japanese
jv,Javanese
ka,Georgian
kg,Kongo
ki,Kikuyu; Gikuyu
kj,Kuanyama; Kwanyama
kk,Kazakh
kl,Kalaallisut; Greenlandic
km,Central Khmer
kn,Kannada
ko,Korean
kr,Kanuri
ks,Kashmiri
ku,Kurdish
kv,Komi
kw,Cornish
ky,Kirghiz; Kyrgyz
la,Latin
lb,Luxembourgish; Letzeburgesch
lg,Ganda
li,Limburgan; Limburger; Limburgish
ln,Lingala
lo,Lao
lt,Lithuanian
lu,Luba-Katanga
lv,Latvian
mg,Malagasy
mh,Marshallese
mi,Maori
mk,Macedonian
ml,Malayalam
mn,Mongolian
mr,Marathi
ms,Malay
mt,Maltese
my,Burmese
na,Nauru
nb,"Bokmål, Norwegian; Norwegian Bokmål"
nd,"Ndebele, North; North Ndebele"
ne,Nepali
ng,Ndonga
nl,Dutch; Flemish
nn,"Norwegian Nynorsk; Nynorsk, Norwegian"
no,Norwegian
nr,"Ndebele, South; South Ndebele"
nv,Navajo; Navaho
ny,Chichewa; Chewa; Nyanja
oc,Occitan (post 1500)
oj,Ojibwa
om,Oromo
or,Oriya
os,Ossetian; Ossetic
pa,Panjabi; Punjabi
pi,Pali
pl,Polish
ps,Pushto; Pashto
pt,Portuguese
qu,Quechua
rm,Romansh
rn,Rundi
ro,Romanian; Moldavian; Moldovan
ru,Russian
rw,Kinyarwanda
sa,Sanskrit
sc,Sardinian
sd,Sindhi
se,Northern Sami
sg,Sango
si,Sinhala; Sinhalese
sk,Slovak
sl,Slovenian
sm,Samoan
sn,Shona
so,Somali
sq,Albanian
sr,Serbian
ss,Swati
st,"Sotho, Southern"
su,Sundanese
sv,Swedish
sw,Swahili
ta,Tamil
te,Telugu
tg,Tajik
th,Thai
ti,Tigrinya
tk,Turkmen
tl,Tagalog
tn,Tswana
to,Tonga (Tonga Islands)
tr,Turkish
ts,Tsonga
tt,Tatar
tw,Twi
ty,Tahitian
ug,Uighur; Uyghur
uk,Ukrainian
ur,Urdu
uz,Uzbek
ve,Venda
vi,Vietnamese
vo,Volapük
wa,Walloon
wo,Wolof
xh,Xhosa
yi,Yiddish
yo,Yoruba
za,Zhuang; Chuang
zh,Chinese
zu,Zulu
1 alpha2 English
2 aa Afar
3 ab Abkhazian
4 ae Avestan
5 af Afrikaans
6 ak Akan
7 am Amharic
8 an Aragonese
9 ar Arabic
10 as Assamese
11 av Avaric
12 ay Aymara
13 az Azerbaijani
14 ba Bashkir
15 be Belarusian
16 bg Bulgarian
17 bh Bihari languages
18 bi Bislama
19 bm Bambara
20 bn Bengali
21 bo Tibetan
22 br Breton
23 bs Bosnian
24 ca Catalan; Valencian
25 ce Chechen
26 ch Chamorro
27 co Corsican
28 cr Cree
29 cs Czech
30 cu Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic
31 cv Chuvash
32 cy Welsh
33 da Danish
34 de German
35 dv Divehi; Dhivehi; Maldivian
36 dz Dzongkha
37 ee Ewe
38 el Greek, Modern (1453-)
39 en English
40 eo Esperanto
41 es Spanish; Castilian
42 et Estonian
43 eu Basque
44 fa Persian
45 ff Fulah
46 fi Finnish
47 fj Fijian
48 fo Faroese
49 fr French
50 fy Western Frisian
51 ga Irish
52 gd Gaelic; Scottish Gaelic
53 gl Galician
54 gn Guarani
55 gu Gujarati
56 gv Manx
57 ha Hausa
58 he Hebrew
59 hi Hindi
60 ho Hiri Motu
61 hr Croatian
62 ht Haitian; Haitian Creole
63 hu Hungarian
64 hy Armenian
65 hz Herero
66 ia Interlingua (International Auxiliary Language Association)
67 id Indonesian
68 ie Interlingue; Occidental
69 ig Igbo
70 ii Sichuan Yi; Nuosu
71 ik Inupiaq
72 io Ido
73 is Icelandic
74 it Italian
75 iu Inuktitut
76 ja Japanese
77 jv Javanese
78 ka Georgian
79 kg Kongo
80 ki Kikuyu; Gikuyu
81 kj Kuanyama; Kwanyama
82 kk Kazakh
83 kl Kalaallisut; Greenlandic
84 km Central Khmer
85 kn Kannada
86 ko Korean
87 kr Kanuri
88 ks Kashmiri
89 ku Kurdish
90 kv Komi
91 kw Cornish
92 ky Kirghiz; Kyrgyz
93 la Latin
94 lb Luxembourgish; Letzeburgesch
95 lg Ganda
96 li Limburgan; Limburger; Limburgish
97 ln Lingala
98 lo Lao
99 lt Lithuanian
100 lu Luba-Katanga
101 lv Latvian
102 mg Malagasy
103 mh Marshallese
104 mi Maori
105 mk Macedonian
106 ml Malayalam
107 mn Mongolian
108 mr Marathi
109 ms Malay
110 mt Maltese
111 my Burmese
112 na Nauru
113 nb Bokmål, Norwegian; Norwegian Bokmål
114 nd Ndebele, North; North Ndebele
115 ne Nepali
116 ng Ndonga
117 nl Dutch; Flemish
118 nn Norwegian Nynorsk; Nynorsk, Norwegian
119 no Norwegian
120 nr Ndebele, South; South Ndebele
121 nv Navajo; Navaho
122 ny Chichewa; Chewa; Nyanja
123 oc Occitan (post 1500)
124 oj Ojibwa
125 om Oromo
126 or Oriya
127 os Ossetian; Ossetic
128 pa Panjabi; Punjabi
129 pi Pali
130 pl Polish
131 ps Pushto; Pashto
132 pt Portuguese
133 qu Quechua
134 rm Romansh
135 rn Rundi
136 ro Romanian; Moldavian; Moldovan
137 ru Russian
138 rw Kinyarwanda
139 sa Sanskrit
140 sc Sardinian
141 sd Sindhi
142 se Northern Sami
143 sg Sango
144 si Sinhala; Sinhalese
145 sk Slovak
146 sl Slovenian
147 sm Samoan
148 sn Shona
149 so Somali
150 sq Albanian
151 sr Serbian
152 ss Swati
153 st Sotho, Southern
154 su Sundanese
155 sv Swedish
156 sw Swahili
157 ta Tamil
158 te Telugu
159 tg Tajik
160 th Thai
161 ti Tigrinya
162 tk Turkmen
163 tl Tagalog
164 tn Tswana
165 to Tonga (Tonga Islands)
166 tr Turkish
167 ts Tsonga
168 tt Tatar
169 tw Twi
170 ty Tahitian
171 ug Uighur; Uyghur
172 uk Ukrainian
173 ur Urdu
174 uz Uzbek
175 ve Venda
176 vi Vietnamese
177 vo Volapük
178 wa Walloon
179 wo Wolof
180 xh Xhosa
181 yi Yiddish
182 yo Yoruba
183 za Zhuang; Chuang
184 zh Chinese
185 zu Zulu

View File

@ -12,7 +12,6 @@ all-in.de
allgaeuer-zeitung.de
alternate.de
api.dropboxapi.com
api.intelsa.intel.com
api.met.no
api1.origin.com
arc.msn.com

1 Domain
12 allgaeuer-zeitung.de
13 alternate.de
14 api.dropboxapi.com
api.intelsa.intel.com
15 api.met.no
16 api1.origin.com
17 arc.msn.com

View File

@ -1,4 +1,5 @@
URL,Directory
"https://github.com/abishekvashok/cmatrix", "cmatrix"
"https://github.com/commonmark/cmark", "cmark"
"https://github.com/elastic/elasticsearch", "elasticsearch"
"https://github.com/fleschutz/CWTS", "CWTS"
@ -6,6 +7,7 @@ URL,Directory
"https://github.com/fleschutz/LSS", "LSS"
"https://github.com/fleschutz/base256unicode", "base256unicode"
"https://github.com/grafana/grafana", "grafana"
"https://github.com/llvm/llvm-project", "llvm"
"https://github.com/smartmontools/smartmontools", "smartmontools"
"https://github.com/synesthesiam/voice2json", "voice2json"
"https://github.com/TinyCC/tinycc", "tinycc"
1 URL Directory
2 https://github.com/abishekvashok/cmatrix cmatrix
3 https://github.com/commonmark/cmark cmark
4 https://github.com/elastic/elasticsearch elasticsearch
5 https://github.com/fleschutz/CWTS CWTS
7 https://github.com/fleschutz/LSS LSS
8 https://github.com/fleschutz/base256unicode base256unicode
9 https://github.com/grafana/grafana grafana
10 https://github.com/llvm/llvm-project llvm
11 https://github.com/smartmontools/smartmontools smartmontools
12 https://github.com/synesthesiam/voice2json voice2json
13 https://github.com/TinyCC/tinycc tinycc

View File

@ -1,2 +0,0 @@
Time,User,Text
2020-12-24T09:24:30Z,mf,Hello World
1 Time User Text
2 2020-12-24T09:24:30Z mf Hello World

View File

@ -1,13 +1,42 @@
Script,Description
add-firewall-rules.ps1, adds firewall rules to the given executables (requires admin rights)
add-firewall-rules.ps1, adds firewall rules to the given executables (needs admin rights)
add-memo.ps1, adds the given memo text to $HOME/Memos.csv
build-repo.ps1, builds the current/given Git repository
build-repos.ps1, builds all Git repositories under the current/given directory
cd-desktop.ps1, go to the user's desktop folder
cd-docs.ps1, go to the user's documents folder
cd-downloads.ps1, go to the user's downloads folder
cd-dropbox.ps1, go to the user's Dropbox folder
cd-home.ps1, go to the user's home folder
cd-music.ps1, go to the user's music folder
cd-onedrive.ps1, go to the user's OneDrive folder
cd-pics.ps1, go to the user's pictures folder
cd-recycle-bin.ps1, go to the user's recycle bin folder
cd-repos.ps1, go to the user's Git repositories folder
cd-root.ps1, go to the root directory (C: on Windows)
cd-scripts.ps1, go to the PowerShell Scripts folder
cd-up.ps1, go one directory level up
cd-up2.ps1, go two directory levels up
cd-up3.ps1, go three directory levels up
cd-up4.ps1, go four directory levels up
cd-videos.ps1, go to the user's videos folder
check-cpu-temp.ps1, checks the CPU temperature
check-dns-resolution.ps1, checks the DNS resolution with frequently used domain names
check-drive-space.ps1, checks the given drive for free space left
check-file-system.ps1, checks the validity of the file system (needs admin rights)
check-health.ps1, checks the system health
check-ipv4-address.ps1, checks the given IPv4 address for validity
check-ipv6-address.ps1, checks the given IPv6 address for validity
check-mac-address.ps1, checks the given MAC address for validity
check-ping.ps1, checks the ping latency to the internet
check-swap-space.ps1, checks the swap space for free space left
check-symlinks.ps1, checks every symlink in the given directory tree
check-weather.ps1, checks the current weather for critical values
check-windows-system-files.ps1, checks the validity of the Windows system files
check-xml-file.ps1, checks the given XML file for validity
clean-branch.ps1, cleans the current Git branch (including submodules) from generated files
cherry-picker.ps1, cherry-picks a Git commit into multiple branches
clean-repo.ps1, cleans the current/given Git repository from untracked files (including submodules)
clear-recycle-bin.ps1, removes the content of the recycle bin folder (can not be undo!)
clone-repos.ps1, clones well-known Git repositories
close-calculator.ps1, closes the calculator program gracefully
close-chrome.ps1, closes Google Chrome gracefully
@ -20,54 +49,82 @@ close-thunderbird.ps1, closes Mozilla Thunderbird gracefully
close-vlc.ps1, closes the VLC media player gracefully
close-windows-terminal.ps1, closes Windows Terminal gracefully
configure-git.ps1, sets up the Git user configuration
convert-csv2txt.ps1, converts the given CSV file into a text list
convert-mysql2csv.ps1, converts the MySQL database table to a CSV file
convert-sql2csv.ps1, converts the SQL database table to a CSV file
convert-txt2wav.ps1, converts text into a audio .WAV file
create-branch.ps1, creates a new branch in the current/given Git repository
create-shortcut.ps1, creates a shortcut
create-symlink.ps1, creates a symbolic link
csv-to-text.ps1, converts the given CSV file into a text list
create-tag.ps1, creates a new tag in the current/given Git repository
daily-tasks.sh, execute PowerShell scripts automatically as daily tasks (Linux only)
decrypt-file.ps1, decrypts the given file
display-time.ps1, displays the current time for 10 seconds by default
download.ps1, downloads the file/directory from the given URL
download-dir.ps1, downloads a directory tree from the given URL
download-file.ps1, downloads a file from the given URL
edit.ps1, edits the given file with the built-in text editor
enable-crash-dumps.ps1, enables the writing of crash dumps
enable-god-mode.ps1, enables the god mode (adds a new icon to the desktop)
enable-ssh-client.ps1, enables the SSH client (needs admin rights)
enable-ssh-server.ps1, enables the SSH server (needs admin rights)
encrypt-file.ps1, encrypts the given file
fetch-repos.ps1, fetches all Git repositories under the current/given directory (including submodules)
fetch-repo.ps1, fetches updates for the current/given Git repository (including submodules)
fetch-repos.ps1, fetches updates for all Git repositories under the current/given directory (including submodules)
generate-qrcode.ps1, generates a QR code
go-downloads.ps1, go to the user's downloads folder
go-home.ps1, go to the user's home folder
go-music.ps1, go to the user's music folder
go-scripts.ps1, go to the PowerShell Scripts folder
hibernate.ps1, enables hibernate mode for the local computer (requires admin rights)
hibernate.ps1, enables hibernate mode for the local computer (needs admin rights)
inspect-exe.ps1, prints basic information of the given executable file
install-google-chrome.ps1, installs the Google Chrome browser
introduce-powershell.ps1, introduces PowerShell to new users
list-aliases.ps1, lists all PowerShell aliases
list-anagrams.ps1, lists all anagrams of the given word
list-automatic-variables.ps1, lists the automatic variables of PowerShell
list-branches.ps1, lists the branches of the current/given Git repository
list-current-timezone.ps1, lists the current time zone details
list-branches.ps1, lists all branches in the current/given Git repository
list-cheat-sheet.ps1, lists the PowerShell cheat sheet
list-city-weather.ps1, lists the current weather of cities worldwide (east to west)
list-commits.ps1, lists all commits in the current/given Git repository
list-clipboard.ps1, lists the contents of the clipboard
list-credits.ps1, shows the credits
list-dir.ps1, lists the directory content (formatted in columns)
list-dir-tree.ps1, lists the directory tree content
list-drives.ps1, lists all drives
list-environment-variables.ps1, lists all environment variables
list-emojis.ps1, lists the emojis of Unicode 13.0
list-empty-dirs.ps1, lists empty subfolders within the given directory tree
list-empty-files.ps1, lists empty files within the given directory tree
list-files.ps1, lists all files in the given folder and also in every subfolder
list-formatted.ps1, lists the current working directory formatted in columns
list-fritzbox-calls.ps1, lists the FRITZ!Box calls
list-fritzbox-devices.ps1, lists FRITZ!Box's known devices
list-hidden-files.ps1, lists hidden files within the given directory tree
list-installed-apps.ps1, lists the installed Windows Store apps
list-installed-software.ps1, lists the installed software (except Windows Store apps)
list-logbook.ps1, lists the content of the logbook
list-latest-tag.ps1, lists the latest tag on the current branch in a Git repository
list-memos.ps1, lists the memos at $HOME/Memos.csv
list-unused-files.ps1, lists unused files in a directory tree
list-cmdlets.ps1, lists the PowerShell cmdlets
list-earthquakes.ps1, lists earthquakes with magnitude >= 6.0 for the last 30 days
list-modules.ps1, lists the PowerShell modules
list-mysql-tables.ps1, lists the MySQL server tables
list-network-shares.ps1, lists the network shares of the local computer
list-news.ps1, lists the latest news
list-os-releases.ps1, lists OS releases and download URL
list-os-releases.ps1, lists operating system releases and download URL
list-os-updates.ps1, lists operating system updates
list-printers.ps1, lists all printer known to the computer
list-processes.ps1, lists the local computer processes
list-profiles.ps1, lists your PowerShell profiles
list-random-passwords.ps1, prints a list of random passwords
list-random-pins.ps1, prints a list of random PIN's
list-recycle-bin.ps1, lists the content of the recycle bin folder
list-scripts.ps1, lists all PowerShell scripts in this repository
list-services.ps1, lists the services on the local computer
list-sql-tables.ps1, lists the SQL server tables
list-system-info.ps1, lists system information on the local computer
list-tags.ps1, lists all tags in the current/given Git repository
list-tasks.ps1, lists all Windows scheduler tasks
list-timezone.ps1, lists the current time zone details
list-timezones.ps1, lists all time zones available
list-user-groups.ps1, lists the user groups on the local computer
list-weather.ps1, lists the hourly weather
list-workdir.ps1, lists the current working directory
locate-city.ps1, prints the geographic location of the given city
locate-ipaddress.ps1, prints the geographic location of the given IP address
locate-zip-code.ps1, prints the geographic location of the given zip-code
@ -79,18 +136,24 @@ next-joke.ps1], gets the next random Juck Norris joke
open-browser.ps1, starts the default Web browser
open-calculator.ps1, starts the calculator program
open-email-client.ps1, starts the default email client
open-file-explorer.ps1, starts the Microsoft File Explorer
open-recycle-bin.ps1, starts the File Explorer with the recycle bin folder
play-beep.ps1, plays a beep sound
play-files.ps1, plays the given audio files
play-mission-impossible.ps1, plays the Mission Impossible theme
play-m3u.ps1, plays the given playlist (M3U file format)
play-mp3.ps1, plays the given sound file (MP3 file format)
play-super-mario.ps1, plays the Super Mario Intro
play-the-imperial-march.ps1, plays the Imperial March (Star Wars)
poweroff.ps1, halts the local computer (requires admin rights)
poweroff.ps1, halts the local computer (needs admin rights)
pull-repo.ps1, pulls updates for the current/given Git repository (including submodules)
pull-repos.ps1, pulls updates for all Git repositories under the current/given directory (including submodules)
query-smart-data.ps1, queries the S.M.A.R.T. data of your HDD/SSD's and saves it to the current/given directory
new-email.ps1, starts the default email client to write a new email
reboot.ps1, reboots the local computer (requires admin rights)
reboot.ps1, reboots the local computer (needs admin rights)
reboot-fritzbox.ps1, reboots the FRITZ!box device
remove-empty-dirs.ps1, removes empty subfolders within the given directory tree
search-filename.ps1, searches the directory tree for filenames by given pattern
search-files.ps1, searches the given pattern in the given files
scan-ports.ps1, scans the network for open/closed ports
send-email.ps1, sends an email message
@ -101,9 +164,9 @@ set-timer.ps1, sets a timer for a countdown
set-wallpaper.ps1, sets the given image as wallpaper
SHA1.ps1, prints the SHA1 checksum of the given file
SHA256.ps1, prints the SHA256 checksum of the given file
show-dir-tree.ps1, visualizes the given/current directory tree
simulate-matrix.ps1, simulates the Matrix (fun)
simulate-presence.ps1, simulates the human presence against burglars
speak-countdown.ps1, starts a countdown by text-to-speech (TTS)
speak-date.ps1, speaks the current date by text-to-speech (TTS)
speak-english.ps1, speaks the given text with an English text-to-speech (TTS) voice
speak-epub.ps1, speaks the content of the given Epub file by text-to-speech (TTS)
@ -113,29 +176,29 @@ speak-joke.ps1, speaks the next joke by text-to-speech (TTS)
speak-test.ps1, performs a speak test by text-to-speech (TTS)
speak-text.ps1, speaks the given text by text-to-speech (TTS)
speak-time.ps1, speaks the current time by text-to-speech (TTS)
switch-branch.ps1, switches the current Git repository to the given branch (including submodules)
switch-branch.ps1, switches the branch in the current/given Git repository (including submodules)
switch-shelly1.ps1, switches a Shelly1 device in the local network
sync-repo.ps1, synchronizes a Git repository by push & pull (including submodules)
take-screenshot.ps1, takes a single screenshot
take-screenshots.ps1, takes multiple screenshots
train-dns-cache.ps1, trains the DNS cache with frequently used domain names
translate-file.ps1, translates the given text file into another language
translate-files.ps1, translates the given text files into any supported language
translate-text.ps1, translates the given text into other languages
turn-volume-up.ps1, turns the audio volume up (+10% by default)
turn-volume-down.ps1, turns the audio volume down (-10% by default)
txt2wav.ps1, converts text into a audio .WAV file
unmute-audio.ps1, unmutes audio
update-repos.ps1, updates all Git repositories under the current/given directory (including submodules)
upload-file.ps1, uploads the local file to the given FTP server
voice-control.ps1, executes the PowerShell scripts by voice
weather.ps1, prints the current weather forecast
weather-alert.ps1, checks the current weather for critical values
weather-report.ps1, prints the local weather report
weather-worldwide.ps1, prints the current weather of cities worldwide
wakeup.ps1, sends a magic packet to the given computer, waking him up
weather.ps1, prints the current weather forecast
weather-report.ps1, prints the local weather report
what-is.ps1, prints a description of the given abbreviation
write-animated.ps1, writes animated text
write-big.ps1, writes the given text in big letters
write-blue.ps1, writes the given text in a blue foreground color
write-braille.ps1, writes the given text in Braille
write-green.ps1, writes the given text in a green foreground color
write-logbook.ps1, writes the given text to the logbook
write-lowercase.ps1, writes the given text in lowercase letters
write-marquee.ps1, writes the given text as marquee
write-morse-code.ps1, writes the given text in Morse code
write-motd.ps1, writes the message of the day (MOTD)

Can't render this file because it has a wrong number of fields in line 192.

View File

@ -1,54 +1,52 @@
PowerShell Scripts FAQ
======================
PowerShell FAQ
==============
What is PowerShell?
-------------------
PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language.
Why use PowerShell?
-------------------
* **it's powerful**: fully control your computer
* **it's cross-platform**: available for Linux, Mac OS and Windows
* **it's open-source**: see the Github repository at https://github.com/PowerShell/PowerShell
* **it's open-source and free**: see the Github repository at https://github.com/PowerShell/PowerShell
* **it's easy to learn**: see the tutorial at https://www.guru99.com/powershell-tutorial.html
* **it's fully documented**: see the official docs at https://docs.microsoft.com/en-us/powershell/
How to get PowerShell?
----------------------
* **Windows 7 and newer** do provide PowerShell by default. However, script execution is **not allowed by default** (execution policy is "restricted"). To enable this, enter as administrator:
* **On Windows 7 and newer** PowerShell is provided by default. However, script execution is **not allowed by default** (execution policy is "restricted"). To enable this, enter as administrator:
```
$ Set-ExecutionPolicy RemoteSigned
```
* **On CentOS, Debian, Docker, Fedora, macOS, openSUSE, Red Hat, Ubuntu** visit https://github.com/PowerShell/PowerShell for installation.
* **Want to use Snaps?** Install the PowerShell snap by executing:
```
$ snap install PowerShell
$ ln -s /snap/bin/powershell /bin/powershell
$ ln -s /snap/bin/pwsh /usr/bin/pwsh
```
* **On CentOS, Debian, Docker, Fedora, macOS, openSUSE, Red Hat, Ubuntu** visit https://github.com/PowerShell/PowerShell for installation.
How to get the PowerShell Scripts?
----------------------------------
Git users do execute:
```
$ git clone https://github.com/fleschutz/PowerShell
```
* Git users execute: `$ git clone https://github.com/fleschutz/PowerShell`
* otherwise download it from: https://github.com/fleschutz/PowerShell/archive/master.zip
otherwise simply download it from:
https://github.com/fleschutz/PowerShell/archive/master.zip
Some Scripts show gibberish characters. How to fix that?
--------------------------------------------------------
The PowerShell scripts support Unicode input & output! Use a modern console supporting UTF-8 such as Windows Terminal.
How to Configure PowerShell as Default Shell?
---------------------------------------------
* **Linux:** make sure PowerShell is installed, then execute: `chsh -s /bin/powershell <username>`
* **Windows:** no need to, PowerShell is the default shell
How to set PowerShell as Default Shell on Linux?
------------------------------------------------
Make sure PowerShell is installed, then execute: `chsh -s /usr/bin/pwsh <username>`. In case you experience an "invalid shell" error, add "/usr/bin/pwsh" to /etc/shells.
How to add the Scripts to the Search Path?
------------------------------------------
Want to use the PowerShell scripts everywhere on the command-line? Then you need to add the Scripts/ subfolder to the search path:
* **Bash or sh:** edit .profile in your home directory and add the line: PATH="$PATH:/path/to/PowerShell/Scripts"
* **Windows:** open the environment variables dialogue and add the full path to Scripts/ to the system environment variable "Path"
* **On Linux using Bash:** edit .profile in your home directory and add the line: PATH="$PATH:/path/to/PowerShell/Scripts"
* **On Windows:** open the environment variables dialogue and add the full path to Scripts/ to the system environment variable "Path"
How to use PowerShell in Context Menus?
@ -57,22 +55,22 @@ How to use PowerShell in Context Menus?
* to disable this execute `Remove_ps1_from_New_context_menu.reg` in subfolder [Misc/](Misc)
How to edit PowerShell Scripts?
-------------------------------
* use your favorite text editor
* use Visual Studio Code (available for free) - providing syntax highlighting, on-the-fly problem checking and an integrated PowerShell Console.
How to edit the PowerShell Scripts?
-----------------------------------
* use *PowerShell ISE* (Integrated Scripting Environment) to write, test and debug scripts (available for free on Windows only).
* use *Visual Studio Code* supporting syntax highlighting, on-the-fly problem checking and an integrated PowerShell Console (available for free on Linux, Mac OS and Windows).
* or simply use your *favorite text editor*
How to write good PowerShell Scripts?
-------------------------------------
Each PowerShell script should follow the 10 golden rules:
Good PowerShell scripts are user-friendly and platform-independant. As a guideline follow these rules, please:
1. the filename should be named `<verb>-<object>.ps1`
2. the first line reads `#!/bin/powershell` (to support Linux)
3. the script has execute file permissions: chmod a+rx <file> (to support Linux)
1. the filename is named using the `<verb>-<object>.ps1` scheme
2. the encoding is UTF-8-BOM to support and use Unicode characters (including emojis where appropriate)
3. the script has execute file permissions: chmod a+rx <file> (for Linux support)
4. provide a comment-based help with syntax, description, link, author, and license
5. check the requirements (e.g. #Requires -RunAsAdministrator, or #Requires -Version 3)
6. prefer command-line options, else ask the user
6. prefer command-line options, else ask the user for help
7. recommended is `Set-StrictMode -Version Latest` to enable additional error checking
8. for readibility use UpperCamelCase for variables and functions, lowerCamelCase for everything else
9. on error call write-error with keyword "ERROR:" (to support log parsers) and exit the error code (mostly 1)

151
README.md
View File

@ -1,17 +1,22 @@
Collection of PowerShell Scripts
================================
Mega Collection of PowerShell Scripts
=====================================
**This repository contains 140+ useful and cross-platform PowerShell scripts in the [Scripts/ folder](Scripts/) - to be used by command-line interface (CLI), for remote control (RC), by context menu, by voice control, by automation software like Jenkins, automatically as daily tasks, or simply to learn PowerShell. See the [FAQ page](Misc/FAQ.md) if you need help or have any questions.**
**This repository provides more than 200 useful and cross-platform PowerShell scripts in the subfolder [Scripts/](Scripts/) - to be used by command-line interface (CLI), for remote control (e.g. via SSH), by context menu, by voice control, by automation software like Jenkins, automatically as daily tasks, or simply to learn PowerShell. See the [PowerShell FAQ page](Misc/FAQ.md) if you need help or have any questions.**
Scripts for Audio & Voice 🔊
---------------------------
**NOTE:** the scripts support Unicode input & output! Please use a modern console supporting UTF-8 such as Windows Terminal
🔊 PowerShell Scripts for Audio & Voice
----------------------------------------
* [convert-txt2wav.ps1](Scripts/convert-txt2wav.ps1) - converts text to a .WAV audio file
* [mute-audio.ps1](Scripts/mute-audio.ps1) - mutes audio
* [play-beep.ps1](Scripts/play-beep.ps1) - plays a beep sound
* [play-files.ps1](Scripts/play-files.ps1) - plays the given audio files
* [play-mission-impossible.ps1](Scripts/play-mission-impossible.ps1) - plays the Mission Impossible theme
* [play-m3u.ps1](Scripts/play-m3u.ps1) - plays the given playlist (M3U file format)
* [play-mp3.ps1](Scripts/play-mp3.ps1) - plays the given sound file (MP3 file format)
* [play-super-mario.ps1](Scripts/play-super-mario.ps1) - plays the Super Mario Intro
* [play-the-imperial-march.ps1](Scripts/play-the-imperial-march.ps1) - plays the Imperial March (Star Wars)
* [speak-countdown.ps1](Scripts/speak-countdown.ps1) - starts a countdown by text-to-speech (TTS)
* [speak-date.ps1](Scripts/speak-date.ps1) - speaks the current date by text-to-speech (TTS)
* [speak-english.ps1](Scripts/speak-english.ps1) - speaks the given text with an English text-to-speech (TTS) voice
* [speak-epub.ps1](Scripts/speak-epub.ps1) - speaks the content of the given Epub file by text-to-speech (TTS)
@ -21,34 +26,46 @@ Scripts for Audio & Voice 🔊
* [speak-test.ps1](Scripts/speak-test.ps1) - performs a speak test by text-to-speech (TTS)
* [speak-text.ps1](Scripts/speak-text.ps1) - speaks the given text by text-to-speech (TTS)
* [speak-time.ps1](Scripts/speak-time.ps1) - speaks the current time by text-to-speech (TTS)
* [txt2wav.ps1](Scripts/txt2wav.ps1) - converts text into a audio .WAV file
* [turn-volume-up.ps1](Scripts/turn-volume-up.ps1) - turns the audio volume up (+10% by default)
* [turn-volume-down.ps1](Scripts/turn-volume-down.ps1) - turns the audio volume down (-10% by default)
* [unmute-audio.ps1](Scripts/unmute-audio.ps1) - unmutes audio
* [voice-control.ps1](Scripts/voice-control.ps1) - executes the PowerShell scripts by voice
Scripts for Computer Management ⚙️
---------------------------------
* [add-firewall-rules.ps1](Scripts/add-firewall-rules.ps1) - adds firewall rules for the given executables (requires admin rights)
⚙️ PowerShell Scripts for Computer Management
----------------------------------------------
* [add-firewall-rules.ps1](Scripts/add-firewall-rules.ps1) - adds firewall rules for the given executables (needs admin rights)
* [check-cpu-temp.ps1](Scripts/check-cpu-temp.ps1) - checks the CPU temperature
* [check-dns-resolution.ps1](Scripts/check-dns-resolution.ps1) - checks the DNS resolution with frequently used domain names
* [check-drive-space.ps1](Scripts/check-drive-space.ps1) - checks the given drive for free space left
* [check-windows-system-files.ps1](Scripts/check-windows-system-files.ps1) - checks the validity of the Windows system files
* [check-file-system.ps1](Scripts/check-file-system.ps1) - checks the validity of the file system (needs admin rights)
* [check-health.ps1](Scripts/check-health.ps1) - checks the system health
* [check-ping.ps1](Scripts/check-ping.ps1) - checks the ping latency to the internet
* [check-swap-space.ps1](Scripts/check-swap-space.ps1) - checks the swap space for free space left
* [check-windows-system-files.ps1](Scripts/check-windows-system-files.ps1) - checks the validity of the Windows system files (needs admin rights)
* [enable-crash-dumps.ps1](Scripts/enable-crash-dumps.ps1) - enables the writing of crash dumps
* [hibernate.ps1](Scripts/hibernate.ps1) - enables hibernate mode for the local computer (requires admin rights)
* [enable-ssh-client.ps1](Scripts/enable-ssh-client.ps1) - enables the SSH client (needs admin rights)
* [enable-ssh-server.ps1](Scripts/enable-ssh-server.ps1) - enables the SSH server (needs admin rights)
* [hibernate.ps1](Scripts/hibernate.ps1) - enables hibernate mode for the local computer (needs admin rights)
* [install-google-chrome.ps1](Scripts/install-google-chrome.ps1) - installs the Google Chrome browser
* [list-drives.ps1](Scripts/list-drives.ps1) - lists all drives
* [list-network-shares.ps1](Scripts/list-network-shares.ps1) - lists the network shares of the local computer
* [list-current-timezone.ps1](Scripts/list-current-timezone.ps1) - lists the current time zone details
* [list-installed-apps.ps1](Scripts/list-installed-apps.ps1) - lists the installed Windows Store apps
* [list-installed-software.ps1](Scripts/list-installed-software.ps1) - lists the installed software (except Windows Store apps)
* [list-printers.ps1](Scripts/list-printers.ps1) - lists all printer known to the computer
* [list-processes.ps1](Scripts/list-processes.ps1) - lists the local computer processes
* [list-services.ps1](Scripts/list-services.ps1) - lists the services on the local computer
* [list-system-info.ps1](Scripts/list-system-info.ps1) - lists system information on the local computer
* [list-tasks.ps1](Scripts/list-tasks.ps1) - lists all Windows scheduler tasks
* [list-timezone.ps1](Scripts/list-timezone.ps1) - lists the current time zone details
* [list-timezones.ps1](Scripts/list-timezones.ps1) - lists all time zones available
* [list-user-groups.ps1](Scripts/list-user-groups.ps1) - lists the user groups on the local computer
* [poweroff.ps1](Scripts/poweroff.ps1) - halts the local computer (requires admin rights)
* [poweroff.ps1](Scripts/poweroff.ps1) - halts the local computer (needs admin rights)
* [query-smart-data.ps1](Scripts/query-smart-data.ps1) - queries the S.M.A.R.T. data of your HDD/SSD's
* [reboot.ps1](Scripts/reboot.ps1) - reboots the local computer (requires admin rights)
* [reboot.ps1](Scripts/reboot.ps1) - reboots the local computer (needs admin rights)
* [wakeup.ps1](Scripts/wakeup.ps1) - sends a magic packet to the given computer, waking him up
Scripts for the Desktop 💻
-------------------------
💻 PowerShell Scripts for the Desktop
--------------------------------------
* [close-calculator.ps1](Scripts/close-calculator.ps1) - closes the calculator program gracefully
* [close-chrome.ps1](Scripts/close-chrome.ps1) - closes Google Chrome gracefully
* [close-cortana.ps1](Scripts/close-cortana.ps1) - closes Cortana gracefully
@ -59,82 +76,130 @@ Scripts for the Desktop 💻
* [close-thunderbird.ps1](Scripts/close-thunderbird.ps1) - closes Mozilla Thunderbird gracefully
* [close-vlc.ps1](Scripts/close-vlc.ps1) - closes the VLC media player gracefully
* [close-windows-terminal.ps1](Scripts/close-windows-terminal.ps1) - closes Windows Terminal gracefully
* [enable-god-mode.ps1](Scripts/enable-god-mode.ps1) - enables the god mode (adds a new icon to the desktop)
* [list-clipboard.ps1](Scripts/list-clipboard.ps1) - lists the contents of the clipboard
* [new-email.ps1](Scripts/new-email.ps1) - starts the default email client to write a new email
* [open-browser.ps1](Scripts/open-browser.ps1) - starts the default Web browser
* [open-calculator.ps1](Scripts/open-calculator.ps1) - starts the calculator program
* [open-email-client.ps1](Scripts/open-browser.ps1) - starts the default email client
* [open-file-explorer.ps1](Scripts/open-file-explorer.ps1) - starts the File Explorer
* [open-recycle-bin.ps1](Scripts/open-recycle-bin.ps1) - starts the File Explorer with the recycle bin folder
* [set-wallpaper.ps1](Scripts/set-wallpaper.ps1) - sets the given image as wallpaper
* [take-screenshot.ps1](Scripts/take-screenshot.ps1) - takes a single screenshot
* [take-screenshots.ps1](Scripts/take-screenshots.ps1) - takes multiple screenshots (every minute by default)
Scripts for Files & Folders 📁
-----------------------------
📁 PowerShell Scripts for Files & Folders
------------------------------------------
* [clear-recycle-bin.ps1](Scripts/clear-recycle-bin.ps1) - removes the content of the recycle bin folder (can not be undo!)
* [cd-desktop.ps1](Scripts/cd-desktop.ps1) - go to the user's desktop folder
* [cd-docs.ps1](Scripts/cd-docs.ps1) - go to the user's documents folder
* [cd-downloads.ps1](Scripts/cd-downloads.ps1) - go to the user's downloads folder
* [cd-dropbox.ps1](Scripts/cd-dropbox.ps1) - go to the user's Dropbox folder
* [cd-home.ps1](Scripts/cd-home.ps1) - go to the user's home folder
* [cd-music.ps1](Scripts/cd-music.ps1) - go to the user's music folder
* [cd-onedrive.ps1](Scripts/cd-onedrive.ps1) - go to the user's OneDrive folder
* [cd-pics.ps1](Scripts/cd-pics.ps1) - go to the user's pictures folder
* [cd-recycle-bin.ps1](Scripts/cd-recycle-bin.ps1) - go to the user's recycle bin folder
* [cd-repos.ps1](Scripts/cd-repos.ps1) - go to the user's Git repositories folder
* [cd-root.ps1](Scripts/cd-root.ps1) - go to the root directory (C:\ on Windows)
* [cd-scripts.ps1](Scripts/cd-scripts.ps1) - go to the PowerShell Scripts folder
* [cd-up.ps1](Scripts/cd-up.ps1) - go one directory level up
* [cd-up2.ps1](Scripts/cd-up2.ps1) - go two directory levels up
* [cd-up3.ps1](Scripts/cd-up3.ps1) - go three directory levels up
* [cd-up4.ps1](Scripts/cd-up4.ps1) - go four directory levels up
* [cd-videos.ps1](Scripts/cd-videos.ps1) - go to the user's videos folder
* [check-symlinks.ps1](Scripts/check-symlinks.ps1) - checks every symlink in the given directory tree
* [check-xml-file.ps1](Scripts/check-xml-file.ps1) - checks the given XML file for validity
* [create-shortcut.ps1](Scripts/create-shortcut.ps1) - creates a shortcut
* [create-symlink.ps1](Scripts/create-symlink.ps1) - creates a symbolic link
* [decrypt-file.ps1](Scripts/decrypt-file.ps1) - encrypts the given file
* [download-dir.ps1](Scripts/download-dir.ps1) - downloads a directory tree from the given URL
* [download-file.ps1](Scripts/download-file.ps1) - downloads a file from the given URL
* [edit.ps1](Scripts/edit.ps1) - edits the given file with the built-in text editor
* [encrypt-file.ps1](Scripts/encrypt-file.ps1) - encrypts the given file
* [go-downloads.ps1](Scripts/go-downloads.ps1) - go to the user's downloads folder
* [go-home.ps1](Scripts/go-home.ps1) - go to the user's home folder
* [go-music.ps1](Scripts/go-music.ps1) - go to the user's music folder
* [go-scripts.ps1](Scripts/go-scripts.ps1) - go to the PowerShell Scripts folder
* [inspect-exe.ps1](Scripts/inspect-exe.ps1) - prints basic information of the given executable file
* [list-dir.ps1](Scripts/list-dir.ps1) - lists the directory content (formatted in columns)
* [list-dir-tree.ps1](Scripts/list-dir-tree.ps1) - lists the directory tree content
* [list-empty-dirs.ps1](Scripts/list-empty-dirs.ps1) - lists empty subfolders within the given directory tree
* [list-empty-files.ps1](Scripts/list-empty-files.ps1) - lists empty files within the given directory tree
* [list-files.ps1](Scripts/list-files.ps1) - lists all files in the given folder and also in every subfolder
* [list-formatted.ps1](Scripts/list-formatted.ps1) - lists the current working directory formatted in columns
* [list-hidden-files.ps1](Scripts/list-hidden-files.ps1) - lists hidden files within the given directory tree
* [list-recycle-bin.ps1](Scripts/list-recycle-bin.ps1) - lists the content of the recycle bin folder
* [list-unused-files.ps1](Scripts/list-unused-files.ps1) - lists unused files in a directory tree
* [list-workdir.ps1](Scripts/list-workdir.ps1) - lists the current working directory
* [make-install.ps1](Scripts/make-install.ps1) - installs built executables and libs to the installation directory
* [MD5.ps1](Scripts/MD5.ps1) - prints the MD5 checksum of the given file
* [remove-empty-dirs.ps1](Scripts/remove-empty-dirs.ps1) - removes empty subfolders within the given directory tree
* [search-filename.ps1](Scripts/search-filename.ps1) - searches the directory tree for filenames by given pattern
* [search-files.ps1](Scripts/search-files.ps1) - searches the given pattern in the given files
* [SHA1.ps1](Scripts/SHA1.ps1) - prints the SHA1 checksum of the given file
* [SHA256.ps1](Scripts/SHA256.ps1) - prints the SHA256 checksum of the given file
* [show-dir-tree.ps1](Scripts/show-dir-tree.ps1) - visualizes the given/current directory tree
* [upload-file.ps1](Scripts/zip-dir.ps1) - uploads the local file to the given FTP server
* [zip-dir.ps1](Scripts/zip-dir.ps1) - creates a zip archive of the given directory
Scripts for Git 📝
-----------------
* [clean-branch.ps1](Scripts/clean-branch.ps1) - cleans the current Git branch (including submodules) from generated files
📝 PowerShell Scripts for Git
------------------------------
* [build-repo.ps1](Scripts/build-repo.ps1) - builds the current/given Git repository
* [build-repos.ps1](Scripts/build-repos.ps1) - builds all Git repositories under the current/given directory
* [cherry-picker.ps1](Scripts/cherry-picker.ps1) - cherry-picks a Git commit into multiple branches
* [clean-repo.ps1](Scripts/clean-repo.ps1) - cleans the current/given Git repository from untracked files (including submodules)
* [clone-repos.ps1](Scripts/clone-repos.ps1) - clones well-known Git repositories
* [configure-git.ps1](Scripts/configure-git.ps1) - sets up the Git user configuration
* [fetch-repos.ps1](Scripts/fetch-repos.ps1) - fetches all Git repositories under the current/given directory (including submodules)
* [list-branches.ps1](Scripts/list-branches.ps1) - lists the branches of the current/given Git repository
* [switch-branch.ps1](Scripts/switch-branch.ps1) - switches the current Git repository to the given branch (including submodules)
* [update-repos.ps1](Scripts/update-repos.ps1) - updates all Git repositories under the current/given directory (including submodules)
* [create-branch.ps1](Scripts/create-branch.ps1) - creates a new branch in the current/given Git repository
* [create-tag.ps1](Scripts/create-tag.ps1) - creates a new tag in the current/given Git repository
* [fetch-repo.ps1](Scripts/fetch-repo.ps1) - fetches updates for the current/given Git repository (including submodules)
* [fetch-repos.ps1](Scripts/fetch-repos.ps1) - fetches updates for all Git repositories under the current/given directory (including submodules)
* [list-branches.ps1](Scripts/list-branches.ps1) - lists all branches in the current/given Git repository
* [list-commits.ps1](Scripts/list-commits.ps1) - lists all commits in the current/given Git repository
* [list-latest-tag.ps1](Scripts/list-latest-tag.ps1) - lists the latest tag on the current branch in a Git repository
* [list-tags.ps1](Scripts/list-tags.ps1) - lists all tags in the current/given Git repository
* [pull-repo.ps1](Scripts/pull-repo.ps1) - pulls updates for the current/given Git repository (including submodules)
* [pull-repos.ps1](Scripts/pull-repos.ps1) - pulls updates for all Git repositories under the current/given directory (including submodules)
* [switch-branch.ps1](Scripts/switch-branch.ps1) - switches the branch in the current/given Git repository (including submodules)
* [sync-repo.ps1](Scripts/sync-repo.ps1) - synchronizes a Git repository by push & pull (including submodules)
Scripts for PowerShell 🔎
🔎 Scripts for PowerShell
------------------------
* [daily-tasks.sh](Scripts/daily-tasks.sh) - execute PowerShell scripts automatically as daily tasks (Linux only)
* [introduce-powershell.sh](Scripts/introduce-powershell.sh) - introduces PowerShell to new users
* [list-aliases.ps1](Scripts/list-aliases.ps1) - lists all PowerShell aliases
* [list-automatic-variables.ps1](Scripts/list-automatic-variables.ps1) - lists the automatic variables of PowerShell
* [list-cheat-sheet.ps1](Scripts/list-cheat-sheet.ps1) - lists the PowerShell cheat sheet
* [list-cmdlets.ps1](Scripts/list-cmdlets.ps1) - lists the PowerShell cmdlets
* [list-modules.ps1](Scripts/list-modules.ps1) - lists the PowerShell modules
* [list-profiles.ps1](Scripts/list-profiles.ps1) - lists your PowerShell profiles
* [list-scripts.ps1](Scripts/list-scripts.ps1) - lists all PowerShell scripts in this repository
* [set-profile.ps1](Scripts/set-profile.ps1) - updates your PowerShell user profile
Various Scripts 🛒
-----------------
🛒 Various PowerShell Scripts
------------------------------
* [add-memo.ps1](Scripts/add-memo.ps1) - adds the given memo text to $HOME/Memos.csv
* [check-ipv4-address.ps1](Scripts/check-ipv4-address.ps1) - checks the given IPv4 address for validity
* [check-ipv6-address.ps1](Scripts/check-ipv6-address.ps1) - checks the given IPv6 address for validity
* [check-mac-address.ps1](Scripts/check-mac-address.ps1) - checks the given MAC address for validity
* [csv-to-text.ps1](Scripts/csv-to-text.ps1) - converts the given CSV file into a text list
* [check-weather.ps1](Scripts/check-weather.ps1) - checks the current weather for critical values
* [convert-csv2txt.ps1](Scripts/convert-csv2txt.ps1) - converts the given CSV file to a text list
* [convert-mysql2csv.ps1](Scripts/convert-mysql2csv.ps1) - converts the MySQL database table to a CSV file
* [convert-sql2csv.ps1](Scripts/convert-sql2csv.ps1) - converts the SQL database table to a CSV file
* [display-time.ps1](Scripts/display-time.ps1) - displays the current time for 10 seconds by default
* [download.ps1](Scripts/download.ps1) - downloads the file/directory from the given URL
* [generate-qrcode.ps1](Scripts/generate-qrcode.ps1) - generates a QR code
* [list-anagrams.ps1](Scripts/list-anagrams.ps1) - lists all anagrams of the given word
* [list-city-weather.ps1](Scripts/list-city-weather.ps1) - lists the current weather of cities worldwide (west to east)
* [list-credits.ps1](Scripts/list-credits.ps1) - shows the credits
* [list-environment-variables.ps1](Scripts/list-environment-variables.ps1) - lists all environment variables
* [list-emojis.ps1](Scripts/list-emojis.ps1) - lists the emojis of Unicode 13.0
* [list-fritzbox-calls.ps1](Scripts/list-fritzbox-calls.ps1) - lists the FRITZ!Box calls
* [list-fritzbox-devices.ps1](Scripts/list-fritzbox-devices.ps1) - lists FRITZ!Box's known devices
* [list-logbook.ps1](Scripts/list-logbook.ps1) - lists the content of the logbook
* [list-earthquakes.ps1](Scripts/list-earthquakes.ps1) - lists earthquakes with magnitude >= 6.0 for the last 30 days
* [list-memos.ps1](Scripts/list-memos.ps1) - lists the memos at $HOME/Memos.csv
* [list-mysql-tables.ps1](Scripts/list-mysql-tables.ps1) - lists the MySQL server tables
* [list-news.ps1](Scripts/list-news.ps1) - lists the latest news
* [list-os-releases.ps1](Scripts/list-os-releases.ps1) - lists OS releases and download URL
* [list-os-releases.ps1](Scripts/list-os-releases.ps1) - lists operating system releases and download URL
* [list-os-updates.ps1](Scripts/list-os-updates.ps1) - lists operating system updates
* [list-random-passwords.ps1](Scripts/list-random-passwords.ps1) - prints a list of random passwords
* [list-random-pins.ps1](Scripts/list-random-pins.ps1) - prints a list of random PIN's
* [list-sql-tables.ps1](Scripts/list-sql-tables.ps1) - lists the SQL server tables
* [list-weather.ps1](Scripts/list-weather.ps1) - lists the hourly weather
* [locate-city.ps1](Scripts/locate-city.ps1) - prints the geographic location of the given city
* [locate-ipaddress.ps1](Scripts/locate-ipaddress.ps1) - prints the geographic location of the given IP address
* [locate-zip-code.ps1](Scripts/locate-zip-code.ps1) - prints the geographic location of the given zip-code
@ -149,18 +214,18 @@ Various Scripts 🛒
* [simulate-matrix.ps1](Scripts/simulate-matrix.ps1) - simulates the Matrix (fun)
* [simulate-presence.ps1](Scripts/simulate-presence.ps1) - simulates the human presence against burglars
* [switch-shelly1.ps1](Scripts/switch-shelly1.ps1) - switches a Shelly1 device in the local network
* [train-dns-cache.ps1](Scripts/train-dns-cache.ps1) - trains the DNS cache with frequently used domain names
* [translate-text.ps1](Scripts/translate-text.ps1) - translates the given text into other languages
* [translate-file.ps1](Scripts/translate-file.ps1) - translates the given text file into other languages
* [translate-files.ps1](Scripts/translate-files.ps1) - translates the given text files into any supported language
* [translate-text.ps1](Scripts/translate-text.ps1) - translates the given text in English into other languages
* [weather.ps1](Scripts/weather.ps1) - prints the current weather forecast
* [weather-alert.ps1](Scripts/weather-alert.ps1) - checks the current weather for critical values
* [weather-report.ps1](Scripts/weather-report.ps1) - prints the local weather report
* [weather-worldwide.ps1](Scripts/weather-worldwide.ps1) - prints the current weather of cities worldwide
* [what-is.ps1](Scripts/what-is.ps1) - prints a description of the given abbreviation
* [write-animated.ps1](Scripts/write-animated.ps1) - writes animated text
* [write-big.ps1](Scripts/write-big.ps1) - writes the given text in big letters
* [write-blue.ps1](Scripts/write-blue.ps1) - writes the given text in a blue foreground color
* [write-braille.ps1](Scripts/write-braille.ps1) - writes the given text in Braille
* [write-green.ps1](Scripts/write-green.ps1) - writes the given text in a green foreground color
* [write-logbook.ps1](Scripts/write-logbook.ps1) - writes the given text to the logbook
* [write-lowercase.ps1](Scripts/write-lowercase.ps1) - writes the given text in lowercase letters
* [write-marquee.ps1](Scripts/write-marquee.ps1) - writes the given text as marquee
* [write-morse-code.ps1](Scripts/write-morse-code.ps1) - writes the given text in Morse code
* [write-motd.ps1](Scripts/write-motd.ps1) - writes the message of the day (MOTD)

View File

@ -1,22 +1,18 @@
#!/bin/powershell
<#
.SYNTAX ./MD5.ps1 [<file>]
.DESCRIPTION prints the MD5 checksum of the given file
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX MD5.ps1 [<file>]
.DESCRIPTION prints the MD5 checksum of the given file
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($File = "")
if ($File -eq "" ) {
$File = read-host "Enter path to file"
}
if ($File -eq "" ) { $File = read-host "Enter path to file" }
try {
$Result = get-filehash $File -algorithm MD5
write-output "MD5 hash is" $Result.Hash
"MD5 hash is" $Result.Hash
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,22 +1,18 @@
#!/bin/powershell
<#
.SYNTAX ./SHA1.ps1 [<file>]
.DESCRIPTION prints the SHA1 checksum of the given file
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX SHA1.ps1 [<file>]
.DESCRIPTION prints the SHA1 checksum of the given file
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($File = "")
if ($File -eq "" ) {
$File = read-host "Enter the filename"
}
if ($File -eq "" ) { $File = read-host "Enter the filename" }
try {
$Result = get-filehash $File -algorithm SHA1
write-output "SHA1 hash is" $Result.Hash
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,22 +1,18 @@
#!/bin/powershell
<#
.SYNTAX ./SHA256.ps1 [<file>]
.DESCRIPTION prints the SHA256 checksum of the given file
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX SHA256.ps1 [<file>]
.DESCRIPTION prints the SHA256 checksum of the given file
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($File = "")
if ($File -eq "" ) {
$File = read-host "Enter the filename"
}
if ($File -eq "" ) { $File = read-host "Enter the filename" }
try {
$Result = get-filehash $File -algorithm SHA256
write-output "SHA256 hash is:" $Result.Hash
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,9 +1,8 @@
#!/bin/powershell
<#
.SYNTAX ./add-firewall-rules.ps1 [<path-to-executables>]
.DESCRIPTION adds firewall rules for the given executables, administrator rights are required
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX add-firewall-rules.ps1 [<path-to-executables>]
.DESCRIPTION adds firewall rules for the given executables, administrator rights are required
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
#Requires -RunAsAdministrator
@ -49,6 +48,6 @@ try {
Start-Process powershell -Verb runAs -ArgumentList "-command & {$command} $arg"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

27
Scripts/add-memo.ps1 Executable file
View File

@ -0,0 +1,27 @@
<#
.SYNTAX add-memo.ps1 [<text>]
.DESCRIPTION adds the given memo text to $HOME/Memos.csv
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($Text = "")
if ($Text -eq "" ) { $Text = read-host "Enter the memo text to add" }
try {
$Path = "$HOME/Memos.csv"
$Time = get-date -format "yyyy-MM-ddTHH:mm:ssZ" -asUTC
$User = $(whoami)
$Line = "$Time,$User,$Text"
if (-not(test-path "$Path")) {
write-output "Time,User,Text" > "$Path"
}
write-output $Line >> "$Path"
"✔️ added to 📄$Path"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,9 +1,8 @@
#!/bin/powershell
<#
.SYNTAX ./alert.ps1 [<message>]
.DESCRIPTION handle and escalate the given alert message
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX alert.ps1 [<message>]
.DESCRIPTION handle and escalate the given alert message
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($Message = "")
@ -19,6 +18,6 @@ try {
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

86
Scripts/build-repo.ps1 Executable file
View File

@ -0,0 +1,86 @@
<#
.SYNTAX build-repo.ps1 [<repo-dir>]
.DESCRIPTION builds a Git repository (supporting cmake,configure,autogen,Imakefile,Makefile)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($RepoDir = "$PWD")
try {
$StopWatch = [system.diagnostics.stopwatch]::startNew()
$RepoDir = resolve-path "$RepoDir"
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
if (test-path "$RepoDir/CMakeLists.txt") {
"⏳ Building 📂$RepoDir using CMakeLists.txt ..."
if (-not(test-path "$RepoDir/BuildFiles/" -pathType container)) {
& mkdir "$RepoDir/BuildFiles/"
}
set-location "$RepoDir/BuildFiles/"
& cmake ..
if ($lastExitCode -ne "0") { throw "Executing 'cmake ..' has failed" }
& make -j4
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
set-location ".."
} elseif (test-path "$RepoDir/configure") {
"⏳ Building 📂$RepoDir using 'configure' ..."
set-location "$RepoDir/"
& ./configure
if ($lastExitCode -ne "0") { throw "Executing 'configure' has failed" }
& make -j4
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
} elseif (test-path "$RepoDir/autogen.sh") {
"⏳ Building 📂$RepoDir using 'autogen.sh' ..."
set-location "$RepoDir/"
& ./autogen.sh
if ($lastExitCode -ne "0") { throw "Script 'autogen.sh' has failed" }
& make -j4
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
} elseif (test-path "$RepoDir/Imakefile") {
"⏳ Building 📂$RepoDir using Imakefile ..."
set-location "$RepoDir/"
& xmkmf
if ($lastExitCode -ne "0") { throw "Executing 'xmkmf' has failed" }
& make -j4
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
} elseif (test-path "$RepoDir/Makefile") {
"⏳ Building 📂$RepoDir using Makefile..."
set-location "$RepoDir/"
& make -j4
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
} elseif (test-path "$RepoDir/attower/src/build/DevBuild/build.bat") {
"⏳ Building 📂$RepoDir using build.bat ..."
set-location "$RepoDir/attower/src/build/DevBuild/"
& ./build.bat build-all-release
if ($lastExitCode -ne "0") { throw "Script 'build.bat' returned error(s)" }
} else {
write-warning "Sorry, no rule found to build 📂$RepoDir"
exit 0
}
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ built Git repository 📂$RepoDir in $Elapsed sec."
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

28
Scripts/build-repos.ps1 Executable file
View File

@ -0,0 +1,28 @@
<#
.SYNTAX build-repos.ps1 [<parent-dir>]
.DESCRIPTION builds all Git repositories under the current/given directory
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($ParentDir = "$PWD")
try {
$StopWatch = [system.diagnostics.stopwatch]::startNew()
if (-not(test-path "$ParentDir" -pathType container)) { throw "Can't access directory: $ParentDir" }
set-location $ParentDir
[int]$Count = 0
get-childItem $ParentDir -attributes Directory | foreach-object {
& "$PSScriptRoot/build-repo.ps1" "$($_.FullName)"
$Count++
}
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
write-host -foregroundColor green "✔️ built $Count Git repositories at $ParentDir in $Elapsed sec."
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

15
Scripts/cd-desktop.ps1 Executable file
View File

@ -0,0 +1,15 @@
<#
.SYNTAX cd-desktop.ps1
.DESCRIPTION go to the user's desktop folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
$TargetDir = resolve-path "$HOME/Desktop"
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

15
Scripts/cd-docs.ps1 Executable file
View File

@ -0,0 +1,15 @@
<#
.SYNTAX cd-docs.ps1
.DESCRIPTION go to the user's documents folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
$TargetDir = resolve-path "$HOME/Documents"
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

15
Scripts/cd-downloads.ps1 Executable file
View File

@ -0,0 +1,15 @@
<#
.SYNTAX cd-downloads.ps1
.DESCRIPTION go to the user's downloads folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
$TargetDir = resolve-path "$HOME/Downloads"
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

15
Scripts/cd-dropbox.ps1 Executable file
View File

@ -0,0 +1,15 @@
<#
.SYNTAX cd-dropbox.ps1
.DESCRIPTION go to the user's Dropbox folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
$TargetDir = resolve-path "$HOME/Dropbox"
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

15
Scripts/cd-home.ps1 Executable file
View File

@ -0,0 +1,15 @@
<#
.SYNTAX cd-home.ps1
.DESCRIPTION go to the user's home folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
$TargetDir = resolve-path "$HOME"
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

15
Scripts/cd-music.ps1 Executable file
View File

@ -0,0 +1,15 @@
<#
.SYNTAX cd-music.ps1
.DESCRIPTION go to the user's music folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
$TargetDir = resolve-path "$HOME/Music"
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

15
Scripts/cd-onedrive.ps1 Normal file
View File

@ -0,0 +1,15 @@
<#
.SYNTAX cd-onedrive.ps1
.DESCRIPTION go to the user's OneDrive folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
$TargetDir = resolve-path "$HOME/OneDrive"
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

15
Scripts/cd-pics.ps1 Executable file
View File

@ -0,0 +1,15 @@
<#
.SYNTAX cd-pics.ps1
.DESCRIPTION go to the user's pictures folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
$TargetDir = resolve-path "$HOME/Pictures"
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

View File

@ -0,0 +1,21 @@
<#
.SYNTAX cd-recycle-bin.ps1
.DESCRIPTION go to the user's recycle bin folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
function Get-CurrentUserSID { [CmdletBinding()] param()
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
return ([System.DirectoryServices.AccountManagement.UserPrincipal]::Current).SID.Value
}
$TargetDir = 'C:\$Recycle.Bin\' + "$(Get-CurrentUserSID)"
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

15
Scripts/cd-repos.ps1 Normal file
View File

@ -0,0 +1,15 @@
<#
.SYNTAX cd-repos.ps1
.DESCRIPTION go to the user's Git repositories folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
$TargetDir = resolve-path "$HOME/Repos"
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

19
Scripts/cd-root.ps1 Executable file
View File

@ -0,0 +1,19 @@
<#
.SYNTAX cd-root.ps1
.DESCRIPTION go to the root directory (C: on Windows)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
if ($IsLinux) {
$TargetDir = resolve-path "/"
} else {
$TargetDir = resolve-path "C:/"
}
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

15
Scripts/cd-scripts.ps1 Executable file
View File

@ -0,0 +1,15 @@
<#
.SYNTAX cd-scripts.ps1
.DESCRIPTION go to the PowerShell Scripts folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
$TargetDir = resolve-path "$PSScriptRoot"
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

15
Scripts/cd-up.ps1 Executable file
View File

@ -0,0 +1,15 @@
<#
.SYNTAX cd-up.ps1
.DESCRIPTION go one directory level up
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
$TargetDir = resolve-path ".."
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

15
Scripts/cd-up2.ps1 Normal file
View File

@ -0,0 +1,15 @@
<#
.SYNTAX cd-up2.ps1
.DESCRIPTION go two directory levels up
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
$TargetDir = resolve-path "../.."
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

15
Scripts/cd-up3.ps1 Normal file
View File

@ -0,0 +1,15 @@
<#
.SYNTAX cd-up3.ps1
.DESCRIPTION go three directory levels up
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
$TargetDir = resolve-path "../../.."
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

15
Scripts/cd-up4.ps1 Normal file
View File

@ -0,0 +1,15 @@
<#
.SYNTAX cd-up4.ps1
.DESCRIPTION go four directory levels up
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
$TargetDir = resolve-path "../../../.."
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

15
Scripts/cd-videos.ps1 Executable file
View File

@ -0,0 +1,15 @@
<#
.SYNTAX cd-videos.ps1
.DESCRIPTION go to the user's videos folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
$TargetDir = resolve-path "$HOME/Videos"
if (-not(test-path "$TargetDir" -pathType container)) {
write-warning "Sorry, there is no folder 📂$TargetDir (yet)"
exit 1
}
set-location "$TargetDir"
"📂$TargetDir"
exit 0

34
Scripts/check-cpu-temp.ps1 Executable file
View File

@ -0,0 +1,34 @@
<#
.SYNTAX check-cpu-temp.ps1
.DESCRIPTION checks the CPU temperature
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
if (test-path "/sys/class/thermal/thermal_zone0/temp") {
[int]$IntTemp = get-content "/sys/class/thermal/thermal_zone0/temp"
$Temp = [math]::round($IntTemp / 1000.0, 1)
} else {
write-warning "Sorry, no CPU temperature available"
exit 0
}
if ($Temp -gt "80") {
write-error "FAIL - $Temp °C CPU temperature is too high!"
exit 1
} elseif ($Temp -lt "-20") {
write-error "FAIL - $Temp °C CPU temperature is too low!"
exit 1
} elseif ($Temp -gt "50") {
write-warning "$Temp °C CPU temperature is quite high"
} elseif ($Temp -lt "0") {
write-warning "$Temp °C CPU temperature is quite low"
} else {
"✔️ $Temp °C CPU temperature"
}
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -0,0 +1,32 @@
<#
.SYNTAX check-dns-resolution.ps1
.DESCRIPTION checks the DNS resolution with frequently used domain names
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
$StopWatch = [system.diagnostics.stopwatch]::startNew()
write-progress "Reading Data/domain-names.csv..."
$PathToRepo = "$PSScriptRoot/.."
$Table = import-csv "$PathToRepo/Data/domain-names.csv"
foreach($Row in $Table) {
write-progress "Resolving $($Row.Domain) ..."
if ($IsLinux) {
$Ignore = nslookup $Row.Domain
} else {
$Ignore = resolve-dnsName $Row.Domain
}
}
$Count = $Table.Length
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
$Average = [math]::round($Count / $Elapsed, 1)
"✔️ $Average domains/s ($Count domains resolved in $Elapsed sec.)"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,28 +1,27 @@
#!/bin/powershell
<#
.SYNTAX ./check-drive-space.ps1 [<drive>] [<warning-level>]
.DESCRIPTION checks the given drive for free space left
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
<#
.SYNTAX check-drive-space.ps1 [<drive>] [<min-level>]
.DESCRIPTION checks the given drive for free space left
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($Drive = "", [int]$WarningLevel = 50) # warning level in GB
param($Drive = "", [int]$MinLevel = 50) # minimum level in GB
if ($Drive -eq "" ) {
$Drive = read-host "Enter drive to check"
}
if ($Drive -eq "" ) { $Drive = read-host "Enter drive to check" }
try {
$FreeSpace = (get-psdrive $Drive)
[int]$FreeSpace = (($FreeSpace.free / 1024) / 1024) / 1024
$DriveDetails = (get-psdrive $Drive)
[int]$Free = (($DriveDetails.Free / 1024) / 1024) / 1024
[int]$Used = (($DriveDetails.Used / 1024) / 1024) / 1024
[int]$Total = ($Used + $Free)
if ($FreeSpace -lt $WarningLevel) {
write-warning "Drive $Drive has only $FreeSpace GB free space left! (warning level is < $WarningLevel GB)"
if ($Free -lt $MinLevel) {
write-warning "Drive $Drive has only $Free GB left to use! ($Used GB out of $Total GB in use, minimum is $MinLevel GB)"
exit 1
}
write-host -foregroundColor green "OK - drive $Drive has $FreeSpace GB free space left (warning level is < $WarningLevel GB)"
"✔️ $Free GB left on drive $Drive ($Used GB of $Total GB used)"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

25
Scripts/check-file-system.ps1 Executable file
View File

@ -0,0 +1,25 @@
<#
.SYNTAX check-file-system.ps1 [<drive>]
.DESCRIPTION checks the validity of the file system (needs admin rights)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
#Requires -RunAsAdministrator
param($Drive = "")
if ($Drive -eq "" ) {
$Drive = read-host "Enter drive (letter) to check"
}
try {
$Result = repair-volume -driveLetter $Drive -scan
if ($Result -ne "NoErrorsFound") { throw "'repair-volume' failed" }
write-host -foregroundColor green "✔️ file system on drive $Drive is clean"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

38
Scripts/check-health.ps1 Executable file
View File

@ -0,0 +1,38 @@
<#
.SYNTAX check-health.ps1
.DESCRIPTION checks the health of the local computer
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
$Hostname = $(hostname)
$Healthy = 1
"Checking health of $Hostname ..."
& "$PSScriptRoot/check-swap-space.ps1"
if ($lastExitCode -ne "0") { $Healthy = 0 }
if ($IsLinux) {
& "$PSScriptRoot/check-drive-space.ps1" /
if ($lastExitCode -ne "0") { $Healthy = 0 }
} else {
& "$PSScriptRoot/check-drive-space.ps1" C
if ($lastExitCode -ne "0") { $Healthy = 0 }
}
& "$PSScriptRoot/check-cpu-temp.ps1"
if ($lastExitCode -ne "0") { $Healthy = 0 }
& "$PSScriptRoot/check-dns-resolution.ps1"
if ($lastExitCode -ne "0") { $Healthy = 0 }
& "$PSScriptRoot/check-ping.ps1"
if ($lastExitCode -ne "0") { $Healthy = 0 }
if ($Healthy) {
"✔️ $Hostname is healthy"
exit 0
} else {
write-warning "$Hostname is NOT healthy"
exit 1
}

View File

@ -1,9 +1,8 @@
#!/bin/powershell
<#
.SYNTAX ./check-ipv4-address.ps1 [<address>]
.DESCRIPTION checks the given IPv4 address for validity
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX check-ipv4-address.ps1 [<address>]
.DESCRIPTION checks the given IPv4 address for validity
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($Address = "")
@ -29,6 +28,6 @@ try {
exit 1
}
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,9 +1,8 @@
#!/bin/powershell
<#
.SYNTAX ./check-ipv6-address.ps1 [<address>]
.DESCRIPTION checks the given IPv6 address for validity
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX check-ipv6-address.ps1 [<address>]
.DESCRIPTION checks the given IPv6 address for validity
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($Address = "")
@ -42,6 +41,6 @@ try {
exit 1
}
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,10 +1,9 @@
#!/bin/powershell
<#
.SYNTAX ./check-mac-address.ps1 [<MAC>]
.DESCRIPTION checks the given MAC address for validity
MAC address like 00:00:00:00:00:00 or 00-00-00-00-00-00 or 000000000000
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX check-mac-address.ps1 [<MAC>]
.DESCRIPTION checks the given MAC address for validity
MAC address like 00:00:00:00:00:00 or 00-00-00-00-00-00 or 000000000000
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($MAC = "")
@ -30,6 +29,6 @@ try {
exit 1
}
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

32
Scripts/check-ping.ps1 Executable file
View File

@ -0,0 +1,32 @@
<#
.SYNTAX check-ping.ps1
.DESCRIPTION checks the ping latency to the internet
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
write-verbose "Sending pings to the internet ..."
$Pings = test-connection -count 1 -computerName heise.de,cnn.com,github.com,www.microsoft.com,dropbox.com,amazon.com,google.com,bing.com,youtube.com
[int]$Min = 9999999
[int]$Max = 0
[int]$Avg = 0
foreach($Ping in $Pings) {
if ($IsLinux) {
[int]$Latency = $Ping.latency
} else {
[int]$Latency = $Ping.ResponseTime
}
if ($Latency -lt $Min) { $Min = $Latency }
if ($Latency -gt $Max) { $Max = $Latency }
$Avg += $Latency
}
$Avg = $Avg / $Pings.count
"✔️ $Avg ms average ping latency ($Min ms min, $Max ms max)"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

38
Scripts/check-swap-space.ps1 Executable file
View File

@ -0,0 +1,38 @@
<#
.SYNTAX check-swap-space.ps1 [<min-level>]
.DESCRIPTION checks the free swap space
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([int]$MinLevel = 50) # minimum level in GB
try {
if ($IsLinux) {
$Result = $(free --mega | grep Swap:)
[int]$Total = $Result.subString(5,14)
[int]$Used = $Result.substring(20,13)
[int]$Free = $Result.substring(31,12)
} else {
$Items = get-wmiobject -class "Win32_PageFileUsage" -namespace "root\CIMV2" -computername localhost
foreach ($Item in $Items) {
[int]$Total = $Item.AllocatedBaseSize
[int]$Used = $Item.CurrentUsage
[int]$Free = ($Total - $Used)
}
}
if ($Total -eq "0") {
write-warning "No swap space configured!"
exit 1
}
if ($Free -lt $MinLevel) {
write-warning "Swap space has only $Free GB left to use! ($Used GB out of $Total GB in use, minimum is $MinLevel GB)"
exit 1
}
"✔️ $Free GB left on swap space ($Used GB of $Total GB used)"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,9 +1,8 @@
#!/bin/powershell
<#
.SYNTAX ./check-symlinks.ps1 [<dir-tree>]
.DESCRIPTION checks every symlink in the given directory tree
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX check-symlinks.ps1 [<dir-tree>]
.DESCRIPTION checks every symlink in the given directory tree
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($DirTree = "")
@ -28,9 +27,9 @@ try {
}
$SymlinksTotal++
}
write-host -foregroundColor green "Done - $SymlinksBroken out of $SymlinksTotal are broken"
write-host -foregroundColor green "OK - found $SymlinksTotal symlinks total, $SymlinksBroken symlinks are broken"
exit $SymlinksBroken
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

51
Scripts/check-weather.ps1 Executable file
View File

@ -0,0 +1,51 @@
<#
.SYNTAX check-weather.ps1 [<location>]
.DESCRIPTION checks the weather for critical values
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($Location = "") # empty means determine automatically
function Check { param([int]$Value, [int]$NormalMin, [int]$NormalMax, [string]$Unit)
if ($Value -lt $NormalMin) {
return "$Value $Unit ! "
}
if ($Value -gt $NormalMax) {
return "$Value $Unit ! "
}
return ""
}
try {
$Weather = (Invoke-WebRequest http://wttr.in/${Location}?format=j1 -UserAgent "curl" ).Content | ConvertFrom-Json
$Temp = $Weather.current_condition.temp_C
$Precip = $Weather.current_condition.precipMM
$Humidity = $Weather.current_condition.humidity
$Pressure = $Weather.current_condition.pressure
$WindSpeed = $Weather.current_condition.windspeedKmph
$WindDir = $Weather.current_condition.winddir16Point
$UV = $Weather.current_condition.uvIndex
$Visib = $Weather.current_condition.visibility
$Clouds = $Weather.current_condition.cloudcover
$Desc = $Weather.current_condition.weatherDesc.value
$Area = $Weather.nearest_area.areaName.value
$Region = $Weather.nearest_area.region.value
"Now: $($Temp)°C $($Precip)mm $($Humidity)% $($WindSpeed)km/h from $WindDir $($Pressure)hPa UV$($UV) $($Visib)km $($Clouds)% $Desc at $Area ($Region)"
$Result+=Check $Weather.current_condition.windspeedKmph 0 48 "km/h"
$Result+=Check $Weather.current_condition.visibility 1 1000 "km visibility"
$Result+=Check $Weather.current_condition.temp_C -20 40 "°C"
$Result+=Check $Weather.current_condition.uvIndex 0 6 "UV"
if ($Result -eq "") {
"Calm weather"
} else {
"WEATHER ALERT: $Result"
}
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,9 +1,8 @@
#!/bin/powershell
<#
.SYNTAX ./check-windows-system-files.ps1
.DESCRIPTION checks the validity of the Windows system files (requires admin rights)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
<#
.SYNTAX check-windows-system-files.ps1
.DESCRIPTION checks the validity of the Windows system files (requires admin rights)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
#Requires -RunAsAdministrator
@ -12,9 +11,9 @@ try {
sfc /verifyOnly
if ($lastExitCode -ne "0") { throw "'sfc /verifyOnly' failed" }
write-host -foregroundColor green "OK - Windows system files have been checked"
write-host -foregroundColor green "✔️ checked Windows system files"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,9 +1,8 @@
#!/bin/powershell
<#
.SYNTAX ./check-xml-file [<file>]
.DESCRIPTION checks the given XML file for validity
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX check-xml-file [<file>]
.DESCRIPTION checks the given XML file for validity
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($File = "")
@ -33,6 +32,6 @@ try {
write-host -foregroundColor green "OK - XML file is valid"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

58
Scripts/cherry-picker.ps1 Executable file
View File

@ -0,0 +1,58 @@
<#
.SYNTAX cherry-picker.ps1 [<commit-id>] [<commit-message>] [<branches>] [<repo-dir>]
.DESCRIPTION cherry-picks a Git commit into multiple branches
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($CommitID = "", $CommitMessage = "", $Branches = "", $RepoDir = "$PWD")
if ($CommitID -eq "" ) { $CommitID = read-host "Enter the commit id to cherry-pick" }
if ($CommitMessage -eq "" ) { $CommitMessage = read-host "Enter the commit message to use" }
if ($Branches -eq "" ) { $Branches = read-host "Enter the target branches" }
try {
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
set-location "$RepoDir"
foreach($Branch in $Branches) {
"STEP: Switching to branch $Branch (git checkout)..."
& git checkout --recurse-submodules --force $Branch
if ($lastExitCode -ne "0") { throw "'git checkout' failed" }
"STEP: Updating submodules (git submodule update)..."
& git submodule update --init --recursive
if ($lastExitCode -ne "0") { throw "'git submodule update' failed" }
"STEP: Cleaning the repository (git clean -fdx)..."
& git clean -fdx
if ($lastExitCode -ne "0") { throw "'git clean -fdx' failed" }
& git submodule foreach --recursive git clean -fdx
if ($lastExitCode -ne "0") { throw "'git clean -fdx' in submodules failed" }
"STEP: Pulling latest updates (git pull)..."
& git pull --recurse-submodules
if ($lastExitCode -ne "0") { throw "'git pull' failed" }
"STEP: Checking the status (git status)..."
$Result = (git status)
if ($lastExitCode -ne "0") { throw "'git status' failed" }
if ("$Result" -notmatch "nothing to commit, working tree clean") { throw "Branch is NOT clean: $Result" }
& git cherry-pick --no-commit "$CommitID"
if ($lastExitCode -ne "0") { throw "'git cherry-pick $CommitID' failed" }
& git commit -m "$CommitMessage"
if ($lastExitCode -ne "0") { throw "'git commit' failed" }
& git push
if ($lastExitCode -ne "0") { throw "'git push' failed" }
}
"DONE."
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,33 +0,0 @@
#!/bin/powershell
<#
.SYNTAX ./clean-branch.ps1 [<repo-dir>]
.DESCRIPTION cleans the current Git branch including submodules from generated files (e.g. for a fresh build)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($RepoDir = "$PWD")
try {
& git --version
} catch {
write-error "ERROR: can't execute 'git' - make sure Git is installed and available"
exit 1
}
try {
write-progress "Cleaning current branch in repository $RepoDir..."
set-location $RepoDir
& git clean -fdx # force + recurse into dirs + don't use the standard ignore rules
if ($lastExitCode -ne "0") { throw "'git clean -fdx' failed" }
& git submodule foreach --recursive git clean -fdx
if ($lastExitCode -ne "0") { throw "'git clean -fdx' in submodules failed" }
write-host -foregroundColor green "OK - cleaned current branch in repository $RepoDir"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

31
Scripts/clean-repo.ps1 Executable file
View File

@ -0,0 +1,31 @@
<#
.SYNTAX clean-repo.ps1 [<repo-dir>]
.DESCRIPTION cleans a Git repository from untracked files (including submodules, e.g. for a fresh build)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($RepoDir = "$PWD")
try {
$RepoDir = resolve-path "$RepoDir"
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
set-location "$RepoDir"
"⏳ Cleaning Git repository 📂$RepoDir from untracked files..."
$Null = (git --version)
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
& git clean -fdx # force + recurse into dirs + don't use the standard ignore rules
if ($lastExitCode -ne "0") { throw "'git clean -fdx' failed" }
& git submodule foreach --recursive git clean -fdx
if ($lastExitCode -ne "0") { throw "'git clean -fdx' in submodules failed" }
"✔️ Git repository 📂$RepoDir is clean now"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

15
Scripts/clear-recycle-bin.ps1 Executable file
View File

@ -0,0 +1,15 @@
<#
.SYNTAX clear-recycle-bin.ps1
.DESCRIPTION removes the content of the recycle bin folder (can not be undo!)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
Clear-RecycleBin -Confirm:$false
"✔️ recycle bin have been emptied"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,39 +1,39 @@
#!/bin/powershell
<#
.SYNTAX ./clone-repos.ps1 [<target-dir>]
.DESCRIPTION clones well-known Git repositories into the current/given directory.
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
<#
.SYNTAX clone-repos.ps1 [<parent-dir>]
.DESCRIPTION clones well-known Git repositories under the current/given directory.
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($TargetDir = "$PWD")
param($ParentDir = "$PWD")
try {
& git --version
} catch {
write-error "ERROR: can't execute 'git' - make sure Git is installed and available"
exit 1
}
$StopWatch = [system.diagnostics.stopwatch]::startNew()
try {
$PathToRepo = "$PSScriptRoot/.."
$Table = import-csv "$PathToRepo/Data/repos.csv"
if (-not(test-path "$ParentDir" -pathType container)) { throw "Can't access directory: $ParentDir" }
set-location $TargetDir
$Null = (git --version)
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
$Table = import-csv "$PSScriptRoot/../Data/git-repositories.csv"
[int]$Count = 0
foreach($Row in $Table) {
$URL = $Row.URL
$Directory = $Row.Directory
write-output ""
if (Test-Path $Directory) {
write-output "Skipping existing $Directory ..."
$DirName = $Row.Directory
if (test-path "$ParentDir/$DirName" -pathType container) {
"Skipping 📂$DirName because it exists already ..."
continue
}
write-output "Cloning from $URL..."
& git clone --recurse-submodules $URL
"Cloning $URL to 📂$DirName ..."
& git clone --recurse-submodules "$URL" "$ParentDir/$DirName"
if ($lastExitCode -ne "0") { throw "'git clone $URL' failed" }
$Count++
}
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ cloned $Count Git repositories at 📂$ParentDir in $Elapsed sec."
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,9 +1,9 @@
#!/bin/powershell
<#
.SYNTAX ./close-calculator.ps1
.DESCRIPTION closes the calculator program gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX close-calculator.ps1
.DESCRIPTION closes the calculator program gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
./close-program "Calculator" "Calculator" "calc"
& "$PSScriptRoot/close-program.ps1" "Calculator" "Calculator" "calc"
exit 0

View File

@ -1,9 +1,9 @@
#!/bin/powershell
<#
.SYNTAX ./close-chrome.ps1
.DESCRIPTION closes Google Chrome gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX close-chrome.ps1
.DESCRIPTION closes Google Chrome gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
./close-program "Google Chrome" "chrome"
& "$PSScriptRoot/close-program.ps1" "Google Chrome" "chrome" "chrome"
exit 0

View File

@ -1,9 +1,9 @@
#!/bin/powershell
<#
.SYNTAX ./close-cortana.ps1
.DESCRIPTION closes Cortana gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX close-cortana.ps1
.DESCRIPTION closes Cortana gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
./close-program "Cortana" "Cortana"
& "$PSScriptRoot/close-program.ps1" "Cortana" "Cortana" "Cortana"
exit 0

View File

@ -1,9 +1,9 @@
#!/bin/powershell
<#
.SYNTAX ./close-edge.ps1
.DESCRIPTION closes Microsoft Edge gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX close-edge.ps1
.DESCRIPTION closes Microsoft Edge gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
./close-program "Microsoft Edge" "msedge"
& "$PSScriptRoot/close-program.ps1" "Microsoft Edge" "msedge" "msedge"
exit 0

View File

@ -1,9 +1,9 @@
#!/bin/powershell
<#
.SYNTAX ./close-file-explorer.ps1
.DESCRIPTION closes Microsoft File Explorer gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX close-file-explorer.ps1
.DESCRIPTION closes Microsoft File Explorer gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
./close-program "File Explorer" "explorer"
& "$PSScriptRoot/close-program.ps1" "File Explorer" "explorer" "explorer"
exit 0

View File

@ -1,9 +1,8 @@
#!/bin/powershell
<#
.SYNTAX ./close-program.ps1 [<full-program-name>][<program-name>] [<program-alias-name>]
.DESCRIPTION closes the processes of the given program gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
<#
.SYNTAX close-program.ps1 [<full-program-name>] [<program-name>] [<program-alias-name>]
.DESCRIPTION closes the processes of the given program gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($FullProgramName = "", $ProgramName = "", $ProgramAliasName = "")
@ -36,9 +35,9 @@ try {
start-sleep -milliseconds 100
stop-process -name $ProgramName -force -errorAction 'silentlycontinue'
}
write-host -foregroundColor green "Done - $FullProgramName has been closed ($($Processes.Count) proc)."
write-host -foregroundColor green "✔️ closed $FullProgramName, found ($($Processes.Count) process(es)"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,9 +1,9 @@
#!/bin/powershell
<#
.SYNTAX ./close-system-settings.ps1
.DESCRIPTION closes the System Settings gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX close-system-settings.ps1
.DESCRIPTION closes the System Settings gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
./close-program "System Settings" "SystemSettings"
& "$PSScriptRoot/close-program.ps1" "System Settings" "SystemSettings" "SystemSettings"
exit 0

View File

@ -1,9 +1,9 @@
#!/bin/powershell
<#
.SYNTAX ./close-thunderbird.ps1
.DESCRIPTION closes Mozilla Thunderbird gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX close-thunderbird.ps1
.DESCRIPTION closes Mozilla Thunderbird gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
./close-program "Mozilla Thunderbird" "thunderbird"
& "$PSScriptRoot/close-program.ps1" "Mozilla Thunderbird" "thunderbird" "thunderbird"
exit 0

View File

@ -1,9 +1,9 @@
#!/bin/powershell
<#
.SYNTAX ./close-vlc.ps1
.DESCRIPTION closes the VLC media player gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX close-vlc.ps1
.DESCRIPTION closes the VLC media player gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
./close-program "VLC media player" "vlc"
& "$PSScriptRoot/close-program.ps1" "VLC media player" "vlc" "vlc"
exit 0

View File

@ -1,9 +1,9 @@
#!/bin/powershell
<#
.SYNTAX ./close-windows-terminal.ps1
.DESCRIPTION closes Windows Terminal gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX close-windows-terminal.ps1
.DESCRIPTION closes Windows Terminal gracefully
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
./close-program "Windows Terminal" "WindowsTerminal"
& "$PSScriptRoot/close-program.ps1" "Windows Terminal" "WindowsTerminal" "WindowsTerminal"
exit 0

View File

@ -1,31 +1,19 @@
#!/bin/powershell
<#
.SYNTAX ./configure-git.ps1 [<full-name>] [<email-address>] [<favorite-editor>]
.DESCRIPTION sets up the Git user configuration
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
<#
.SYNTAX configure-git.ps1 [<full-name>] [<email-address>] [<favorite-editor>]
.DESCRIPTION sets up the Git user configuration
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($FullName = "", $EmailAddress = "", $FavoriteEditor = "")
if ($FullName -eq "") {
$FullName = read-host "Enter your full name"
}
if ($EmailAddress -eq "") {
$EmailAddress = read-host "Enter your e-mail address"
}
if ($FavoriteEditor -eq "") {
$FavoriteEditor = read-host "Enter your favorite text editor (emacs,nano,vi,vim,...)"
}
if ($FullName -eq "") { $FullName = read-host "Enter your full name" }
if ($EmailAddress -eq "") { $EmailAddress = read-host "Enter your e-mail address"}
if ($FavoriteEditor -eq "") { $FavoriteEditor = read-host "Enter your favorite text editor (emacs,nano,vi,vim,...)" }
try {
& git --version
} catch {
write-error "Can't execute 'git' - make sure Git is installed and available"
exit 1
}
$Null = (git --version)
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
try {
& git config --global user.name $FullName
& git config --global user.email $EmailAddress
& git config --global core.editor $FavoriteEditor
@ -34,10 +22,10 @@ try {
& git config --global core.symlinks true
& git config --global core.longpaths true
& git config --global init.defaultBranch main
write-host -foregroundColor green "Done - your Git user configuration is now:"
write-host -foregroundColor green "✔️ your Git configuration has been saved, it's now:"
& git config --list
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

21
Scripts/convert-csv2txt.ps1 Executable file
View File

@ -0,0 +1,21 @@
<#
.SYNTAX convert-csv2txt.ps1 [<csv-file>]
.DESCRIPTION converts the given CSV file into a text list
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($Path = "")
if ($Path -eq "" ) { $Path = read-host "Enter path to CSV file" }
try {
$Table = Import-CSV -path "$Path" -header A,B,C,D,E,F,G,H
foreach($Row in $Table) {
write-output "* $($Row.A) $($Row.B) $($Row.C) $($Row.D) $($Row.E) $($Row.F) $($Row.G) $($Row.H)"
}
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

24
Scripts/convert-mysql2csv.ps1 Executable file
View File

@ -0,0 +1,24 @@
<#
.SYNTAX convert-mysql2csv.ps1 [<server>] [<database>] [<username>] [<password>] [<query>]
.DESCRIPTION convert the MySQL database table to a CSV file
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($server = "", $database = "", $username = "", $password = "", $query = "")
if ($server -eq "") { $server = read-host "Enter the hostname/IP address of the MySQL server" }
if ($database -eq "") { $database = read-host "Enter the database name" }
if ($username -eq "") { $username = read-host "Enter the database username" }
if ($password -eq "") { $password = read-host "Enter the database user password" }
if ($query -eq "") { $query = read-host "Enter the database query" }
try {
$csvfilepath = "$PSScriptRoot\mysql_table.csv"
$result = Invoke-MySqlQuery -ConnectionString "server=$server; database=$database; user=$username; password=$password; pooling = false; convert zero datetime=True" -Sql $query -CommandTimeout 10000
$result | Export-Csv $csvfilepath -NoTypeInformation
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

25
Scripts/convert-sql2csv.ps1 Executable file
View File

@ -0,0 +1,25 @@
<#
.SYNTAX convert-sql2csv.ps1 [<server>] [<database>] [<username>] [<password>] [<query>]
.DESCRIPTION convert the SQL database table to a CSV file
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($server = "", $database = "", $username = "", $password = "", $query = "")
if ($server -eq "") { $server = read-host "Enter the hostname/IP address of the SQL server" }
if ($database -eq "") { $database = read-host "Enter the database name" }
if ($username -eq "") { $username = read-host "Enter the database username" }
if ($password -eq "") { $password = read-host "Enter the database user password" }
if ($query -eq "") { $query = read-host "Enter the database query" }
try {
$secpasswd = ConvertTo-SecureString $password -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential ($username, $secpasswd)
$csvfilepath = "$PSScriptRoot\sqlserver_table.csv"
$result = Invoke-SqlServerQuery -Credential $creds -ConnectionTimeout 10000 -Database $database -Server $server -Sql $query -CommandTimeout 10000
$result | Export-Csv $csvfilepath -NoTypeInformation
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

22
Scripts/convert-txt2wav.ps1 Executable file
View File

@ -0,0 +1,22 @@
<#
.SYNTAX convert-txt2wav.ps1 [<text>] [<wav-file>]
.DESCRIPTION converts the given text to a .WAV audio file
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($Text = "", $WavFile = "")
if ($Text -eq "") { $Text = read-host "Enter text to speak" }
if ($WavFile -eq "") { $WavFile = read-host "Enter .WAV file to save to" }
try {
Add-Type -AssemblyName System.Speech
$SpeechSynthesizer = New-Object System.Speech.Synthesis.SpeechSynthesizer
$SpeechSynthesizer.SetOutputToWaveFile($tWavFile)
$SpeechSynthesizer.Speak($Text)
$SpeechSynthesizer.Dispose()
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

39
Scripts/create-branch.ps1 Executable file
View File

@ -0,0 +1,39 @@
<#
.SYNTAX create-branch.ps1 [<new-branch-name>] [<repo-dir>]
.DESCRIPTION creates and switches to a new branch in a Git repository
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($NewBranchName = "", $RepoDir = "$PWD")
if ($NewBranchName -eq "") { $NewBranchName = read-host "Enter new branch name" }
try {
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
set-location "$RepoDir"
$Null = (git --version)
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
$Result = (git status)
if ($lastExitCode -ne "0") { throw "'git status' failed in $RepoDir" }
if ("$Result" -notmatch "nothing to commit, working tree clean") { throw "Repository is NOT clean: $Result" }
& "$PSScriptRoot/fetch-repo.ps1"
if ($lastExitCode -ne "0") { throw "Script 'fetch-repo.ps1' failed" }
& git checkout -b "$NewBranchName"
if ($lastExitCode -ne "0") { throw "'git checkout -b $NewBranchName' failed" }
& git push origin "$NewBranchName"
if ($lastExitCode -ne "0") { throw "'git push origin $NewBranchName' failed" }
& git submodule update --init --recursive
if ($lastExitCode -ne "0") { throw "'git submodule update' failed" }
"✔️ created new branch 🌵$NewBranchName in Git repository $RepoDir"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

27
Scripts/create-shortcut.ps1 Executable file
View File

@ -0,0 +1,27 @@
<#
.SYNTAX create-shortcut.ps1 [<shortcut>] [<target>] [<description>]
.DESCRIPTION creates a new shortcut
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($Shortcut = "", $Target = "", $Description)
if ($Shortcut -eq "" ) { $Shortcut = read-host "Enter filename of shortcut" }
if ($Target -eq "" ) { $Target = read-host "Enter path to target" }
if ($Description -eq "" ) { $Description = read-host "Enter description" }
try {
$sh = new-object -ComObject WScript.Shell
$shortcut = $sh.CreateShortcut("$Shortcut.lnk")
$shortcut.TargetPath = "$Target"
$shortcut.WindowStyle = "1"
$shortcut.IconLocation = "C:\Windows\System32\SHELL32.dll, 3"
$shortcut.Description = "$Description"
$shortcut.save()
write-host -foregroundColor green "✔️ shortcut $Shortcut created."
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,26 +1,20 @@
#!/bin/powershell
<#
.SYNTAX ./create-symlink.ps1 [<symlink>] [<target>]
.DESCRIPTION creates a symbolic link
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
<#
.SYNTAX create-symlink.ps1 [<symlink>] [<target>]
.DESCRIPTION creates a symbolic link
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($Symlink = "", $Target = "")
if ($Symlink -eq "" ) {
$Symlink = read-host "Enter filename of symlink"
}
if ($Target -eq "" ) {
$Target = read-host "Enter path to target"
}
if ($Symlink -eq "" ) { $Symlink = read-host "Enter filename of symlink" }
if ($Target -eq "" ) { $Target = read-host "Enter path to target" }
try {
new-item -path "$Symlink" -itemType SymbolicLink -Value "$Target"
write-host -foregroundColor green "Done."
write-host -foregroundColor green "✔️ symlink $Symlink created (pointing to $Target)"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

36
Scripts/create-tag.ps1 Executable file
View File

@ -0,0 +1,36 @@
<#
.SYNTAX create-tag.ps1 [<new-tag-name>] [<repo-dir>]
.DESCRIPTION creates a new tag in the current/given Git repository
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($NewTagName = "", $RepoDir = "$PWD")
if ($NewTagName -eq "") { $NewTagName = read-host "Enter new tag name" }
try {
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
set-location "$RepoDir"
$Null = (git --version)
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
$Result = (git status)
if ($lastExitCode -ne "0") { throw "'git status' failed in $RepoDir" }
if ("$Result" -notmatch "nothing to commit, working tree clean") { throw "Repository is NOT clean: $Result" }
& "$PSScriptRoot/fetch-repo.ps1"
if ($lastExitCode -ne "0") { throw "Script 'fetch-repo.ps1' failed" }
& git tag "$NewTagName"
if ($lastExitCode -ne "0") { throw "Error: 'git tag $NewTagName' failed!" }
& git push origin "$NewTagName"
if ($lastExitCode -ne "0") { throw "Error: 'git push origin $NewTagName' failed!" }
"🔖 tag $NewTagName has been created"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,26 +0,0 @@
#!/bin/powershell
<#
.SYNTAX ./csv-to-text.ps1 [<csv-file>]
.DESCRIPTION converts the given CSV file into a text list
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([String]$Path)
if ($Path -eq "" ) {
$Path = read-host "Enter path to CSV file"
}
try {
$Table = Import-CSV -path "$Path" -header A,B,C,D,E,F,G,H
foreach($Row in $Table) {
write-output "* $($Row.A) $($Row.B) $($Row.C) $($Row.D) $($Row.E) $($Row.F) $($Row.G) $($Row.H)"
# write-output "* [$($Row.B)](ipfs::$($Row.A))"
}
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -12,7 +12,7 @@ HOMEDIR=/home/mf
$HOMEDIR/PowerShell/Scripts/query-smart-data.ps1 $HOMEDIR
# to query S.M.A.R.T. data of all your HDD's/SSD's
$HOMEDIR/PowerShell/Scripts/train-dns-cache.ps1
$HOMEDIR/PowerShell/Scripts/check-dns-resolution.ps1
# to train the DNS cache with frequently used domain names
exit 0

View File

@ -1,9 +1,8 @@
#!/bin/powershell
<#
.SYNTAX ./decrypt-file.ps1 [<path>] [<password>]
.DESCRIPTION decrypts the given file
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX decrypt-file.ps1 [<path>] [<password>]
.DESCRIPTION decrypts the given file
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$Path = "", [string]$Password = "")
@ -164,6 +163,6 @@ try {
write-host -foregroundColor green "Done."
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,9 +1,8 @@
#!/bin/powershell
<#
.SYNTAX ./display-time.ps1 [<seconds>]
.DESCRIPTION displays the current time for 10 seconds by default
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX display-time.ps1 [<seconds>]
.DESCRIPTION displays the current time for 10 seconds by default
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([int]$Seconds = 10)
@ -19,6 +18,6 @@ try {
}
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

23
Scripts/download-dir.ps1 Executable file
View File

@ -0,0 +1,23 @@
<#
.SYNTAX download-dir.ps1 [<URL>]
.DESCRIPTION downloads a directory tree from the given URL
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($URL = "")
if ($URL -eq "") { $URL = read-host "Enter directory URL to download" }
try {
& wget --version
if ($lastExitCode -ne "0") { throw "Can't execute 'wget' - make sure wget is installed and available" }
& wget --mirror --convert-links --adjust-extension --page-requisites --no-parent $URL --directory-prefix . --no-verbose
if ($lastExitCode -ne "0") { throw "Can't execute 'wget --mirror $URL'" }
write-host -foregroundColor green "OK - directory downloaded from $URL"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

23
Scripts/download-file.ps1 Executable file
View File

@ -0,0 +1,23 @@
<#
.SYNTAX download-file.ps1 [<URL>]
.DESCRIPTION downloads a file from the given URL
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($URL = "")
if ($URL -eq "") { $URL = read-host "Enter file URL to download" }
try {
& wget --version
if ($lastExitCode -ne "0") { throw "Can't execute 'wget' - make sure wget is installed and available" }
& wget --mirror --convert-links --adjust-extension --page-requisites --no-parent $URL --directory-prefix . --no-verbose
if ($lastExitCode -ne "0") { throw "Can't execute 'wget --mirror $URL'" }
write-host -foregroundColor green "OK - file downloaded from $URL"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,30 +0,0 @@
#!/bin/powershell
<#
.SYNTAX ./download.ps1 [<URL>]
.DESCRIPTION downloads the file/directory from the given URL
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($URL = "")
if ($URL -eq "" ) {
$URL = read-host "Enter URL to download"
}
try {
& wget --version
} catch {
write-error "Can't execute 'wget' - make sure wget is installed and available"
exit 1
}
try {
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent $URL --directory-prefix . --no-verbose
write-host -foregroundColor green "Done."
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

23
Scripts/edit.ps1 Executable file
View File

@ -0,0 +1,23 @@
<#
.SYNTAX edit.ps1 <filename>
.DESCRIPTION starts the built-in text editor to edit the given file
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($Filename = "")
try {
if ($IsLinux) {
& vi "$Filename"
if ($lastExitCode -ne "0") { throw "Can't execute 'vi' - make sure vi is installed and available" }
} else {
& notepad.exe "$Filename"
if ($lastExitCode -ne "0") { throw "Can't execute 'notepad.exe' - make sure notepad.exe is installed and available" }
}
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,9 +1,8 @@
#!/bin/powershell
<#
.SYNTAX ./enable-crash-dumps.ps1
.DESCRIPTION enables the writing of crash dumps
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
<#
.SYNTAX enable-crash-dumps.ps1
.DESCRIPTION enables the writing of crash dumps
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
##################################################################
@ -289,3 +288,4 @@ Else
write-host "You did not enter a valid option. Please re-run Get-Dump.ps1"
start-sleep -s 5
}
exit 0

21
Scripts/enable-god-mode.ps1 Executable file
View File

@ -0,0 +1,21 @@
<#
.SYNTAX enable-god-mode.ps1
.DESCRIPTION enables the god mode (adds a new icon to the desktop)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
$GodModeSplat = @{
Path = "$HOME\Desktop"
Name = "GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}"
ItemType = 'Directory'
}
$null = new-item @GodModeSplat
"✔️ new icon added to the desktop"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

18
Scripts/enable-ssh-client.ps1 Executable file
View File

@ -0,0 +1,18 @@
<#
.SYNTAX enable-ssh-client.ps1
.DESCRIPTION enables the SSH client (needs admin rights)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
#Requires -RunAsAdministrator
try {
Add-WindowsCapability -Online -Name OpenSSH.Client*
write-host -foregroundColor green "OK - SSH client enabled"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

20
Scripts/enable-ssh-server.ps1 Executable file
View File

@ -0,0 +1,20 @@
<#
.SYNTAX enable-ssh-server.ps1
.DESCRIPTION enables the SSH server (needs admin rights)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
#Requires -RunAsAdministrator
try {
Add-WindowsCapability -Online -Name OpenSSH.Server*
Start-Service sshd
Set-Service -Name sshd -StartupType 'Automatic'
write-host -foregroundColor green "OK - SSH server enabled"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,12 +1,11 @@
#!/bin/powershell
<#
.SYNTAX ./encrypt-file.ps1 [<path>] [<password>]
.DESCRIPTION encrypts the given file
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX encrypt-file.ps1 [<path>] [<password>]
.DESCRIPTION encrypts the given file
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$Path = "", [string]$Password = "")
param($Path = "", $Password = "")
function EncryptFile {
<#
@ -149,6 +148,6 @@ try {
write-host -foregroundColor green "Done."
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

79
Scripts/enter-chat.ps1 Normal file
View File

@ -0,0 +1,79 @@
# make sure you adjust this path
# it must point to a network share where you have read and write permissions
$ServerShare = "\\myserver\chathome"
function Enter-Chat
{
param
(
[Parameter(Mandatory)]
[string]
$ChatChannelName,
[string]
$Name = $env:USERNAME,
[Switch]
$ShowOldPosts,
$HomeShare = $ServerShare
)
if ($ShowOldPosts)
{
$Option = ''
}
else
{
$Option = '-Tail 0'
}
$Path = Join-Path -Path $HomeShare -ChildPath "$ChatChannelName.txt"
$exists = Test-Path -Path $Path
if ($exists -eq $false)
{
$null = New-Item -Path $Path -Force -ItemType File
}
$process = Start-Process -FilePath powershell -ArgumentList "-noprofile -windowstyle hidden -command Get-COntent -Path '$Path' $Option -Wait | Out-GridView -Title 'Chat: [$ChatChannelName]'" -PassThru
Write-Host "To exit, enter: quit"
"[$Name entered the chat]" | Add-Content -Path $Path
do
{
Write-Host "[$ChatChannelName]: " -ForegroundColor Green -NoNewline
$inputText = Read-Host
$isStopCommand = 'quit','exit','stop','leave' -contains $inputText
if ($isStopCommand -eq $false)
{
"[$Name] $inputText" | Add-Content -Path $Path
}
} until ($isStopCommand -eq $true)
"[$Name left the chat]" | Add-Content -Path $Path
$process | Stop-Process
}
function Get-ChatChannel
{
param
(
$HomeShare = $ServerShare
)
Get-ChildItem -Path $HomeShare -Filter *.txt -File |
ForEach-Object {
[PSCustomObject]@{
ChannelName = [System.IO.Path]::GetFileNameWithoutExtension($_.Name)
LastActive = $_.LastWriteTime
Started = $_.CreationTime
}
}
}

28
Scripts/fetch-repo.ps1 Executable file
View File

@ -0,0 +1,28 @@
<#
.SYNTAX fetch-repo.ps1 [<repo-dir>]
.DESCRIPTION fetches updates for a local Git repository (including submodules)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($RepoDir = "$PWD")
try {
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
set-location "$RepoDir"
$RepoDirName = (get-item "$RepoDir").Name
"⏳ Fetching updates for Git repository 📂$RepoDirName ..."
$Null = (git --version)
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
& git fetch --all --recurse-submodules --jobs=4
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
"✔️ fetched Git repository 📂$RepoDirName"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,35 +1,39 @@
#!/bin/powershell
<#
.SYNTAX ./fetch-repos.ps1 [<parent-dir>]
.DESCRIPTION fetches all Git repositories under the current/given directory (including submodules)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
<#
.SYNTAX fetch-repos.ps1 [<parent-dir>]
.DESCRIPTION fetches updates for all Git repositories under the current/given directory (including submodules)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($ParentDir = "$PWD")
try {
$null = $(git --version)
} catch {
write-error "ERROR: can't execute 'git' - make sure Git is installed and available"
exit 1
}
$StopWatch = [system.diagnostics.stopwatch]::startNew()
try {
write-progress "Fetching repositories under $ParentDir ..."
if (-not(test-path "$ParentDir" -pathType container)) { throw "Can't access directory: $ParentDir" }
set-location $ParentDir
get-childItem $ParentDir -attributes Directory | foreach-object {
set-location $_.FullName
& git fetch --recurse-submodules
if ($lastExitCode -ne "0") { throw "'git fetch --recurse-submodules' failed" }
$Null = (git --version)
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
[int]$Count = 0
get-childItem $ParentDir -attributes Directory | foreach-object {
"⏳ Fetching updates for Git repository 📂$($_.Name) ..."
set-location "$($_.FullName)"
& git fetch --all --recurse-submodules --jobs=4
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
set-location ..
$Count++
}
write-host -foregroundColor green "OK - fetched repositories under $ParentDir"
$ParentDirName = (get-item "$ParentDir").Name
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ fetched updates for $Count Git repositories at 📂$ParentDirName in $Elapsed sec."
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

BIN
Scripts/folder.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -1,19 +1,13 @@
#!/bin/powershell
<#
.SYNTAX ./generate-qrcode.ps1 [<text>] [<image-size>]
.DESCRIPTION generates a QR code
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX generate-qrcode.ps1 [<text>] [<image-size>]
.DESCRIPTION generates a QR code
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($Text = "", $ImageSize = "")
if ($Text -eq "") {
$Text = read-input "Enter text or URL"
}
if ($ImageSize -eq "") {
$ImageSize = read-input "Enter image size (e.g. 500x500)"
}
if ($Text -eq "") { $Text = read-host "Enter text or URL" }
if ($ImageSize -eq "") { $ImageSize = read-host "Enter image size (e.g. 500x500)" }
try {
$ECC = "M" # can be L, M, Q, H
@ -33,6 +27,6 @@ try {
write-host -foregroundColor green "Done - QR code has been written to $NewFile"
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,15 +0,0 @@
#!/bin/powershell
<#
.SYNTAX ./go-downloads.ps1
.DESCRIPTION go to the user's downloads folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
set-location $HOME/Downloads/
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,15 +0,0 @@
#!/bin/powershell
<#
.SYNTAX ./go-home.ps1
.DESCRIPTION go to the user's home folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
set-location $HOME
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,15 +0,0 @@
#!/bin/powershell
<#
.SYNTAX ./go-music.ps1
.DESCRIPTION go to the user's music folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
set-location $HOME/Music/
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,15 +0,0 @@
#!/bin/powershell
<#
.SYNTAX ./go-scripts.ps1
.DESCRIPTION go to the PowerShell Scripts folder
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
set-location $PSScriptRoot
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,9 +1,8 @@
#!/bin/powershell
<#
.SYNTAX ./hibernate.ps1
.DESCRIPTION enables hibernate mode for the local computer (requires admin rights)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX hibernate.ps1
.DESCRIPTION enables hibernate mode for the local computer (needs admin rights)
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
#Requires -RunAsAdministrator
@ -13,6 +12,6 @@ try {
[System.Windows.Forms.Application]::SetSuspendState("Hibernate", $false, $false);
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,9 +1,8 @@
#!/bin/powershell
<#
.SYNTAX ./inspect-exe.ps1 [<path-to-exe-file>]
.DESCRIPTION prints basic information of the given executable file
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
.SYNTAX inspect-exe.ps1 [<path-to-exe-file>]
.DESCRIPTION prints basic information of the given executable file
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
param($PathToExe = "")
@ -16,6 +15,6 @@ try {
get-childitem $PathToExe | % {$_.VersionInfo} | Select *
exit 0
} catch {
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -0,0 +1,19 @@
<#
.SYNTAX install-google-chrome.ps1
.DESCRIPTION silently installs latest Google Chrome
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
$Path = $env:TEMP;
$Installer = "chrome_installer.exe"
Invoke-WebRequest "http://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile $Path\$Installer
Start-Process -FilePath $Path\$Installer -Args "/silent /install" -Verb RunAs -Wait
Remove-Item $Path\$Installer
write-host -foregroundColor green "✔️ installed Google Chrome"
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -0,0 +1,29 @@
<#
.SYNTAX introduce-powershell.ps1
.DESCRIPTION introduces PowerShell to new users
.LINK https://github.com/fleschutz/PowerShell
.NOTES Author: Markus Fleschutz / License: CC0
#>
try {
& "$PSScriptRoot/write-big.ps1" "PowerShell"
& "$PSScriptRoot/write-animated.ps1" "Welcome to PowerShell"
& "$PSScriptRoot/write-animated.ps1" "Feel the power of the console and scripting"
""
"* Want to learn PowerShell? See the tutorials at: https://www.guru99.com/powershell-tutorial.html"
""
"* Need documentation? See the PowerShell docs at: https://docs.microsoft.com/en-us/powershell/"
""
"* Want sample scripts? See PowerShell Scripts at: https://github.com/fleschutz/PowerShell/"
""
& "$PSScriptRoot/write-typewriter.ps1" "P.S. PowerShell is looking forward to execute your next command"
""
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}

View File

@ -1,7 +1,7 @@
#!/bin/sh
# Syntax: ./ipfs-publish <dir-tree>
# Description: publishes the given directory tree to IPDS
# Description: publishes the given directory tree to IPFS
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
@ -11,18 +11,15 @@ DIR=$1
IPFS_HASHES="IPFS_hash_list.txt"
DF_HASHES="checksum_list.xml"
echo "Publishing directory tree $DIR to IPFS"
echo "(1) Removing Thumbs.db in subfolders ..."
echo "Publishing folder $DIR to IPFS"
echo "(1/3) Removing Thumbs.db in subfolders ..."
nice find "$DIR" -name Thumbs.db -exec rm -rf {} \;
echo "(2) Adding $DIR to IPFS ..."
echo "(2/3) Adding $DIR to IPFS ..."
nice ipfs add -r "$DIR" > $IPFS_HASHES
echo "(3) Verifying ..."
nice ipfs pin verify
echo "(4) Calculating digital forensics hashes to $DF_HASHES ..."
echo "(3/3) Calculating digital forensics hashes to $DF_HASHES ..."
nice hashdeep -c md5,sha1,sha256 -r -d -l -j 1 "$DIR" > $DF_HASHES
echo "DONE - to publish the content execute: ipfs name publish <HASH>"
echo "OK - to publish the content execute: ipfs name publish <HASH>"
exit 0

View File

@ -6,14 +6,19 @@
# Source: github.com/fleschutz/PowerShell
# License: CC0
HOSTNAME="`hostname`"
ipfs init --profile server
ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8765
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://pi:5001", "http://127.0.0.1:5001", "https://webui.ipfs.io"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["http://raspi:5001", "http://127.0.0.1:5001", "https://webui.ipfs.io"]'
ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["PUT", "GET", "POST"]'
echo "NOTE: Make sure port 4001 for IPv4/v6 is open by your router!"
ipfs daemon --enable-pubsub-experiment &
while true; do
ipfs daemon
echo "IPFS server has stopped, restarting ..."
sleep 1
done
exit 0

Some files were not shown because too many files have changed in this diff Show More