mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-07-03 22:20:05 +02:00
Compare commits
1320 Commits
Author | SHA1 | Date | |
---|---|---|---|
439fbf5bfa | |||
c24030c909 | |||
99def28e8d | |||
5d4df61edc | |||
5a6fb1d698 | |||
5aa9ba219a | |||
00d11f8866 | |||
c77f271268 | |||
a2681adbf9 | |||
6136ae80f2 | |||
1f51d6ab66 | |||
60cc93dbbd | |||
b7e107ecd6 | |||
76a95bb8ae | |||
bc9a0ab7c0 | |||
deca430aae | |||
f1584f83f3 | |||
79e6e6150f | |||
12a7eedd86 | |||
88f6dbb91d | |||
39bd55443f | |||
35d32e29e1 | |||
036c9a39da | |||
568707d547 | |||
8258e56563 | |||
79376a98ff | |||
571c3b7e49 | |||
30440a72c2 | |||
d6593816c3 | |||
b2c6f7ea22 | |||
6a413827df | |||
230fe23421 | |||
d6071ca2b0 | |||
3721feeaa9 | |||
411756abc6 | |||
b360ab234b | |||
6cd2ea934d | |||
fa466955a4 | |||
443a4b78e7 | |||
fc23927446 | |||
d4c5c03433 | |||
af3c58a541 | |||
85e5dfe8f1 | |||
77081de9db | |||
c3ad18eba7 | |||
725bdcb680 | |||
b845d6459b | |||
5731ff7a5f | |||
af92a2972d | |||
3b3f8db539 | |||
54974f6660 | |||
29bd848405 | |||
b98b638ff1 | |||
adfc40c2cf | |||
9a9d83dfc8 | |||
60c1004a40 | |||
3d64a05c57 | |||
49b70b104d | |||
902f19c64a | |||
f74ab0c771 | |||
a2014996f6 | |||
82a6ca53f4 | |||
bbd9fd4e99 | |||
e192f34821 | |||
11bfd0b886 | |||
fa37a97c92 | |||
598adae9cb | |||
18a6d1fcf5 | |||
75672674a9 | |||
90ed5031d7 | |||
b612c905e2 | |||
4be557732e | |||
b2b539e471 | |||
57b87c4b48 | |||
6ddf3d846c | |||
6cfc31ffd4 | |||
abc5a11989 | |||
ea6ca76eda | |||
05fdf8b99c | |||
ef346ea8bc | |||
a19489235a | |||
c80d48b7d7 | |||
b0caa06e29 | |||
b72f6e6a6e | |||
3ef424ad70 | |||
c9867174cd | |||
5f573540a5 | |||
cb9df2ccf2 | |||
e2eed4e802 | |||
5ca003c8e3 | |||
360947b911 | |||
233864eef0 | |||
81a8082017 | |||
69b8b3ee4e | |||
e08a839e11 | |||
59eb6e5c7b | |||
0878ab8141 | |||
f14995fa28 | |||
4928897fd2 | |||
5bee8b4c11 | |||
098e1e8b57 | |||
d9f5847aed | |||
6132292e2a | |||
2b4fb24678 | |||
245f6330f9 | |||
00d0fb333e | |||
3dba184d19 | |||
04406716db | |||
9ae69818cf | |||
900809ed2d | |||
68093db677 | |||
46c80fcd36 | |||
dddfe0eb80 | |||
c8f6edfe04 | |||
fc8919c7b0 | |||
746825f40f | |||
29bd5ed5c9 | |||
3189a749de | |||
6e05236a99 | |||
aed2b7d940 | |||
c5b5cb1c6e | |||
4de7ec9831 | |||
85b5d2b84f | |||
8e9b84491e | |||
38f047e111 | |||
6c2002649f | |||
34de8863f4 | |||
2df84055fc | |||
4b4ef9c1c4 | |||
a79bb3d0eb | |||
c5b68daf0e | |||
11df9ebbc3 | |||
84d421b0bd | |||
19164caf2b | |||
a3d209e55c | |||
7ee714e3a9 | |||
885abeb385 | |||
513c60d5f9 | |||
a316ad6e27 | |||
1fd0b93746 | |||
714f53a90a | |||
adc7c4b240 | |||
c1104a14af | |||
95e3305c9d | |||
6625d4a909 | |||
9bdbd172f0 | |||
0c34da568f | |||
badf775807 | |||
80a756cf3e | |||
a88ee6031a | |||
edd15f6ebe | |||
680f99568d | |||
adf316dac3 | |||
1bfee19061 | |||
267a4e566c | |||
70e14b26b2 | |||
a9b0fd120d | |||
0537d616ee | |||
c9961fe97d | |||
a573ee7878 | |||
5d11391dc7 | |||
c2ece8db12 | |||
8b5cbd074f | |||
5381e88ced | |||
1e6d5ac3a5 | |||
306cd65327 | |||
67636a8024 | |||
4cc43302c2 | |||
a11c9953b9 | |||
5a5cf939bb | |||
a962e1b8ad | |||
b94c006e94 | |||
ffe8bcc3d7 | |||
0ae669da26 | |||
f89271ce4b | |||
e993d937d6 | |||
7d36c0fb74 | |||
0fe35dcd45 | |||
8ebbc74496 | |||
0bcb9cadf6 | |||
2a886f87d5 | |||
d753e11173 | |||
0c6881f2dc | |||
15f69e32aa | |||
188653a71d | |||
1498b30abf | |||
3a5f2371e3 | |||
97cd42cb86 | |||
36aa290e9c | |||
3ff1d8718c | |||
b6759748ca | |||
8fcdf14d13 | |||
8aac02ceab | |||
6553707bff | |||
f6927c87f7 | |||
1a956d2a5b | |||
dc93b28ee9 | |||
abb97e1c9f | |||
1e227f3ba4 | |||
16983fbd21 | |||
d9c784fdbf | |||
66d6bc3d52 | |||
e73e26f9e7 | |||
7501f71794 | |||
3b8b88c6fa | |||
e11581f2cd | |||
e12bff48a1 | |||
46a49b5291 | |||
27ca36b317 | |||
d3abac4b07 | |||
652fd1fd01 | |||
203c9a8cfd | |||
11a28241bd | |||
9a1cacfcbb | |||
b5909b519a | |||
830e211cd4 | |||
beafdaa629 | |||
b56bcbcecd | |||
fa91cb5236 | |||
6ccc28a80f | |||
72cfca450f | |||
b759eaa68a | |||
db3c6e6138 | |||
d038f7bbe1 | |||
965b63ea1e | |||
6a848c8a7b | |||
7a22ef6c5e | |||
c33e0a7519 | |||
b4edc48cfb | |||
9570479c81 | |||
b436672010 | |||
5c2f1ede1d | |||
be47b2d002 | |||
fa9c10d2a4 | |||
cb182e897b | |||
702540704b | |||
22b72f2071 | |||
6e093e7dee | |||
4801e38d95 | |||
523bdde149 | |||
52a5cacabb | |||
b272bb0073 | |||
ee412a4013 | |||
e2aed21d87 | |||
c89673f442 | |||
8b642165c7 | |||
59f3c1bab5 | |||
d416115737 | |||
6d65fda172 | |||
1ffd91c5e2 | |||
dafa6cf1d7 | |||
225cf201aa | |||
d9c6286503 | |||
da55be390b | |||
16526f3a06 | |||
3dbc044948 | |||
9f56234f99 | |||
587c0824b9 | |||
7d34c7cdf5 | |||
c623a07146 | |||
b365dec5f6 | |||
3d8e7fbad8 | |||
f943a8ae91 | |||
194dc78d3d | |||
60511c7731 | |||
0307ff46fa | |||
5ad06bb3d3 | |||
eca81b91d5 | |||
71eaa3e6f1 | |||
8f9bfa655d | |||
21db8c52bd | |||
398d10fc29 | |||
a9e08a6c3d | |||
b455a05458 | |||
d3e1550e02 | |||
cf606eebba | |||
6428478bfb | |||
a683f528ab | |||
9a7d8ee371 | |||
d8b3f36711 | |||
6d46821001 | |||
b2485aa1ab | |||
4a3b0aa5fb | |||
50466806df | |||
d662dcf125 | |||
6daf7a7928 | |||
54cc55b103 | |||
9d44a2e9a0 | |||
c5eea816ee | |||
4833ecbfa4 | |||
3142c0bce6 | |||
b1845110bb | |||
b4afef5748 | |||
020e1fa30b | |||
00fcfa095a | |||
adca1ca2f7 | |||
5906c30a14 | |||
e1e4dd8185 | |||
2077f676cf | |||
cfc3b82846 | |||
98d70bfa34 | |||
828e741c74 | |||
dc63559aa0 | |||
66af9a5668 | |||
f826630e72 | |||
35e940a00c | |||
893273739a | |||
0915de8f8b | |||
c7d469422f | |||
17c26df2d9 | |||
7a8baf1054 | |||
d46e0f3f50 | |||
1f60b988c1 | |||
c9190874e9 | |||
45cb1c9904 | |||
329626f163 | |||
bde66d8aea | |||
9aefaa8994 | |||
0082f696ac | |||
79d4fc3d75 | |||
106cda4f53 | |||
8ccc88cc35 | |||
4b89df73f1 | |||
23c3ed729d | |||
9c86de8499 | |||
6d84c275d8 | |||
054a94d6ff | |||
99d6ccb414 | |||
d2788b7ba1 | |||
824903d3b2 | |||
e93cb73d02 | |||
3a5aa8a8cc | |||
7ba6813c67 | |||
c99dd855ca | |||
d0f9223137 | |||
56c8e4bbd7 | |||
24f2f69bc7 | |||
64b4a0839a | |||
f68310dee0 | |||
7e379a79ba | |||
7ed57228ac | |||
dcd1ea7f8b | |||
b892eb7b17 | |||
bb6b9b4aa5 | |||
425b4afdf1 | |||
d0cf6df8b5 | |||
fd5751ddaf | |||
f27ad348ed | |||
760b59216e | |||
69e0b11c69 | |||
d3b59ef7eb | |||
49b14b8d79 | |||
a147fdec4d | |||
5d91d303af | |||
3a88fa3923 | |||
8b6e9f6b98 | |||
69ccb6a2af | |||
9b2d444df7 | |||
2731540147 | |||
51947ab13d | |||
44a40d4e15 | |||
b53e4f5b95 | |||
5f5acec687 | |||
a3300d75e2 | |||
fc2f04a133 | |||
8f266d1417 | |||
1b48f27d40 | |||
febe6ed9f7 | |||
43bbf406d7 | |||
a3978dd37c | |||
55f5e8984c | |||
1756897ae9 | |||
7baef5ef74 | |||
a679bdfc48 | |||
71db949ffe | |||
4f1eadcb86 | |||
e14f126f4c | |||
8fb66ad7eb | |||
dbef508e55 | |||
1816f7d12d | |||
dfe7444ca7 | |||
fd0f6844fb | |||
3b34aa16e3 | |||
3ce90ab07c | |||
e2aaef5499 | |||
9687903884 | |||
a865b6647d | |||
bb3419f6fa | |||
ccf88b966d | |||
eef59091ed | |||
c46416aaf9 | |||
fb00ef93fe | |||
601b8411e0 | |||
d3e56c97a1 | |||
0f402d2301 | |||
b975faf67f | |||
9fe2821c7f | |||
00513c05b1 | |||
28fbbb7a71 | |||
c819626612 | |||
4b96db4f0e | |||
7f86368024 | |||
9c8f8d343f | |||
d19a2e03c4 | |||
293d9ea489 | |||
84b3e0db22 | |||
909e360eb9 | |||
3e9a2c4e17 | |||
6c1a6b514c | |||
36ab0d8704 | |||
7f25ad32d2 | |||
d64385e5a7 | |||
11bac7c14e | |||
f561a3572e | |||
b367c74a5a | |||
b6cbfe4273 | |||
ee308851e5 | |||
33925330ab | |||
5ad95b47f6 | |||
7e2b7c3019 | |||
a30ec5502c | |||
cba63b08fc | |||
cf3aa0278a | |||
755e7119ce | |||
69fae9b22d | |||
973222dd24 | |||
688bca091f | |||
4373dced52 | |||
cc25583414 | |||
2893921099 | |||
55f4bdefb1 | |||
7a7540de60 | |||
580275de6e | |||
e518b37d92 | |||
ab6c21a426 | |||
63aead20f9 | |||
0fc5c2ca4a | |||
8c8bfd7ee7 | |||
5be0c8c3c3 | |||
9ba8f1d0e4 | |||
b9a7b8f6ff | |||
bf4adf39d9 | |||
c823c14e95 | |||
7623b8e48b | |||
bb19cdc162 | |||
ba95c452d5 | |||
13ab287ca2 | |||
884bf66199 | |||
aa3e5a8555 | |||
cb99c1ad30 | |||
3c9fddf615 | |||
9c6491eb29 | |||
1005f4585d | |||
2b97cc727d | |||
61f91d2a0a | |||
3d43a360b6 | |||
71b9cd04ed | |||
09299ebfec | |||
791771e308 | |||
a217faecee | |||
5b2a69b336 | |||
86f447985e | |||
a351f82ee5 | |||
8af228e009 | |||
8a69f78eb5 | |||
89da027ab8 | |||
bee97e90c6 | |||
9cdcf3c303 | |||
5fe33d34ce | |||
77f9dafecf | |||
48caeda15f | |||
b8beb3ef27 | |||
f864fa1d3a | |||
9a5a9cefec | |||
c9faa1ff01 | |||
b2cb346fa6 | |||
c311385d43 | |||
040f039ae9 | |||
35f6d9ab90 | |||
6ad06a7b31 | |||
c9ccde874d | |||
fa8750ae0d | |||
beb5f7f4bf | |||
e1b6894828 | |||
e1f57abcdd | |||
070837ecd0 | |||
f5f556961d | |||
722c59256a | |||
a3340f3994 | |||
b31ca9f095 | |||
7ad7923ef3 | |||
f79c6d843a | |||
ced7359b6d | |||
a6936f6726 | |||
3347acc028 | |||
15f0a279b9 | |||
35da2ffb21 | |||
aa7ae2fff1 | |||
7f31a3b98b | |||
bf2bb7b179 | |||
e909ed9288 | |||
4e1c1feb79 | |||
19e9bfbcdf | |||
3731229913 | |||
8684ccb73f | |||
ece94dfa79 | |||
037920f60d | |||
0542d95b61 | |||
b621eadc25 | |||
2bf762f3b3 | |||
f7d66192af | |||
37601075c8 | |||
ddb854ec46 | |||
df026e721c | |||
815440638d | |||
64880f982a | |||
5f6e4d3fb4 | |||
0281bed912 | |||
3d9d0e8071 | |||
e764c995de | |||
b9deb748b0 | |||
84a62b5d4c | |||
843a12ed7d | |||
2e186d1068 | |||
adaa43e6ea | |||
d144dc3aa4 | |||
f93afeb4be | |||
9e5773e033 | |||
3bfb53cdc5 | |||
653aae36a5 | |||
fbda619d8f | |||
151cbd90cd | |||
6aeb2895f2 | |||
95b66fe2bf | |||
f4bd6ef82b | |||
8c58536e17 | |||
8cc3c85a56 | |||
6eb7f26f1b | |||
e20ff1ad6f | |||
f507273d2d | |||
c79623d90f | |||
860b43149a | |||
141a1de976 | |||
932d97b373 | |||
8a1935170f | |||
4de252f33f | |||
e75a1d476f | |||
51dc9b5ba1 | |||
46341ca147 | |||
e7031bc8d8 | |||
8d0522358d | |||
83e9fd962f | |||
4c0a77c2c7 | |||
bfa8c73c19 | |||
175eabc661 | |||
71bd6bf643 | |||
1a5bde5cd3 | |||
dbaf9f803e | |||
eeb14a1946 | |||
7958604a1b | |||
a8ae01493e | |||
01939af228 | |||
b9153cd5da | |||
68decf6c89 | |||
9f45904cb4 | |||
da876a6e5a | |||
7960632eb0 | |||
7b3b764038 | |||
3f609f6134 | |||
8cfa16892b | |||
a0344921e7 | |||
bca2c9ea92 | |||
9fed276567 | |||
b3b302421d | |||
84ddd405b0 | |||
7ff8bc4e50 | |||
8e5a7a0cdb | |||
926b3cd83c | |||
5b4bd14f2a | |||
1264ab2dce | |||
5c70090970 | |||
bd6f813857 | |||
a074efd6e7 | |||
f8bd641648 | |||
0edb627bc9 | |||
102f8d9e0d | |||
5dd0c28834 | |||
4311745d44 | |||
36eba003a2 | |||
0799fba893 | |||
eb38bf1148 | |||
d070ae28c1 | |||
100b298870 | |||
c227fd586b | |||
a8287d29cc | |||
48bd375632 | |||
f8159e0769 | |||
345da64609 | |||
14b028e1ce | |||
9c5a7849f2 | |||
b9b6e0aa2f | |||
02ad290752 | |||
c5414bd312 | |||
7c3775538d | |||
6793d3b434 | |||
c4e6be8316 | |||
72263ffb3a | |||
4ecdec34a5 | |||
ce017becfb | |||
fae1922ce8 | |||
915f7ef10e | |||
d7ca6a69f1 | |||
c74d8fd67b | |||
07ddbc78a7 | |||
6d75ce1ec5 | |||
772fdb2b68 | |||
977e037e72 | |||
749eb47a2b | |||
61c8bd0c7c | |||
488ccce2ab | |||
6b97e11d53 | |||
bc86d2c749 | |||
277142b164 | |||
8fcebe63d1 | |||
7da88a5032 | |||
8df43e437a | |||
970048b24a | |||
abe9bf5ec0 | |||
f96ce8d4a8 | |||
86f29e045a | |||
2fa471c798 | |||
5297e946c5 | |||
d67c626411 | |||
116de7f183 | |||
f1c5a54559 | |||
6e02dba5da | |||
355989f481 | |||
35cdf2cb96 | |||
cdc223fe88 | |||
613a18f40f | |||
f78fc2ed9f | |||
46c67aab1f | |||
9e52bbe4a8 | |||
41be046841 | |||
499c86aaab | |||
33b9e684d9 | |||
12b56f4a3c | |||
0084431270 | |||
f6da1a39f7 | |||
f73f8b3ccb | |||
37a6e8b087 | |||
8b73e26eff | |||
9365203245 | |||
74811f7fe6 | |||
344c0a9cc4 | |||
7cfbf37610 | |||
1e262cca7b | |||
4d7e57eb37 | |||
05434aa74d | |||
6bb47eda65 | |||
460e8d402c | |||
d9f23edca6 | |||
2142a58e92 | |||
78378f1128 | |||
99805974ef | |||
358b957ed3 | |||
9e51c44d96 | |||
e948ed313f | |||
e810cbba63 | |||
ac8e36f64d | |||
61274f7488 | |||
94e7ea7669 | |||
7055e9fef5 | |||
937739e4a1 | |||
af5c1d2351 | |||
f09c0626b0 | |||
ba0345004e | |||
7834f0c0b8 | |||
516b7d716b | |||
7522e1deb2 | |||
185d1d49d3 | |||
dc9160436d | |||
d5a720efe2 | |||
2ef05b1ce0 | |||
116936db62 | |||
192c9b1c08 | |||
08396e825a | |||
1c1fc04bce | |||
2551930aed | |||
c6a67c9860 | |||
5b0c4a8022 | |||
2bf289b8ea | |||
16bb5e7fdb | |||
72f4252674 | |||
2b997e0487 | |||
fa9d43b715 | |||
18e4f20852 | |||
aa67a452f8 | |||
aa388aab0e | |||
fbc4cee09f | |||
07227f9677 | |||
5c4abfba6f | |||
1f2dc3a340 | |||
4c3afd9119 | |||
75d513a1e5 | |||
496c807a93 | |||
d6205dfcb1 | |||
17668dcc01 | |||
16a686916e | |||
9c60ba2de7 | |||
16489cb0b0 | |||
001c19a2b3 | |||
33a42c2547 | |||
08c8d62f5a | |||
920c0d47eb | |||
0d5646eb57 | |||
e68bca293a | |||
ee4091adab | |||
584d70329b | |||
4c3327bdb9 | |||
128f460e79 | |||
d59d656366 | |||
ba00df2878 | |||
51487dbaec | |||
4b01e23084 | |||
34f31faf02 | |||
5de4bb0fa4 | |||
2a115dce0a | |||
6b05584fac | |||
6ee54813db | |||
11dce73766 | |||
306dc4ca1f | |||
3441a0ae3e | |||
3a152cd13b | |||
e2a3efa833 | |||
199b0f3162 | |||
cebc8fd9e2 | |||
2545d4f8db | |||
882d0d4e7a | |||
ccc7da102b | |||
9fccef1890 | |||
62bfc324ee | |||
9ae53cfbc5 | |||
636bc47452 | |||
198a8b7507 | |||
c2165fb847 | |||
20d37b8488 | |||
d59040b128 | |||
d81531ee34 | |||
24561ea5f3 | |||
fd667a087b | |||
bbbd454592 | |||
60710e7d17 | |||
ee9a5b53d9 | |||
7bfe9fb4da | |||
3c74ae4704 | |||
aa3031af19 | |||
beb470d066 | |||
662af9bd2f | |||
cd695a6dcd | |||
71b724df6a | |||
f569726486 | |||
2abcd039c2 | |||
834eaca343 | |||
379dfe7655 | |||
cfd75065f8 | |||
2e7c40cc3f | |||
4ae2d6ca48 | |||
d4d37d66dd | |||
46dae1445a | |||
209fda3588 | |||
16c6250deb | |||
454a83cc7d | |||
bf08fbd4c1 | |||
c2837f1a71 | |||
7361fbe8d6 | |||
7dfd242f51 | |||
97c24c1d2a | |||
414d787d8e | |||
70359f95db | |||
973e1c9b85 | |||
6ea66c2a5a | |||
19a3d9ef17 | |||
17c8e9cf09 | |||
51a269a665 | |||
2adca6ae53 | |||
b1c54049c6 | |||
f5700cb171 | |||
6b0b54fedf | |||
75abc667de | |||
87bbea0050 | |||
e978ebea3f | |||
7e76dfefe5 | |||
88796330a7 | |||
580d0860c5 | |||
a64d2f223d | |||
6a1a25ceda | |||
82d8ad6d84 | |||
4376aa3405 | |||
027a114d50 | |||
7e11a268b8 | |||
4211d4a29b | |||
0afac71d02 | |||
6b4c562015 | |||
ae2a9913bb | |||
a48c2de3b8 | |||
4b241d3e48 | |||
f02e7cb75f | |||
e360ea1c38 | |||
d54ac3a42d | |||
207a7ec001 | |||
8e8b88aa00 | |||
45087d0d2e | |||
fab8e0b8a0 | |||
fd1e46146e | |||
b6fb72bdf8 | |||
b14c6f196b | |||
c99c52174f | |||
b9f4da099c | |||
66f8de3dc2 | |||
7d1f17fd52 | |||
61b5dc1bde | |||
43cf894a97 | |||
29631bc848 | |||
33b0d4d47e | |||
5abb69a7da | |||
28f4c7375f | |||
6b8b59f27e | |||
0bde76ec72 | |||
ffc2d7d52f | |||
761888b19f | |||
6a627f7646 | |||
83ec684369 | |||
09f4b675b7 | |||
261a05c798 | |||
0c3b8fb58d | |||
130584076d | |||
dacadc83c7 | |||
8e18880788 | |||
ea1796e91a | |||
c058295a13 | |||
a6c6a6e414 | |||
1a8f85d5ec | |||
e01185a678 | |||
f237ff4e2c | |||
7da5651e70 | |||
425d9b54ba | |||
c735e9d9d5 | |||
a5221808dc | |||
c6639a39c0 | |||
d0caf8d709 | |||
71cfe18e13 | |||
24846464d5 | |||
c9c306e560 | |||
73d8a904a7 | |||
1f5ccf63c1 | |||
357d04ee41 | |||
2617f92328 | |||
39fd79b9d7 | |||
6033cd96ba | |||
5944ebe2ec | |||
1a1fa1ab50 | |||
ea1bb04a49 | |||
79460043ee | |||
2278feeeec | |||
1efe1f73eb | |||
e5b66841dc | |||
822aea86bf | |||
d1c5764017 | |||
0eeeff2c99 | |||
5a1f76ace5 | |||
b6ce7a9758 | |||
fde2fff232 | |||
e15be92a54 | |||
0fc12f96a2 | |||
243fd6a1be | |||
b45b9c0c3c | |||
4ae2c279c7 | |||
8573fe09a9 | |||
65e833fc68 | |||
1eec45fb63 | |||
aa49dc412f | |||
e845c67441 | |||
be62945ec8 | |||
1dbc01e8a3 | |||
44ad2aecf8 | |||
7f4d2d7575 | |||
adbf4b9a88 | |||
ac79a443a9 | |||
091c7a1a3c | |||
821372c229 | |||
82f25f34b9 | |||
9fa4e642ff | |||
5400b8c0cf | |||
e39f1c743d | |||
fd55f646c1 | |||
1ec38f35ee | |||
7aff4198d9 | |||
e17d4ed9ab | |||
9f2bd23e7f | |||
1a4c226f4f | |||
13067ce8e1 | |||
82964e0200 | |||
b867ccf44c | |||
e5b56114f9 | |||
fac504c9f3 | |||
3d786d433d | |||
7a9e530a74 | |||
8c9c31fcc3 | |||
938eac8a68 | |||
33fb4d5720 | |||
1eb30ac221 | |||
206a6e7596 | |||
e859cc2b8a | |||
02171a401d | |||
2ae5c5effe | |||
61331d461c | |||
ce3a361be6 | |||
af856fe2f9 | |||
baccfcf990 | |||
a31fcc2563 | |||
c056e4ec1e | |||
67a8cc6a28 | |||
91566b318b | |||
5e38219fe7 | |||
f8e95672d4 | |||
68eac507e4 | |||
fa8ebed66c | |||
f60c8e0577 | |||
fa3865a9a9 | |||
140f47049b | |||
9ef8b1f891 | |||
247873a027 | |||
c4faf8ff6a | |||
600d74dbb5 | |||
8436cd3b66 | |||
2179b4789f | |||
30c5d76dbf | |||
d2b4aa8bb8 | |||
d7e3acf098 | |||
ff0c8d2f07 | |||
8cf0a2372f | |||
ea63371dee | |||
689da89e89 | |||
75f7212595 | |||
1cd755a378 | |||
e4b9649681 | |||
fb208f3814 | |||
9ed577c0d8 | |||
4096acc962 | |||
1349be0b49 | |||
1bb23f8dda | |||
b8995aa651 | |||
e5f593eba4 | |||
3b50516e17 | |||
7b942b4fec | |||
9d4808737a | |||
e1042e6725 | |||
8f1369e0ff | |||
2709cb7f07 | |||
a8be25bd72 | |||
ae4c59f110 | |||
3fbba09e62 | |||
b994883e7e | |||
9ad2fac5d4 | |||
043ad6ce47 | |||
4e6747ffa9 | |||
caf6bbdd21 | |||
50cf84a237 | |||
c2b5ec09b5 | |||
e11fbb3359 | |||
3582ad731d | |||
4b9c77e962 | |||
37b30cb2d9 | |||
ea9f36d5a5 | |||
98419e68d7 | |||
370a21101f | |||
b2811e01f4 | |||
df0cc09c56 | |||
e79a614167 | |||
ce6b209384 | |||
23ce80ee6a | |||
8701ce8e71 | |||
c6b3c7a00f | |||
84ae222263 | |||
b3eb89c178 | |||
b024043ca2 | |||
d15f89aa81 | |||
c4a50bc586 | |||
6536e0a28f | |||
8f4d6363a8 | |||
0b420615de | |||
4582c108f2 | |||
39974f367c | |||
e33c72470d | |||
7cfe12f137 | |||
ed2527dd13 | |||
037bc52bdf | |||
2b8d31a13b | |||
2d99ce0b3b | |||
b020563132 | |||
031f6b4792 | |||
a4674ed7bb | |||
f1fe5db242 | |||
e2a99ce4aa | |||
ac3d34b63e | |||
11556dd0aa | |||
e82c36b07a | |||
3e8c09ef0d | |||
67d2c52dab | |||
603161ebe4 | |||
7d813ac017 | |||
f3ba42d867 | |||
6abf457fb3 | |||
0cb33ec99b | |||
d49ad5951b | |||
bf81138941 | |||
60c2008daa | |||
44974fcc86 | |||
3be31e0934 | |||
232426ff23 | |||
d8677b0cdd | |||
8f5762c1ac | |||
7380410e28 | |||
5a992a9254 | |||
5f8bdab7fd | |||
91e99a66b5 | |||
c2e50200e8 | |||
cbe5c46556 | |||
a67096fea0 | |||
ffaa48e228 | |||
aa335d38d2 | |||
ac815530e6 | |||
61e75293d7 | |||
89a02d6a40 | |||
515369b938 | |||
9b8bd116e6 | |||
e1e301ebc7 | |||
334c0adf63 | |||
1acc1dae89 | |||
f683a2226e | |||
ccfc7cca91 | |||
cb955eaa02 | |||
bf3ef459c9 | |||
3a0c2eca64 | |||
f77735e741 | |||
9fb528b1c0 | |||
738c78b706 | |||
bf5b548e7e | |||
aa1fd24f18 | |||
4f10d8d310 | |||
c9948bac8e | |||
ad4fc918ef | |||
99c5a5e240 | |||
244f2904cf | |||
d300bd034b | |||
9449cb4ea7 | |||
75a1346163 | |||
440f882eaf | |||
094fca2665 | |||
dd2d9e000b | |||
2faf50407e | |||
9cbbe4d715 | |||
035473d846 | |||
1eba16843f | |||
4408b5157a | |||
cc5ef1ee1f | |||
bba502758a | |||
5aa8a3f995 | |||
cea1918c49 | |||
6769ad8969 | |||
38505f4636 | |||
d6b45635e9 | |||
8a9639ab6f | |||
8386e53d80 | |||
034c5d96f4 | |||
a97064c0ef | |||
0857703870 | |||
50614a4399 | |||
029391c4e5 | |||
a111fc82ef | |||
fc67438843 | |||
6baf8dba24 | |||
729e662ef0 | |||
f46ebafe03 | |||
cedeace2fb | |||
21675577c1 | |||
43a92a1432 | |||
84dc11a7fb | |||
36e4a71db7 | |||
86341001e8 | |||
0ac0306424 | |||
3a08a627aa | |||
730e30d25e | |||
503d1394ea | |||
f49d4f659d | |||
762c7a0dd2 | |||
8e71524c0f | |||
c2b4b23d75 | |||
221c8f7f9e | |||
cb76629c20 | |||
035bafb668 | |||
4fadebf14a | |||
10152c9668 | |||
33f859d8ce | |||
e973d58307 | |||
d0eebca0fd | |||
a03fd7210f | |||
7795237e60 | |||
91526bd1ee | |||
7dc18b5b00 | |||
90e5fc9398 | |||
a778fa2c58 | |||
3e6bff15b5 | |||
be11d8650e | |||
ebe50ff58e | |||
91c06f41b2 | |||
afdaabc0a8 | |||
8bba46a997 | |||
3cd7b2f855 | |||
87f33e284a | |||
e035500b54 | |||
ad3cb047c6 | |||
0ed2168295 | |||
4e215f4cd3 | |||
1e8de9a0c7 | |||
3bfa9e3f05 | |||
01e8d59b7e | |||
483351b9db | |||
904ccf83b5 | |||
328decd842 | |||
6414af73c1 | |||
f98c0492a2 | |||
1df42cc567 | |||
9f0d2e8e97 | |||
5e96ffde32 | |||
cada22959b | |||
e0e7bd55d9 | |||
28c3170ad4 | |||
3a81d58f79 | |||
81e593c027 | |||
4ccc2c2217 | |||
0f610b4062 | |||
6e36e8bcd1 | |||
a28cc207d1 | |||
7047677180 | |||
fd625b8751 | |||
1f94a85391 | |||
54b207f46a | |||
145555a857 | |||
3a7ccd3668 | |||
3d4ea6b2fd | |||
ae01e4e15a | |||
30986bd92b | |||
17b97ad71f | |||
937132d52f | |||
06cd63186d | |||
d447f11bfd | |||
4c68600a96 | |||
69a190000f | |||
e7fabbcc34 | |||
3a94beba78 | |||
f5bf4d3c67 | |||
27ba81465e | |||
79a6623389 | |||
bb0bb7a44e | |||
658b24c9a4 | |||
2875ebb8be | |||
2aceb8f189 | |||
7ed38a17d3 | |||
5281f9abe9 | |||
a98528c96e | |||
7d52b68568 | |||
a39a885353 | |||
e5bdad8197 | |||
a40f0cf9c7 | |||
88f92eb3c7 | |||
be1f2a90fa | |||
78766416ca | |||
e5bc1fb951 | |||
fa4098e198 | |||
aef5fb6605 | |||
fdf12833f4 | |||
843f9ab9bb | |||
bbda25d8d4 | |||
a47be4c3fc | |||
1f9e5caed9 | |||
877fb5f513 | |||
2deebf187c | |||
972018a365 | |||
f43972ad90 | |||
d7127d0fdb | |||
98d50c5af1 | |||
c1607032ce | |||
42f1d1cc9d | |||
f622ee0a8b | |||
1ed84751d1 | |||
2ee093a8dd | |||
26adb9abf7 | |||
501293334a | |||
7bf107cc0b | |||
8fd6cdaf3b | |||
d4f0bde5e1 | |||
73cdf18b94 | |||
5f4d05f349 | |||
5d43eacff4 | |||
7e20f7799b | |||
0cc23ba431 | |||
51c7fdc40e | |||
cb6c2dbe5d | |||
5fe47451dc | |||
3d776af3cc | |||
b7f0bca5bb | |||
e85b6e594b | |||
4093d2079d | |||
108ab94f5b | |||
88b854953d | |||
c5f99f228b | |||
9189305c29 | |||
0ac70b0858 | |||
5348348d88 | |||
7644f4e6d9 | |||
34d6adef57 | |||
fbd44c0c28 | |||
f69519c603 | |||
784355e13a | |||
2342f24566 | |||
12d4295c01 | |||
594de8fd5d | |||
affda3fb92 | |||
f00cffe46d | |||
78d9fb668b | |||
8b49f0324c | |||
b3c23dac12 | |||
a56e58c1cf | |||
1e3265b02b | |||
7e777f07ee | |||
3e3dd13302 | |||
afb0e2b9e4 | |||
ccdd85c14d | |||
4db1c30d76 | |||
f7d812618b | |||
5d74055659 | |||
6cfc88cf9b | |||
1473399b08 | |||
047ef6526d | |||
f3cc8de619 | |||
e0aa80b63c | |||
b2424da287 | |||
3876614b62 | |||
38b71f5349 | |||
b3c91619f3 | |||
b7e36142bc | |||
098526cb0c | |||
62d8d2fd71 | |||
06655b3d1d | |||
7213c99d05 | |||
e2f7de6493 | |||
8193245c39 | |||
c17ffb3ab2 | |||
0e84592206 | |||
e505a1f823 | |||
10c9caab48 | |||
fcbd5a45c1 | |||
4dc53f4cf7 | |||
f15d74c051 | |||
0cef271a29 | |||
f71ce2419d | |||
355be549a5 | |||
fb96a10b67 | |||
90cdad6f51 | |||
0e74462ae7 | |||
462a22030b | |||
c7f0100072 | |||
60535b5177 | |||
0c067612ba | |||
78cbf141bd | |||
868fb1e614 | |||
8319dc94b4 | |||
b5785eefcc | |||
3415dbb31b | |||
dae684616c | |||
3e0656b356 | |||
d84a92ba2b | |||
79dadddfad | |||
f7d5d62a77 | |||
356811c13e | |||
50dfa4f876 | |||
f7f409af51 | |||
7a8c103db1 | |||
29a6b8aaaa | |||
acc56ff7d4 | |||
0ee5e15c7d | |||
ab1b77453a | |||
379adef007 | |||
655dae666e | |||
7172bcadd8 | |||
669bab0b2e | |||
4ada589b40 | |||
3fdab43903 | |||
c8efe1f4ec | |||
1cca88c32b | |||
ac6ec19bfd | |||
3bc33d67b3 | |||
6b584350b2 | |||
705f9962ad | |||
d1075e3cdb | |||
4656ef2326 | |||
7f044f1a08 | |||
d943498eaa | |||
309af499f6 | |||
49d0a726d3 | |||
4f4638b2fb | |||
700c81d09a | |||
17d4839150 | |||
141a867b06 | |||
92e029f433 | |||
d088f1f828 | |||
b603d7543c | |||
2efc18edfb |
3
.github/FUNDING.yml
vendored
Normal file
3
.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [fleschutz] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
@ -1,33 +0,0 @@
|
||||
Abbr,Term
|
||||
ATL,Hartsfield-Jackson Atlanta International Airport (USA)
|
||||
CAN,Guangzhou Baiyun International Airport (China)
|
||||
CTU,Chengdu Shuangliu International Airport (China)
|
||||
DCA,Ronald Reagan Washington National Airport
|
||||
DFW,Dallas/Fort Worth International Airport (USA)
|
||||
EWR,Newark Liberty International Airport
|
||||
GXH,Gannan Xiahe Airport
|
||||
GXY,Greeley-Weld County Airport
|
||||
GYY,Gary/Chicago International Airport
|
||||
IAD,Washington Dulles International Airport in Virginia
|
||||
ILY,Islay Airport (Scotland)
|
||||
ORD,"O'Hare International Airport in Chicago,Illinois"
|
||||
OXF,London Oxford Airport
|
||||
OXR,Oxnard Airport
|
||||
PNS,"Pensacola,Florida"
|
||||
SAD,Safford Regional Airport
|
||||
XFN,Xiangyang Liuji Airport
|
||||
XFW,Hamburg Finkenwerder Airport
|
||||
XGG,Gorom Gorom Airport
|
||||
XGN,Xangongo Airport
|
||||
XGR,Kangiqsualujjuag (Georges River) Airport
|
||||
XKA,Kantchari Airport
|
||||
XKH,Xieng Khouang Airport
|
||||
XKS,Kasabonika Airport
|
||||
XKY,Kaya Airport
|
||||
XNA,Northwest Arkansas Regional Airport
|
||||
XNN,Xining Caojiabao Airport
|
||||
XQP,Quepos La Managua Airport
|
||||
XQU,Qualicum Beach Airport
|
||||
XYA,Yandina Airport
|
||||
XZA,Zabré Airport
|
||||
YEM,Manitowaning/Manitoulin East Municipal Airport
|
|
@ -1,10 +0,0 @@
|
||||
Abbr,Term
|
||||
EDDM,Munich Airport in Bavaria (Germany)
|
||||
KATL,Hartsfield-Jackson Atlanta International Airport (USA)
|
||||
KBWI,Baltimore/Washington International Airport in Baltimore (USA)
|
||||
KIAD,Washington Dulles International Airport in Virginia (USA)
|
||||
KDFW,Dallas/Fort Worth International Airport (USA)
|
||||
WSSL,Seletar Airport in Singapore
|
||||
WSSS,Changi Airport in Singapore
|
||||
ZGGG,Guangzhou Baiyun International Airport in China
|
||||
ZUUU,Chengdu Shuangliu International Airport in China
|
|
@ -1,3 +0,0 @@
|
||||
Abbr,Term
|
||||
Leo,an American Quarter Horse
|
||||
Leo,"Leonberger, a breed of dog"
|
|
@ -1,269 +0,0 @@
|
||||
Abbr,Term
|
||||
AC,Axiom of Choice, or set of absolutely continuous functions.
|
||||
a.c.,absolutely continuous.
|
||||
acrd,inverse chord function.
|
||||
ad,adjoint representation (or adjoint action) of a Lie group.
|
||||
adj,adjugate of a matrix.
|
||||
a.e.,almost everywhere.
|
||||
Ai,Airy function.
|
||||
AL,Action limit.
|
||||
Alt,alternating group (Alt(n) is also written as An.)
|
||||
A.M.,arithmetic mean.
|
||||
arccos,inverse cosine function.
|
||||
arccosec,inverse cosecant function. (Also written as arccsc.)
|
||||
arccot,inverse cotangent function.
|
||||
arccsc,inverse cosecant function. (Also written as arccosec.)
|
||||
arcexc,inverse excosecant function. (Also written as arcexcsc, arcexcosec.)
|
||||
arcexcosec,inverse excosecant function. (Also written as arcexcsc, arcexc.)
|
||||
arcexcsc,inverse excosecant function. (Also written as arcexcosec, arcexc.)
|
||||
arcexs,inverse exsecant function. (Also written as arcexsec.)
|
||||
arcexsec,inverse exsecant function. (Also written as arcexs.)
|
||||
arcosech,inverse hyperbolic cosecant function. (Also written as arcsch.)
|
||||
arcosh,inverse hyperbolic cosine function.
|
||||
arcoth,inverse hyperbolic cotangent function.
|
||||
arcsch,inverse hyperbolic cosecant function. (Also written as arcosech.)
|
||||
arcsec,inverse secant function.
|
||||
arcsin,inverse sine function.
|
||||
arctan,inverse tangent function.
|
||||
arctan2,inverse tangent function with two arguments. (Also written as atan2.)
|
||||
arg,argument of
|
||||
arg max,argument of the maximum.
|
||||
arg min,argument of the minimum.
|
||||
arsech,inverse hyperbolic secant function.
|
||||
arsinh,inverse hyperbolic sine function.
|
||||
artanh,inverse hyperbolic tangent function.
|
||||
a.s.,almost surely.
|
||||
atan2,inverse tangent function with two arguments. (Also written as arctan2.)
|
||||
A.P.,arithmetic progression.
|
||||
Aut,automorphism group.
|
||||
bd,boundary. (Also written as fr or ∂.)
|
||||
Bi,Airy function of the second kind.
|
||||
BIDMAS,Brackets, Indices, Divide, Multiply, Add, Subtract.
|
||||
Bias,bias of an estimator
|
||||
BWOC,by way of contradiction
|
||||
Card,cardinality of a set. (Card(X) is also written #X, ♯X or |X|.)
|
||||
cas,cos + sin function.
|
||||
cdf,cumulative distribution function.
|
||||
c.f.,cumulative frequency.
|
||||
c.c.,complex conjugate.
|
||||
char,characteristic of a ring.
|
||||
Chi,hyperbolic cosine integral function.
|
||||
Ci,cosine integral function.
|
||||
cis,cos + i sin function. (Also written as expi.)
|
||||
Cl,conjugacy class.
|
||||
cl,topological closure.
|
||||
CLT,central limit theorem.
|
||||
cod, codom,codomain.
|
||||
cok, coker,cokernel.
|
||||
conv,convex hull of a set.
|
||||
Cor,corollary.
|
||||
corr,correlation.
|
||||
cos,cosine function.
|
||||
cosec,cosecant function. (Also written as csc.)
|
||||
cosech,hyperbolic cosecant function. (Also written as csch.)
|
||||
cosh,hyperbolic cosine function.
|
||||
cosiv,coversine function. (Also written as cover, covers, cvs.)
|
||||
cot,cotangent function. (Also written as ctg.)
|
||||
coth,hyperbolic cotangent function.
|
||||
cov,covariance of a pair of random variables.
|
||||
cover,coversine function. (Also written as covers, cvs, cosiv.)
|
||||
covercos,covercosine function. (Also written as cvc.)
|
||||
covers,coversine function. (Also written as cover, cvs, cosiv.)
|
||||
crd,chord function.
|
||||
csc,cosecant function. (Also written as cosec.)
|
||||
csch,hyperbolic cosecant function. (Also written as cosech.)
|
||||
ctg,cotangent function. (Also written as cot.)
|
||||
curl,curl of a vector field. (Also written as rot.)
|
||||
cvc,covercosine function. (Also written as covercos.)
|
||||
cvs,coversine function. (Also written as cover, covers, cosiv.)
|
||||
def,define or definition.
|
||||
deg,degree of a polynomial, or other recursively-defined objects such as well-formed formulas. (Also written as ∂.)
|
||||
del,del, a differential operator. (Also written as {\displaystyle \nabla }\nabla .)
|
||||
det,determinant of a matrix or linear transformation.
|
||||
dim,dimension of a vector space.
|
||||
div,divergence of a vector field.
|
||||
DNE,a solution for an expression does not exist, or is undefined. Generally used with limits and integrals.
|
||||
dom,domain of a function. (Or, more generally, a relation.)
|
||||
End,categories of endomorphisms.
|
||||
Ei,exponential integral function.
|
||||
epi,epigraph of a function.
|
||||
Eqn,equation.
|
||||
erf,error function.
|
||||
erfc,complementary error function.
|
||||
etr,exponent of the trace.
|
||||
exc,excosecant function. (Also written as excsc, excosec.)
|
||||
excosec,excosecant function. (Also written as excsc, exc.)
|
||||
excsc,excosecant function. (Also written as excosec, exc.)
|
||||
exs,exsecant function. (Also written as exsec.)
|
||||
exsec,exsecant function. (Also written as exs.)
|
||||
exp,exponential function. (exp x is also written as ex.)
|
||||
expi,cos + i sin function. (Also written as cis.)
|
||||
expm1,exponential minus 1 function. (Also written as exp1m.)
|
||||
exp1m,exponential minus 1 function. (Also written as expm1.)
|
||||
Ext,Ext functor.
|
||||
ext,exterior.
|
||||
extr,a set of extreme points of a set.
|
||||
FIP,finite intersection property.
|
||||
FOC,first order condition.
|
||||
FOL,first-order logic.
|
||||
fr,boundary. (Also written as bd or ∂.)
|
||||
Frob,Frobenius endomorphism.
|
||||
Gal,Galois group. (Also written as Γ.)
|
||||
gcd,greatest common divisor of two numbers. (Also written as hcf.)
|
||||
gd,Gudermannian function.
|
||||
GF,Galois field.
|
||||
GF,generating function.
|
||||
GL,general linear group.
|
||||
GM,geometric mean.
|
||||
glb,greatest lower bound. (Also written as inf.)
|
||||
GP,geometric progression.
|
||||
grad,gradient of a function.
|
||||
hacover,hacoversine function. (Also written as hacovers, hcv.)
|
||||
hacovercos,hacovercosine function. (Also written as hcc.)
|
||||
hacovers,hacoversine function. (Also written as hacover, hcv.)
|
||||
hav,haversine function. (Also written as sem.)
|
||||
havercos,havercosine function. (Also written as hvc.)
|
||||
hcc,hacovercosine function. (Also written as hacovercos.)
|
||||
hcv,hacoversine function. (Also written as hacover, hacovers.)
|
||||
hcf,highest common factor of two numbers. (Also written as gcd.)
|
||||
H.M.,harmonic mean.
|
||||
HOL,higher-order logic.
|
||||
Hom,Hom functor.
|
||||
hom,hom-class.
|
||||
hot,higher order term
|
||||
HOTPO,half or triple plus one
|
||||
hvc,havercosine function. (Also written as havercos.)
|
||||
hyp,hypograph of a function.
|
||||
iff,if and only if.
|
||||
IH,induction hypothesis.
|
||||
iid,independent and identically distributed random variables.
|
||||
Im,imaginary part of a complex number (Also written as {\displaystyle \Im }\Im ).
|
||||
im,image
|
||||
inf,infimum of a set. (Also written as glb.)
|
||||
int,interior.
|
||||
I.o.,Infinitely often.
|
||||
ker,kernel.
|
||||
lb,binary logarithm (log2). (Also written as ld.)
|
||||
lcm,lowest common multiple (a.k.a. least common multiple) of two numbers.
|
||||
LCHS,locally compact Hausdorff second countable.
|
||||
ld,binary logarithm (log2). (Also written as lb.)
|
||||
lerp,linear interpolation.[5]
|
||||
lg,common logarithm (log10) or binary logarithm (log2).
|
||||
LHS,left-hand side of an equation.
|
||||
Li,offset logarithmic integral function.
|
||||
li,logarithmic integral function or linearly independent.
|
||||
lim,limit of a sequence, or of a function.
|
||||
lim inf,limit inferior.
|
||||
lim sup,limit superior.
|
||||
LLN,law of large numbers.
|
||||
ln,natural logarithm, loge.
|
||||
lnp1,natural logarithm plus 1 function.
|
||||
ln1p,natural logarithm plus 1 function.
|
||||
log,logarithm. (If without a subscript, this may mean either log10 or loge.)
|
||||
logh,natural logarithm, loge.
|
||||
LST,language of set theory.
|
||||
lub,least upper bound. (Also written sup.)
|
||||
max,maximum of a set.
|
||||
MGF,moment-generating function.
|
||||
M.I.,mathematical induction.
|
||||
min,minimum of a set.
|
||||
mod,modulo.
|
||||
Mp,metaplectic group.
|
||||
mtanh,modified hyperbolic tangent function. (Also written as mth.)
|
||||
mth,modified hyperbolic tangent function. (Also written as mtanh.)
|
||||
mx,matrix.
|
||||
NAND,not-and in logic.
|
||||
No.,number.
|
||||
NOR,not-or in logic.
|
||||
NTS,need to show.
|
||||
OBGF,ordinary bivariate generating function.
|
||||
ob,object class.
|
||||
ord,ordinal number of a well-ordered set.[4]
|
||||
pdf,probability density function.
|
||||
pf,proof.
|
||||
PGL,projective general linear group.
|
||||
PI,the constant 3.14159265359
|
||||
Pin,pin group.
|
||||
pmf,probability mass function.
|
||||
Pn,previous number.
|
||||
Pr,probability of an event
|
||||
PSL,projective special linear group.
|
||||
PSO,projective orthogonal group.
|
||||
PSU,projective special unitary group.
|
||||
PU,projective unitary group.
|
||||
QED,"Quod erat demonstrandum", a Latin phrase used at the end of a definitive proof.
|
||||
QEF,"quod erat faciendum", a Latin phrase sometimes used at the end of a geometrical construction.
|
||||
ran,range of a function.
|
||||
rank,rank of a matrix. (Also written as rk.)
|
||||
Re,real part of a complex number
|
||||
resp,respectively.
|
||||
RHS,right-hand side of an equation.
|
||||
rk,rank. (Also written as rank.)
|
||||
RMS, rms,root mean square.
|
||||
rng,non-unital ring.
|
||||
rot,rotor of a vector field. (Also written as curl.)
|
||||
RTP,required to prove.
|
||||
RV,random variable. (or as R.V.)
|
||||
R - Real numbers
|
||||
SD,standard deviation
|
||||
SE,standard error
|
||||
sec,secant function.
|
||||
sech,hyperbolic secant function.
|
||||
seg,initial segment of.[1]
|
||||
sem,haversine function. (Also written as hav.)
|
||||
SFIP,strong finite intersection property.
|
||||
sgn,sign function.
|
||||
Shi,hyperbolic sine integral function.
|
||||
Si,sine integral function.
|
||||
sin,sine function.
|
||||
sinc,sinc function.
|
||||
sinh,hyperbolic sine function.
|
||||
siv,versine function. (Also written as ver, vers.)
|
||||
SL,special linear group.
|
||||
SO,special orthogonal group.
|
||||
SOC,second order condition.
|
||||
Soln,solution.
|
||||
Sp,symplectic group.
|
||||
Sp,trace of a matrix, from the German "spur" used for the trace.
|
||||
sp,linear span of a set of vectors. (Also written as span or written with angle brackets.)
|
||||
Spec,spectrum of a ring.
|
||||
Spin,spin group.
|
||||
s.t.,such that or so that or subject to.
|
||||
st,standard part function.
|
||||
STP,[it is] sufficient to prove.
|
||||
SU,special unitary group.
|
||||
sup,supremum of a set. (Also written as lub, which stands for least upper bound.)
|
||||
supp,support of a function.
|
||||
swish,swish function, an activation function in data analysis.
|
||||
Sym,symmetric group (Sym(n) is also written as Sn) or symmetric algebra.
|
||||
tan,tangent function. (Also written as tgn, tg.)
|
||||
tanh,hyperbolic tangent function.
|
||||
TAU,the constant 6.283185307179586476925286766559
|
||||
TFAE,the following are equivalent.
|
||||
tg,tangent function. (Also written as tan, tgn.)
|
||||
tgn,tangent function. (Also written as tan, tg.)
|
||||
Thm,theorem.
|
||||
Tor,Tor functor.
|
||||
Tr,trace, either the field trace, or the trace of a matrix or linear transformation.
|
||||
undef,a function or expression is undefined
|
||||
V,volume.
|
||||
var,variance of a random variable.
|
||||
vcs,vercosine function. (Also written as vercos.)
|
||||
ver,versine function. (Also written as vers, siv.)
|
||||
vercos,vercosine function. (Also written as vcs.)
|
||||
vers,versine function. (Also written as ver, siv.)
|
||||
W^5,which was what we wanted. Synonym of Q.E.D.
|
||||
walog,without any loss of generality.
|
||||
wff,well-formed formula.
|
||||
whp,with high probability.
|
||||
wlog,without loss of generality.
|
||||
WMA,we may assume.
|
||||
WO,well-ordered set
|
||||
wp1,with probability 1.
|
||||
wrt,with respect to or with regard to.
|
||||
WTP,want to prove
|
||||
WTS,want to show
|
||||
XOR,exclusive or in logic
|
||||
XYZ,Cartesian coordinate system (x,y,z)
|
||||
ZF,Zermelo–Fraenkel axioms of set theory
|
||||
ZFC,Zermelo–Fraenkel axioms (with the Axiom of Choice) of set theory
|
Can't render this file because it has a wrong number of fields in line 2.
|
@ -1,14 +0,0 @@
|
||||
Abbr,Term
|
||||
PR,per the rectum
|
||||
pr,per the rectum
|
||||
PT,prothrombin time
|
||||
PTT,partial thromboplastin time
|
||||
pulv,powder
|
||||
PV,per the vagina
|
||||
q,every
|
||||
q12h,every 12 hours
|
||||
qd,daily
|
||||
q1d,daily
|
||||
q2h,every 2 hours
|
||||
q3h,every 3 hours
|
||||
q4h,every 4 hours
|
|
@ -1,21 +0,0 @@
|
||||
Language, Popularity, Change
|
||||
C, 12.54, -4.65
|
||||
Python, 11.84, +3.48
|
||||
Java, 11.54, -4.56
|
||||
C++, 7.36, +1.41
|
||||
C#, 4.33, -0.40
|
||||
Visual Basic, 4.01, -0.68
|
||||
JavaScript, 2.33, +0.06
|
||||
PHP, 2.21, -0.05
|
||||
Assembly language, 2.05, +1.09
|
||||
SQL, 1.88, +0.15
|
||||
Classic Visual Basic, 1.72, +1.07
|
||||
Groovy, 1.29, +0.87
|
||||
Ruby, 1.23, +0.25
|
||||
R, 1.20, -0.99
|
||||
Perl, 1.18, +0.36
|
||||
Swift, 1.10, -0.35
|
||||
Fortran, 1.07, +0.80
|
||||
Delphi/Object Pascal, 1.06, +0.47
|
||||
MATLAB, 1.05, +0.15
|
||||
Go, 0.95, -0.06
|
|
@ -1 +0,0 @@
|
||||
/* Exported by export-scripts2serenade.ps1 */
|
@ -1,27 +0,0 @@
|
||||
APPNAME, CATEGORY, APPID
|
||||
"7-Zip", "file tool", "XPDNKVCX4QD2DC"
|
||||
"Aquile Reader", "ebook reader", "9P08T4JLTQNK"
|
||||
"CrystalDiskInfo", "HDD/SSD tool", "XP8K4RGX25G3GM"
|
||||
"Google Chrome", " desktop browser", "Google.Chrome"
|
||||
"Dopamine", "audio player", "Digimezzo.Dopamine.2"
|
||||
"Dropbox", "file sync", "Dropbox.Dropbox"
|
||||
"Git for Windows", "code management", "Git.Git"
|
||||
"IrfanView", "image viewer", "9PJZ3BTL5PV6"
|
||||
"inSSIDer", "Wifi tool", "MetaGeek.inSSIDer"
|
||||
"LibreOffice", "office suite", "TheDocumentFoundation.LibreOffice"
|
||||
"Microsoft Teams", "messenger", "XP8BT8DW290MPQ"
|
||||
"Mozilla Firefox", "desktop browser", "9NZVDKPMR9RD"
|
||||
"Mozilla Thunderbird","email client", "Mozilla.Thunderbird"
|
||||
"Mp3tag", "mp3 tag editor", "9NN77TCQ1NC8"
|
||||
"Netflix", "video player", "9WZDNCRFJ3TJ"
|
||||
"Notepad++", "text editor", "Notepad++.Notepad++"
|
||||
"One Calendar", "desktop calendar", "9WZDNCRDR0SF"
|
||||
"Signal", "messenger", "OpenWhisperSystems.Signal"
|
||||
"smartmontools", "HDD/SSD tool", "smartmontools.smartmontools"
|
||||
"Spotify", "music and podcasts","9NCBCSZSJRSB"
|
||||
"Typora", "Markdown editor", "Typora.Typora"
|
||||
"Visual Studio Code", "code editor", "XP9KHM4BK9FZ7Q"
|
||||
"VLC", "media player", "XPDM1ZW6815MQM"
|
||||
"Windows Terminal", "terminal application", "9N0DX20HK701"
|
||||
"WhatsApp", "messenger", "9NKSQGP7F2NH"
|
||||
"Zoom", "video conferences", "Zoom.Zoom"
|
|
@ -1,201 +0,0 @@
|
||||
Domain
|
||||
a.root-servers.net
|
||||
accounts.google.com
|
||||
activity.windows.com
|
||||
airbnb.at
|
||||
airbnb.com
|
||||
airbnb.de
|
||||
aka.ms
|
||||
alternate.de
|
||||
api.dropboxapi.com
|
||||
api.met.no
|
||||
api.serenade.ai
|
||||
api1.origin.com
|
||||
arc.msn.com
|
||||
arte.tv
|
||||
assets.msn.com
|
||||
amazon.com
|
||||
amazon.co.uk
|
||||
amazon.de
|
||||
amazon.fr
|
||||
amazon.it
|
||||
b.root-servers.net
|
||||
banking.ing-diba.de
|
||||
bing.com
|
||||
bing.de
|
||||
bing.fr
|
||||
bitbucket.org
|
||||
blitzortung.org
|
||||
bolt.dropbox.com
|
||||
c.root-servers.net
|
||||
catalog.gamepass.com
|
||||
changelogs.ubuntu.com
|
||||
client.dropbox.com
|
||||
client.wns.windows.com
|
||||
clients1.google.com
|
||||
clients2.google.com
|
||||
clients3.google.com
|
||||
clients4.google.com
|
||||
contacts.google.com
|
||||
d.dropbox.com
|
||||
d.root-servers.net
|
||||
dasoertliche.de
|
||||
deepl.com
|
||||
dell.com
|
||||
de.yahoo.com
|
||||
discord.com
|
||||
discordapp.com
|
||||
dhl.de
|
||||
download.windowsupdate.com
|
||||
duckduckgo.com
|
||||
e.root-servers.net
|
||||
earth.google.com
|
||||
ebay.com
|
||||
ebay.de
|
||||
ebay.fr
|
||||
ebook3000.com
|
||||
edition.cnn.com
|
||||
f.root-servers.net
|
||||
facebook.com
|
||||
facebook.de
|
||||
facebook.fr
|
||||
flightradar24.com
|
||||
fonts.google.com
|
||||
fonts.googleapis.com
|
||||
fonts.gstatic.com
|
||||
foto-webcam.eu
|
||||
foursquare.com
|
||||
g.root-servers.net
|
||||
github.com
|
||||
github.map.fastly.net
|
||||
gmail.com
|
||||
google.at
|
||||
google.com
|
||||
google.de
|
||||
google.fr
|
||||
google.it
|
||||
googleapis.com
|
||||
gstatic.com
|
||||
h.root-servers.net
|
||||
holidaycheck.de
|
||||
hornbach.de
|
||||
i.root-servers.net
|
||||
i.ytimg.com
|
||||
IEEE.org
|
||||
ibm.com
|
||||
icons8.com
|
||||
imap.googlemail.com
|
||||
install.robertsspaceindustries.com
|
||||
ipfs.io
|
||||
ipv6.msftconnecttest.com
|
||||
j.root-servers.net
|
||||
k.root-servers.net
|
||||
l.root-servers.net
|
||||
launcher2.robertsspaceindustries.com
|
||||
licensing.mp.microsoft.com
|
||||
live.github.com
|
||||
live.thunderbird.net
|
||||
livepatch.canonical.com
|
||||
login.live.com
|
||||
longfiles.com
|
||||
m.root-servers.net
|
||||
mail.google.com
|
||||
map.blitzortung.org
|
||||
maps.google.com
|
||||
maps.google.de
|
||||
maps.google.fr
|
||||
microsoft.com
|
||||
mozilla.org
|
||||
mtalk.google.com
|
||||
music.google.com
|
||||
news.google.com
|
||||
news.google.de
|
||||
news.google.fr
|
||||
news.url.google.com
|
||||
ntp.ubuntu.com
|
||||
ogs.google.com
|
||||
open.spotify.com
|
||||
opera.com
|
||||
photos.google.com
|
||||
pixabay.com
|
||||
play.google.com
|
||||
plex.tv
|
||||
presence.teams.microsoft.com
|
||||
ptbtime1.ptb.de
|
||||
ptbtime2.ptb.de
|
||||
ptbtime3.ptb.de
|
||||
redhat.com
|
||||
reichelt.de
|
||||
robertsspaceindustries.com
|
||||
secure.download.dm.origin.com
|
||||
semonkeys.net
|
||||
settings.data.microsoft.com
|
||||
settings-win.data.microsoft.com
|
||||
sites.google.com
|
||||
slashdot.org
|
||||
speed.cloudflare.com
|
||||
speedtest.net
|
||||
ssl.gstatic.com
|
||||
stackoverflow.com
|
||||
start.thunderbird.net
|
||||
static.nvidiagrid.net
|
||||
storage.googleapis.com
|
||||
substrate.office.com
|
||||
sunnyportal.com
|
||||
t-online.de
|
||||
t0.gstatic.com
|
||||
teams.microsoft.com
|
||||
telemetry.dropbox.com
|
||||
tile-service.weather.microsoft.com
|
||||
time.windows.com
|
||||
toggl.com
|
||||
toom.de
|
||||
track.toggl.com
|
||||
translate.google.de
|
||||
twitter.com
|
||||
twitter.de
|
||||
ubuntu.com
|
||||
update.googleapis.com
|
||||
wetter.com
|
||||
wttr.in
|
||||
www.apple.com
|
||||
www.arte.tv
|
||||
www.bbc.co.uk
|
||||
www.bild.de
|
||||
www.booking.com
|
||||
www.cdc.gov
|
||||
www.dropbox.com
|
||||
www.ecosia.org
|
||||
www.etsy.com
|
||||
www.expedia.com
|
||||
www.fleschutz.de
|
||||
www.focus.de
|
||||
www.foto-webcam.eu
|
||||
www.golem.de
|
||||
www.google.com
|
||||
www.googleapis.com
|
||||
www.gstatic.com
|
||||
www.heise.de
|
||||
www.hulu.com
|
||||
www.instagram.com
|
||||
www.msn.com
|
||||
www.nasa.gov
|
||||
www.netflix.com
|
||||
www.nytimes.com
|
||||
www.paypal.com
|
||||
www.redbull.com
|
||||
www.schneier.com
|
||||
www.techstage.de
|
||||
www.tiktok.com
|
||||
www.ufainc.com
|
||||
www.walmart.com
|
||||
www.whatsapp.com
|
||||
www.whitehouse.gov
|
||||
www.windy.com
|
||||
www.wikipedia.at
|
||||
www.wikipedia.de
|
||||
www.wikipedia.fr
|
||||
www.wikipedia.org
|
||||
www.wired.com
|
||||
www.youtube.com
|
||||
www.zdf.de
|
|
@ -1,28 +0,0 @@
|
||||
GROUP, FOLDERNAME, BRANCH, FULL, URL
|
||||
Dev, base256unicode, main, no, "git@github.com:fleschutz/base256unicode"
|
||||
Dev, bazel, master, no, "git@github.com:bazelbuild/bazel"
|
||||
Dev, cmake, master, no, "git@github.com:Kitware/CMake"
|
||||
Fun, cmatrix, master, no, "git@github.com:abishekvashok/cmatrix"
|
||||
Tool, cmark, master, no, "git@github.com:commonmark/cmark"
|
||||
Dev, CWTS, master, no, "git@github.com:fleschutz/CWTS"
|
||||
Math, CSS, main, no, "git@github.com:chikitpao/CSS"
|
||||
Tool, elasticsearch, main, no, "git@github.com:elastic/elasticsearch"
|
||||
Tool, go-ipfs, master, no, "git@github.com:ipfs/go-ipfs"
|
||||
Tool, grafana, main, no, "git@github.com:grafana/grafana"
|
||||
Tool, leon, master, no, "git@github.com:leon-ai/leon"
|
||||
Dev, llvm, master, no, "git@github.com:llvm/llvm-project"
|
||||
Math, LSS, master, no, "git@github.com:fleschutz/LSS"
|
||||
Dev, ninja, master, no, "git@github.com:ninja-build/ninja"
|
||||
Libs, opencv, master, no, "git@github.com:opencv/opencv"
|
||||
Tool, operating-systems, main, no, "git@github.com:fleschutz/operating-systems"
|
||||
Shell, PowerShell, master, no, "git@github.com:fleschutz/PowerShell"
|
||||
Shell, pwsh, master, no, "git@github.com:PowerShell/PowerShell"
|
||||
Dev, protobuf, main, no, "git@github.com:protocolbuffers/protobuf"
|
||||
Dev, rust, master, no, "git@github.com:rust-lang/rust"
|
||||
Tool, smartmontools, master, no, "git@github.com:smartmontools/smartmontools"
|
||||
Tool, talk2windows, main, no, "git@github.com:fleschutz/talk2windows.git"
|
||||
Tool, tensorflow, master, no, "git@github.com:tensorflow/tensorflow"
|
||||
Tool, terminal, main, no, "git@github.com:microsoft/terminal"
|
||||
Dev, tinycc, mob, no, "git@github.com:TinyCC/tinycc"
|
||||
Tool, voice2json, master, no, "git@github.com:synesthesiam/voice2json"
|
||||
Tool, zfs, master, no, "git@github.com:openzfs/zfs"
|
|
@ -1,69 +0,0 @@
|
||||
Joke
|
||||
"Chuck Norris doesnt read books. He stares them down until he gets the information he wants."
|
||||
"Time waits for no man. Unless that man is Chuck Norris."
|
||||
"If you spell Chuck Norris in Scrabble, you win. Forever."
|
||||
"Chuck Norris breathes air five times a day."
|
||||
"In the Beginning there was nothing then Chuck Norris roundhouse kicked nothing and told it to get a job."
|
||||
"Chuck Norris has a mug of nails instead of coffee in the morning."
|
||||
"If Chuck Norris were to travel to an alternate dimension in which there was another Chuck Norris and they both fought, they would both win."
|
||||
"The dinosaurs looked at Chuck Norris the wrong way once. You know what happened to them."
|
||||
"Chuck Norris tears cure cancer. Too bad he has never cried."
|
||||
"Chuck Norris once roundhouse kicked someone so hard that his foot broke the speed of light"
|
||||
"Since 1940, the year Chuck Norris was born, roundhouse kick related deaths have increased 13,000 percent."
|
||||
"Chuck Norris does not own a stove, oven, or microwave , because revenge is a dish best served cold."
|
||||
"Chuck Norris does not sleep. He waits."
|
||||
"There is no chin behind Chuck Norris beard. There is only another fist."
|
||||
"The chief export of Chuck Norris is pain."
|
||||
"Chuck Norris recently had the idea to sell his pee as a canned beverage. Its now called Red Bull."
|
||||
"If paper beats rock, rock beats scissors, and scissors beats paper, what beats all 3 at the same time? Chuck Norris."
|
||||
"On the 7th day, God rested Chuck Norris took over."
|
||||
"Chuck Norris can dribble a bowling ball."
|
||||
"Chuck Norris drinks napalm to fight his heartburn."
|
||||
"Chuck Norris roundhouse kick is so powerful, it can be seen from outer space by the naked eye."
|
||||
"If you want a list of Chuck Norris enemies, just check the extinct species list."
|
||||
"Chuck Norris has never blinked in his entire life. Never."
|
||||
"Chuck Norris does not use spell check. If he happens to misspell a word, Oxford will change the spelling."
|
||||
"Some kids pee their name in the snow. Chuck Norris can pee his name into concrete."
|
||||
"Chuck Norris counted to infinity twice."
|
||||
"Chuck Norris can speak Braille."
|
||||
"Chuck Norris can have both feet on the ground and kick butt at the same time."
|
||||
"Chuck Norris can do a wheelie on a unicycle."
|
||||
"Chuck Norris stands faster than anyone can run."
|
||||
"Once a cobra bit Chuck Norris leg. After five days of excruciating pain, the cobra died."
|
||||
"Chuck Norris once won a game of Connect Four in three moves."
|
||||
"Champions are the breakfast of Chuck Norris."
|
||||
"When the Boogeyman goes to sleep every night he checks his closet for Chuck Norris."
|
||||
"Chuck Norris can slam revolving doors."
|
||||
"Chuck Norris does not hunt because the word hunting implies the possibility of failure. Chuck Norris goes killing."
|
||||
"The dark is afraid of Chuck Norris."
|
||||
"Chuck Norris makes onions cry."
|
||||
"Death once had a near-Chuck-Norris experience."
|
||||
"When Chuck Norris writes, he makes paper bleed."
|
||||
"Chuck Norris can strangle you with a cordless phone."
|
||||
"Chuck Norris never retreats; He just attacks in the opposite direction."
|
||||
"Chuck Norris can build a snowman out of rain."
|
||||
"Chuck Norris can drown a fish."
|
||||
"When Chuck Norris enters a room, he doesnt turn the lights on, he turns the dark off."
|
||||
"The only time Chuck Norris was ever wrong was when he thought he had made a mistake."
|
||||
"Chuck Norris is the only person that can punch a cyclops between the eye."
|
||||
"Chuck Norris used to beat up his shadow because it was following to close. It now stands 15 feet behind him."
|
||||
"Outer space exists because its afraid to be on the same planet with Chuck Norris."
|
||||
"When Chuck Norris does a pushup, he's pushing the Earth down."
|
||||
"Chuck Norris doesnt wear a watch. He decides what time it is."
|
||||
"Chuck Norris does not get frostbite. Chuck Norris bites frost."
|
||||
"Chuck Norris spices up his steaks with pepper spray."
|
||||
"The Great Wall of China was originally created to keep Chuck Norris out. It didn't work."
|
||||
"Chuck Norris can get in a bucket and lift it up with himself in it."
|
||||
"Chuck Norris doesn't shower, he only takes blood baths."
|
||||
"Chuck Norris can divide by zero."
|
||||
"Chuck Norris once kicked a horse in the chin. Its descendants are now known as giraffes."
|
||||
"When Chuck Norris does division, there are no remainders."
|
||||
"It takes Chuck Norris 20 minutes to watch '60 Minutes'."
|
||||
"Chuck Norris once went skydiving, but promised never to do it again. One Grand Canyon is enough."
|
||||
"We live in an expanding universe. All of it is trying to get away from Chuck Norris."
|
||||
"Chuck Norris beat the sun in a staring contest."
|
||||
"Chuck Norris can clap with one hand."
|
||||
"Chuck Norris doesn't need to shave. His beard is scared to grow."
|
||||
"Chuck Norris invented airplanes because he was tired of being the only person that could fly."
|
||||
"Freddy Krueger has nightmares about Chuck Norris."
|
||||
"Chuck Norris can start a fire with an ice cube."
|
|
@ -1,133 +0,0 @@
|
||||
## Summary
|
||||
How do I create packages? See https://docs.chocolatey.org/en-us/create/create-packages
|
||||
|
||||
If you are submitting packages to the community feed (https://community.chocolatey.org)
|
||||
always try to ensure you have read, understood and adhere to the create
|
||||
packages wiki link above.
|
||||
|
||||
## Automatic Packaging Updates?
|
||||
Consider making this package an automatic package, for the best
|
||||
maintainability over time. Read up at https://docs.chocolatey.org/en-us/create/automatic-packages
|
||||
|
||||
## Shim Generation
|
||||
Any executables you include in the package or download (but don't call
|
||||
install against using the built-in functions) will be automatically shimmed.
|
||||
|
||||
This means those executables will automatically be included on the path.
|
||||
Shim generation runs whether the package is self-contained or uses automation
|
||||
scripts.
|
||||
|
||||
By default, these are considered console applications.
|
||||
|
||||
If the application is a GUI, you should create an empty file next to the exe
|
||||
named 'name.exe.gui' e.g. 'bob.exe' would need a file named 'bob.exe.gui'.
|
||||
See https://docs.chocolatey.org/en-us/create/create-packages#how-do-i-set-up-shims-for-applications-that-have-a-gui
|
||||
|
||||
If you want to ignore the executable, create an empty file next to the exe
|
||||
named 'name.exe.ignore' e.g. 'bob.exe' would need a file named
|
||||
'bob.exe.ignore'.
|
||||
See https://docs.chocolatey.org/en-us/create/create-packages#how-do-i-exclude-executables-from-getting-shims
|
||||
|
||||
## Self-Contained?
|
||||
If you have a self-contained package, you can remove the automation scripts
|
||||
entirely and just include the executables, they will automatically get shimmed,
|
||||
which puts them on the path. Ensure you have the legal right to distribute
|
||||
the application though. See https://docs.chocolatey.org/en-us/information/legal.
|
||||
|
||||
You should read up on the Shim Generation section to familiarize yourself
|
||||
on what to do with GUI applications and/or ignoring shims.
|
||||
|
||||
## Automation Scripts
|
||||
You have a powerful use of Chocolatey, as you are using PowerShell. So you
|
||||
can do just about anything you need. Choco has some very handy built-in
|
||||
functions that you can use, these are sometimes called the helpers.
|
||||
|
||||
### Built-In Functions
|
||||
https://docs.chocolatey.org/en-us/create/functions
|
||||
|
||||
A note about a couple:
|
||||
* Get-ToolsLocation - used to get you the 'tools' root, which by default is set to 'c:\tools', not the chocolateyInstall bin folder - see https://docs.chocolatey.org/en-us/create/functions/get-toolslocation
|
||||
* Install-BinFile - used for non-exe files - executables are automatically shimmed... - see https://docs.chocolatey.org/en-us/create/functions/install-binfile
|
||||
* Uninstall-BinFile - used for non-exe files - executables are automatically shimmed - see https://docs.chocolatey.org/en-us/create/functions/uninstall-binfile
|
||||
|
||||
### Getting package specific information
|
||||
Use the package parameters pattern - see https://docs.chocolatey.org/en-us/guides/create/parse-packageparameters-argument
|
||||
|
||||
### Need to mount an ISO?
|
||||
https://docs.chocolatey.org/en-us/guides/create/mount-an-iso-in-chocolatey-package
|
||||
|
||||
### Environment Variables
|
||||
Chocolatey makes a number of environment variables available (You can access any of these with $env:TheVariableNameBelow):
|
||||
|
||||
* TEMP/TMP - Overridden to the CacheLocation, but may be the same as the original TEMP folder
|
||||
* ChocolateyInstall - Top level folder where Chocolatey is installed
|
||||
* ChocolateyPackageName - The name of the package, equivalent to the `<id />` field in the nuspec (0.9.9+)
|
||||
* ChocolateyPackageTitle - The title of the package, equivalent to the `<title />` field in the nuspec (0.10.1+)
|
||||
* ChocolateyPackageVersion - The version of the package, equivalent to the `<version />` field in the nuspec (0.9.9+)
|
||||
* ChocolateyPackageFolder - The top level location of the package folder - the folder where Chocolatey has downloaded and extracted the NuGet package, typically `C:\ProgramData\chocolatey\lib\packageName`.
|
||||
|
||||
#### Advanced Environment Variables
|
||||
The following are more advanced settings:
|
||||
|
||||
* ChocolateyPackageParameters - Parameters to use with packaging, not the same as install arguments (which are passed directly to the native installer). Based on `--package-parameters`. (0.9.8.22+)
|
||||
* CHOCOLATEY_VERSION - The version of Choco you normally see. Use if you are 'lighting' things up based on choco version. (0.9.9+) - Otherwise take a dependency on the specific version you need.
|
||||
* ChocolateyForceX86 = If available and set to 'true', then user has requested 32bit version. (0.9.9+) - Automatically handled in built in Choco functions.
|
||||
* OS_PLATFORM - Like Windows, OSX, Linux. (0.9.9+)
|
||||
* OS_VERSION - The version of OS, like 6.1 something something for Windows. (0.9.9+)
|
||||
* OS_NAME - The reported name of the OS. (0.9.9+)
|
||||
* USER_NAME = The user name (0.10.6+)
|
||||
* USER_DOMAIN = The user domain name (could also be local computer name) (0.10.6+)
|
||||
* IS_PROCESSELEVATED = Is the process elevated? (0.9.9+)
|
||||
* IS_SYSTEM = Is the user the system account? (0.10.6+)
|
||||
* IS_REMOTEDESKTOP = Is the user in a terminal services session? (0.10.6+)
|
||||
* ChocolateyToolsLocation - formerly 'ChocolateyBinRoot' ('ChocolateyBinRoot' will be removed with Chocolatey v2.0.0), this is where tools being installed outside of Chocolatey packaging will go. (0.9.10+)
|
||||
|
||||
#### Set By Options and Configuration
|
||||
Some environment variables are set based on options that are passed, configuration and/or features that are turned on:
|
||||
|
||||
* ChocolateyEnvironmentDebug - Was `--debug` passed? If using the built-in PowerShell host, this is always true (but only logs debug messages to console if `--debug` was passed) (0.9.10+)
|
||||
* ChocolateyEnvironmentVerbose - Was `--verbose` passed? If using the built-in PowerShell host, this is always true (but only logs verbose messages to console if `--verbose` was passed). (0.9.10+)
|
||||
* ChocolateyExitOnRebootDetected - Are we exiting on a detected reboot? Set by ` --exit-when-reboot-detected` or the feature `exitOnRebootDetected` (0.11.0+)
|
||||
* ChocolateyForce - Was `--force` passed? (0.9.10+)
|
||||
* ChocolateyForceX86 - Was `-x86` passed? (CHECK)
|
||||
* ChocolateyRequestTimeout - How long before a web request will time out. Set by config `webRequestTimeoutSeconds` (CHECK)
|
||||
* ChocolateyResponseTimeout - How long to wait for a download to complete? Set by config `commandExecutionTimeoutSeconds` (CHECK)
|
||||
* ChocolateyPowerShellHost - Are we using the built-in PowerShell host? Set by `--use-system-powershell` or the feature `powershellHost` (0.9.10+)
|
||||
|
||||
#### Business Edition Variables
|
||||
|
||||
* ChocolateyInstallArgumentsSensitive - Encrypted arguments passed from command line `--install-arguments-sensitive` that are not logged anywhere. (0.10.1+ and licensed editions 1.6.0+)
|
||||
* ChocolateyPackageParametersSensitive - Package parameters passed from command line `--package-parameters-senstivite` that are not logged anywhere. (0.10.1+ and licensed editions 1.6.0+)
|
||||
* ChocolateyLicensedVersion - What version is the licensed edition on?
|
||||
* ChocolateyLicenseType - What edition / type of the licensed edition is installed?
|
||||
* USER_CONTEXT - The original user context - different when self-service is used (Licensed v1.10.0+)
|
||||
|
||||
#### Experimental Environment Variables
|
||||
The following are experimental or use not recommended:
|
||||
|
||||
* OS_IS64BIT = This may not return correctly - it may depend on the process the app is running under (0.9.9+)
|
||||
* CHOCOLATEY_VERSION_PRODUCT = the version of Choco that may match CHOCOLATEY_VERSION but may be different (0.9.9+) - based on git describe
|
||||
* IS_ADMIN = Is the user an administrator? But doesn't tell you if the process is elevated. (0.9.9+)
|
||||
* IS_REMOTE = Is the user in a remote session? (0.10.6+)
|
||||
|
||||
#### Not Useful Or Anti-Pattern If Used
|
||||
|
||||
* ChocolateyInstallOverride = Not for use in package automation scripts. Based on `--override-arguments` being passed. (0.9.9+)
|
||||
* ChocolateyInstallArguments = The installer arguments meant for the native installer. You should use chocolateyPackageParameters instead. Based on `--install-arguments` being passed. (0.9.9+)
|
||||
* ChocolateyIgnoreChecksums - Was `--ignore-checksums` passed or the feature `checksumFiles` turned off? (0.9.9.9+)
|
||||
* ChocolateyAllowEmptyChecksums - Was `--allow-empty-checksums` passed or the feature `allowEmptyChecksums` turned on? (0.10.0+)
|
||||
* ChocolateyAllowEmptyChecksumsSecure - Was `--allow-empty-checksums-secure` passed or the feature `allowEmptyChecksumsSecure` turned on? (0.10.0+)
|
||||
* ChocolateyChecksum32 - Was `--download-checksum` passed? (0.10.0+)
|
||||
* ChocolateyChecksumType32 - Was `--download-checksum-type` passed? (0.10.0+)
|
||||
* ChocolateyChecksum64 - Was `--download-checksum-x64` passed? (0.10.0)+
|
||||
* ChocolateyChecksumType64 - Was `--download-checksum-type-x64` passed? (0.10.0)+
|
||||
* ChocolateyPackageExitCode - The exit code of the script that just ran - usually set by `Set-PowerShellExitCode` (CHECK)
|
||||
* ChocolateyLastPathUpdate - Set by Chocolatey as part of install, but not used for anything in particular in packaging.
|
||||
* ChocolateyProxyLocation - The explicit proxy location as set in the configuration `proxy` (0.9.9.9+)
|
||||
* ChocolateyDownloadCache - Use available download cache? Set by `--skip-download-cache`, `--use-download-cache`, or feature `downloadCache` (0.9.10+ and licensed editions 1.1.0+)
|
||||
* ChocolateyProxyBypassList - Explicitly set locations to ignore in configuration `proxyBypassList` (0.10.4+)
|
||||
* ChocolateyProxyBypassOnLocal - Should the proxy bypass on local connections? Set based on configuration `proxyBypassOnLocal` (0.10.4+)
|
||||
* http_proxy - Set by original `http_proxy` passthrough, or same as `ChocolateyProxyLocation` if explicitly set. (0.10.4+)
|
||||
* https_proxy - Set by original `https_proxy` passthrough, or same as `ChocolateyProxyLocation` if explicitly set. (0.10.4+)
|
||||
* no_proxy- Set by original `no_proxy` passthrough, or same as `ChocolateyProxyBypassList` if explicitly set. (0.10.4+)
|
||||
|
@ -1,131 +0,0 @@
|
||||
TODO
|
||||
|
||||
1. Determine Package Use:
|
||||
|
||||
Organization? Internal Use? - You are not subject to distribution
|
||||
rights when you keep everything internal. Put the binaries directly
|
||||
into the tools directory (as long as total nupkg size is under 1GB).
|
||||
When bigger, look to use from a share or download binaries from an
|
||||
internal location. Embedded binaries makes for the most reliable use
|
||||
of Chocolatey. Use `$fileLocation` (`$file`/`$file64`) and
|
||||
`Install-ChocolateyInstallPackage`/`Get-ChocolateyUnzip` in
|
||||
tools\chocolateyInstall.ps1.
|
||||
|
||||
You can also choose to download from internal urls, see the next
|
||||
section, but ignore whether you have distribution rights or not, it
|
||||
doesn't apply. Under no circumstances should download from the
|
||||
internet, it is completely unreliable. See
|
||||
https://docs.chocolatey.org/en-us/community-repository/community-packages-disclaimer
|
||||
to understand the limitations of a publicly available repository.
|
||||
|
||||
Community Repository?
|
||||
Have Distribution Rights?
|
||||
If you are the software vendor OR the software EXPLICITLY allows
|
||||
redistribution and the total nupkg size will be under 200MB, you
|
||||
have the option to embed the binaries directly into the package to
|
||||
provide the most reliable install experience. Put the binaries
|
||||
directly into the tools folder, use `$fileLocation` (`$file`/
|
||||
`$file64`) and `Install-ChocolateyInstallPackage`/
|
||||
`Get-ChocolateyUnzip` in tools\chocolateyInstall.ps1. Additionally,
|
||||
fill out the LICENSE and VERIFICATION file (see 3 below and those
|
||||
files for specifics).
|
||||
|
||||
NOTE: You can choose to download binaries at runtime, but be sure
|
||||
the download location will remain stable. See the next section.
|
||||
|
||||
Do Not Have Distribution Rights?
|
||||
- Note: Packages built this way cannot be 100% reliable, but it's a
|
||||
constraint of publicly available packages and there is little
|
||||
that can be done to change that. See
|
||||
https://docs.chocolatey.org/en-us/community-repository/community-packages-disclaimer
|
||||
to better understand the limitations of a publicly available
|
||||
repository.
|
||||
Download Location is Publicly Available?
|
||||
You will need to download the runtime files from their official
|
||||
location at runtime. Use `$url`/`$url64` and
|
||||
`Install-ChocolateyPackage`/`Install-ChocolateyZipPackage` in
|
||||
tools\chocolateyInstall.ps1.
|
||||
Download Location is Not Publicly Available?
|
||||
Stop here, you can't push this to the community repository. You
|
||||
can ask the vendor for permission to embed, then include a PDF of
|
||||
that signed permission directly in the package. Otherwise you
|
||||
will need to seek alternate locations to non-publicly host the
|
||||
package.
|
||||
Download Location Is Same For All Versions?
|
||||
You still need to point to those urls, but you may wish to set up
|
||||
something like Automatic Updater (AU) so that when a new version
|
||||
of the software becomes available, the new package version
|
||||
automatically gets pushed up to the community repository. See
|
||||
https://docs.chocolatey.org/en-us/create/automatic-packages#automatic-updater-au
|
||||
|
||||
2. Determine Package Type:
|
||||
|
||||
- Installer Package - contains an installer (everything in template is
|
||||
geared towards this type of package)
|
||||
- Zip Package - downloads or embeds and unpacks archives, may unpack
|
||||
and run an installer using `Install-ChocolateyInstallPackage` as a
|
||||
secondary step.
|
||||
- Portable Package - Contains runtime binaries (or unpacks them as a
|
||||
zip package) - cannot require administrative permissions to install
|
||||
or use
|
||||
- Config Package - sets config like files, registry keys, etc
|
||||
- Extension Package - Packages that add PowerShell functions to
|
||||
Chocolatey - https://docs.chocolatey.org/en-us/features/extensions
|
||||
- Template Package - Packages that add templates like this for `choco
|
||||
new -t=name` - https://docs.chocolatey.org/en-us/guides/create/create-custom-package-templates
|
||||
- Other - there are other types of packages as well, these are the main
|
||||
package types seen in the wild
|
||||
|
||||
3. Fill out the package contents:
|
||||
|
||||
- tools\chocolateyBeforeModify.ps1 - remove if you have no processes
|
||||
or services to shut down before upgrade/uninstall
|
||||
- tools\LICENSE.txt / tools\VERIFICATION.txt - Remove if you are not
|
||||
embedding binaries. Keep and fill out if you are embedding binaries
|
||||
in the package AND pushing to the community repository, even if you
|
||||
are the author of software. The file becomes easier to fill out
|
||||
(does not require changes each version) if you are the software
|
||||
vendor. If you are building packages for internal use (organization,
|
||||
etc), you don't need these files as you are not subject to
|
||||
distribution rights internally.
|
||||
- tools\chocolateyUninstall.ps1 - remove if autouninstaller can
|
||||
automatically uninstall and you have nothing additional to do during
|
||||
uninstall
|
||||
- Readme.txt - delete this file once you have read over and used
|
||||
anything you've needed from here
|
||||
- nuspec - fill this out, then clean out all the comments (you may wish
|
||||
to leave the headers for the package vs software metadata)
|
||||
- tools\chocolateyInstall.ps1 - instructions in next section.
|
||||
|
||||
4. ChocolateyInstall.ps1:
|
||||
|
||||
- For embedded binaries - use `$fileLocation` (`$file`/`$file64`) and
|
||||
`Install-ChocolateyInstallPackage`/ `Get-ChocolateyUnzip`.
|
||||
- Downloading binaries at runtime - use `$url`/`$url64` and
|
||||
`Install-ChocolateyPackage` / `Install-ChocolateyZipPackage`.
|
||||
- Other needs (creating files, setting registry keys), use regular
|
||||
PowerShell to do so or see if there is a function already defined:
|
||||
https://docs.chocolatey.org/en-us/create/functions
|
||||
- There may also be functions available in extension packages, see
|
||||
https://community.chocolatey.org/packages?q=id%3A.extension for examples and
|
||||
availability.
|
||||
- Clean out the comments and sections you are not using.
|
||||
|
||||
5. Test the package to ensure install/uninstall work appropriately.
|
||||
There is a test environment you can use for this -
|
||||
https://github.com/chocolatey/chocolatey-test-environment
|
||||
|
||||
6. Learn more about Chocolatey packaging - go through the workshop at
|
||||
https://github.com/chocolatey/chocolatey-workshop
|
||||
You will learn about
|
||||
- General packaging
|
||||
- Customizing package behavior at runtime (package parameters)
|
||||
- Extension packages
|
||||
- Custom packaging templates
|
||||
- Setting up an internal Chocolatey.Server repository
|
||||
- Adding and using internal repositories
|
||||
- Reporting
|
||||
- Advanced packaging techniques when installers are not friendly to
|
||||
automation
|
||||
|
||||
7. Delete this file.
|
@ -1,51 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
|
||||
<metadata>
|
||||
<!-- == PACKAGE SPECIFIC SECTION == -->
|
||||
<!-- This section is about this package, although id and version have ties back to the software -->
|
||||
<!-- id is lowercase and if you want a good separator for words, use '-', not '.'. Dots are only acceptable as suffixes for certain types of packages, e.g. .install, .portable, .extension, .template -->
|
||||
<!-- If the software is cross-platform, attempt to use the same id as the debian/rpm package(s) if possible. -->
|
||||
<id>powershell-scripts</id>
|
||||
<!-- version should MATCH as closely as possible with the underlying software -->
|
||||
<!-- Is the version a prerelease of a version? https://docs.nuget.org/create/versioning#creating-prerelease-packages -->
|
||||
<!-- Note that unstable versions like 0.0.1 can be considered a released version, but it's possible that one can release a 0.0.1-beta before you release a 0.0.1 version. If the version number is final, that is considered a released version and not a prerelease. -->
|
||||
<version>0.4</version>
|
||||
<packageSourceUrl>https://github.com/fleschutz/PowerShell</packageSourceUrl>
|
||||
<!-- owners is a poor name for maintainers of the package. It sticks around by this name for compatibility reasons. It basically means you. -->
|
||||
<owners>Markus Fleschutz</owners>
|
||||
<!-- ============================== -->
|
||||
|
||||
<!-- == SOFTWARE SPECIFIC SECTION == -->
|
||||
<!-- This section is about the software itself -->
|
||||
<title>powershell-scripts</title>
|
||||
<authors>Markus Fleschutz</authors>
|
||||
<!-- projectUrl is required for the community feed -->
|
||||
<projectUrl>https://github.com/fleschutz/PowerShell</projectUrl>
|
||||
<!-- There are a number of CDN Services that can be used for hosting the Icon for a package. More information can be found here: https://docs.chocolatey.org/en-us/create/create-packages#package-icon-guidelines -->
|
||||
<!-- <copyright>Year Software Vendor</copyright> -->
|
||||
<!-- If there is a license Url available, it is required for the community feed -->
|
||||
<licenseUrl>https://github.com/fleschutz/PowerShell/blob/master/LICENSE</licenseUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<projectSourceUrl>https://github.com/fleschutz/PowerShell</projectSourceUrl>
|
||||
<!--<docsUrl>At what url are the software docs located?</docsUrl>-->
|
||||
<!--<mailingListUrl></mailingListUrl>-->
|
||||
<bugTrackerUrl>https://github.com/fleschutz/PowerShell/issues</bugTrackerUrl>
|
||||
<tags>powershell-scripts PowerShell Scripts collection</tags>
|
||||
<summary>Mega Collection of PowerShell Scripts</summary>
|
||||
<description>This collection provides more than 250 useful and cross-platform PowerShell scripts in the Scripts subfolder - to be used by command-line interface (CLI), for remote control (e.g. via SSH), by context menu, by voice control (see also repo talk2windows), by automation software like Jenkins, automatically as daily tasks, or simply to learn PowerShell.</description>
|
||||
<releaseNotes>0.4 Release</releaseNotes>
|
||||
<!-- =============================== -->
|
||||
|
||||
<dependencies>
|
||||
<dependency id="chocolatey-core.extension" version="1.1.0" />
|
||||
</dependencies>
|
||||
<!--<provides>NOT YET IMPLEMENTED</provides>-->
|
||||
<!--<conflicts>NOT YET IMPLEMENTED</conflicts>-->
|
||||
<!--<replaces>NOT YET IMPLEMENTED</replaces>-->
|
||||
</metadata>
|
||||
<files>
|
||||
<!-- this section controls what actually gets packaged into the Chocolatey package -->
|
||||
<file src="tools\**" target="tools" />
|
||||
</files>
|
||||
</package>
|
@ -1,11 +0,0 @@
|
||||
|
||||
Note: Include this file if including binaries you have the right to distribute.
|
||||
Otherwise delete. this file.
|
||||
|
||||
===DELETE ABOVE THIS LINE AND THIS LINE===
|
||||
|
||||
From: <insert applicable license url here>
|
||||
|
||||
LICENSE
|
||||
|
||||
<Insert License Here>
|
@ -1,13 +0,0 @@
|
||||
|
||||
Note: Include this file if including binaries you have the right to distribute.
|
||||
Otherwise delete. this file. If you are the software author, you can change this
|
||||
mention you are the author of the software.
|
||||
|
||||
===DELETE ABOVE THIS LINE AND THIS LINE===
|
||||
|
||||
VERIFICATION
|
||||
Verification is intended to assist the Chocolatey moderators and community
|
||||
in verifying that this package's contents are trustworthy.
|
||||
|
||||
<Include details of how to verify checksum contents>
|
||||
<If software vendor, explain that here - checksum verification instructions are optional>
|
@ -1,9 +0,0 @@
|
||||
# This runs in 0.9.10+ before upgrade and uninstall.
|
||||
# Use this file to do things like stop services prior to upgrade or uninstall.
|
||||
# NOTE: It is an anti-pattern to call chocolateyUninstall.ps1 from here. If you
|
||||
# need to uninstall an MSI prior to upgrade, put the functionality in this
|
||||
# file without calling the uninstall script. Make it idempotent in the
|
||||
# uninstall script so that it doesn't fail when it is already uninstalled.
|
||||
# NOTE: For upgrades - like the uninstall script, this script always runs from
|
||||
# the currently installed version, not from the new upgraded package version.
|
||||
|
@ -1,42 +0,0 @@
|
||||
|
||||
$ErrorActionPreference = 'Stop';
|
||||
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
|
||||
$url = ''
|
||||
$url64 = ''
|
||||
|
||||
$packageArgs = @{
|
||||
packageName = $env:ChocolateyPackageName
|
||||
unzipLocation = $toolsDir
|
||||
fileType = 'EXE'
|
||||
url = $url
|
||||
url64bit = $url64
|
||||
|
||||
softwareName = 'powershell-scripts*'
|
||||
|
||||
checksum = ''
|
||||
checksumType = 'sha256'
|
||||
checksum64 = ''
|
||||
checksumType64= 'sha256'
|
||||
|
||||
silentArgs = "/qn /norestart /l*v `"$($env:TEMP)\$($packageName).$($env:chocolateyPackageVersion).MsiInstall.log`""
|
||||
validExitCodes= @(0, 3010, 1641)
|
||||
}
|
||||
|
||||
Install-ChocolateyPackage @packageArgs
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,83 +0,0 @@
|
||||
# IMPORTANT: Before releasing this package, copy/paste the next 2 lines into PowerShell to remove all comments from this file:
|
||||
# $f='c:\path\to\thisFile.ps1'
|
||||
# gc $f | ? {$_ -notmatch "^\s*#"} | % {$_ -replace '(^.*?)\s*?[^``]#.*','$1'} | Out-File $f+".~" -en utf8; mv -fo $f+".~" $f
|
||||
|
||||
## NOTE: In 80-90% of the cases (95% with licensed versions due to Package Synchronizer and other enhancements),
|
||||
## AutoUninstaller should be able to detect and handle registry uninstalls without a chocolateyUninstall.ps1.
|
||||
## See https://docs.chocolatey.org/en-us/choco/commands/uninstall
|
||||
## and https://docs.chocolatey.org/en-us/create/functions/uninstall-chocolateypackage
|
||||
|
||||
## If this is an MSI, ensure 'softwareName' is appropriate, then clean up comments and you are done.
|
||||
## If this is an exe, change fileType, silentArgs, and validExitCodes
|
||||
|
||||
$ErrorActionPreference = 'Stop'; # stop on all errors
|
||||
$packageArgs = @{
|
||||
packageName = $env:ChocolateyPackageName
|
||||
softwareName = 'powershell-scripts*' #part or all of the Display Name as you see it in Programs and Features. It should be enough to be unique
|
||||
fileType = 'EXE_MSI_OR_MSU' #only one of these: MSI or EXE (ignore MSU for now)
|
||||
# MSI
|
||||
silentArgs = "/qn /norestart"
|
||||
validExitCodes= @(0, 3010, 1605, 1614, 1641) # https://msdn.microsoft.com/en-us/library/aa376931(v=vs.85).aspx
|
||||
# OTHERS
|
||||
# Uncomment matching EXE type (sorted by most to least common)
|
||||
#silentArgs = '/S' # NSIS
|
||||
#silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-' # Inno Setup
|
||||
#silentArgs = '/s' # InstallShield
|
||||
#silentArgs = '/s /v"/qn"' # InstallShield with MSI
|
||||
#silentArgs = '/s' # Wise InstallMaster
|
||||
#silentArgs = '-s' # Squirrel
|
||||
#silentArgs = '-q' # Install4j
|
||||
#silentArgs = '-s -u' # Ghost
|
||||
# Note that some installers, in addition to the silentArgs above, may also need assistance of AHK to achieve silence.
|
||||
#silentArgs = '' # none; make silent with input macro script like AutoHotKey (AHK)
|
||||
# https://community.chocolatey.org/packages/autohotkey.portable
|
||||
#validExitCodes= @(0) #please insert other valid exit codes here
|
||||
}
|
||||
|
||||
# Get-UninstallRegistryKey is new to 0.9.10, if supporting 0.9.9.x and below,
|
||||
# take a dependency on "chocolatey-core.extension" in your nuspec file.
|
||||
# This is only a fuzzy search if $softwareName includes '*'. Otherwise it is
|
||||
# exact. In the case of versions in key names, we recommend removing the version
|
||||
# and using '*'.
|
||||
[array]$key = Get-UninstallRegistryKey -SoftwareName $packageArgs['softwareName']
|
||||
|
||||
if ($key.Count -eq 1) {
|
||||
$key | % {
|
||||
$packageArgs['file'] = "$($_.UninstallString)" #NOTE: You may need to split this if it contains spaces, see below
|
||||
|
||||
if ($packageArgs['fileType'] -eq 'MSI') {
|
||||
# The Product Code GUID is all that should be passed for MSI, and very
|
||||
# FIRST, because it comes directly after /x, which is already set in the
|
||||
# Uninstall-ChocolateyPackage msiargs (facepalm).
|
||||
$packageArgs['silentArgs'] = "$($_.PSChildName) $($packageArgs['silentArgs'])"
|
||||
|
||||
# Don't pass anything for file, it is ignored for msi (facepalm number 2)
|
||||
# Alternatively if you need to pass a path to an msi, determine that and
|
||||
# use it instead of the above in silentArgs, still very first
|
||||
$packageArgs['file'] = ''
|
||||
} else {
|
||||
# NOTES:
|
||||
# - You probably will need to sanitize $packageArgs['file'] as it comes from the registry and could be in a variety of fun but unusable formats
|
||||
# - Split args from exe in $packageArgs['file'] and pass those args through $packageArgs['silentArgs'] or ignore them
|
||||
# - Ensure you don't pass double quotes in $file (aka $packageArgs['file']) - otherwise you will get "Illegal characters in path when you attempt to run this"
|
||||
# - Review the code for auto-uninstaller for all of the fun things it does in sanitizing - https://github.com/chocolatey/choco/blob/bfe351b7d10c798014efe4bfbb100b171db25099/src/chocolatey/infrastructure.app/services/AutomaticUninstallerService.cs#L142-L192
|
||||
}
|
||||
|
||||
Uninstall-ChocolateyPackage @packageArgs
|
||||
}
|
||||
} elseif ($key.Count -eq 0) {
|
||||
Write-Warning "$packageName has already been uninstalled by other means."
|
||||
} elseif ($key.Count -gt 1) {
|
||||
Write-Warning "$($key.Count) matches found!"
|
||||
Write-Warning "To prevent accidental data loss, no programs will be uninstalled."
|
||||
Write-Warning "Please alert package maintainer the following keys were matched:"
|
||||
$key | % {Write-Warning "- $($_.DisplayName)"}
|
||||
}
|
||||
|
||||
## OTHER POWERSHELL FUNCTIONS
|
||||
## https://docs.chocolatey.org/en-us/create/functions
|
||||
#Uninstall-ChocolateyZipPackage $packageName # Only necessary if you did not unpack to package directory - see https://docs.chocolatey.org/en-us/create/functions/uninstall-chocolateyzippackage
|
||||
#Uninstall-ChocolateyEnvironmentVariable # 0.9.10+ - https://docs.chocolatey.org/en-us/create/functions/uninstall-chocolateyenvironmentvariable
|
||||
#Uninstall-BinFile # Only needed if you used Install-BinFile - see https://docs.chocolatey.org/en-us/create/functions/uninstall-binfile
|
||||
## Remove any shortcuts you added in the install script.
|
||||
|
@ -1,47 +0,0 @@
|
||||
CATEGORY,AUTHOR,QUOTE
|
||||
IQ,Thomas Edison,"Genius is one percent inspiration and ninety-nine percent perspiration."
|
||||
Life,Abraham Lincoln,"In the end, it's not the years in your life that count. It's the life in your years."
|
||||
Life,Albert Einstein,"Only a life lived for others is a life worthwhile."
|
||||
Life,Marilyn Monroe,"Keep smiling, because life is a beautiful thing and there's so much to smile about."
|
||||
Life,James M. Barrie,"Life is a long lesson in humility."
|
||||
Life,Bob Marley,"Love the life you live. Live the life you love."
|
||||
Life,Ray Bradbury,"Life is trying things to see if they work."
|
||||
Life,Helen Keller,"Life is either a daring adventure or nothing at all."
|
||||
Life,John Lennon,"Life is what happens when you're busy making other plans"
|
||||
Life,Jonathan Swift,"May you live all the days of your life."
|
||||
Misc,Abraham Lincoln,"The best thing about the future is that it only comes one day at a time."
|
||||
Misc,Albert Einstein,"Learn from yesterday, live for today, hope for tomorrow."
|
||||
Misc,Anne Frank,"Whoever is happy will make others happy too."
|
||||
Misc,Aristotle,"It is during our darkest moments that we must focus to see the light."
|
||||
Misc,Benjamin Franklin,"Tell me and I forget. Teach me and I remember. Involve me and I learn."
|
||||
Misc,Bruce Lee,"Mistakes are always forgivable, if one has the courage to admit them."
|
||||
Misc,Eleanor Roosevelt,"The future belongs to those who believe in the beauty of their dreams."
|
||||
Misc,Johann Wolfgang von Goethe,"Difficulties increase the nearer we get to the goal."
|
||||
Misc,Michelangelo,"Faith in oneself is the best and safest course."
|
||||
Misc,Sophocles,"It takes both sunshine and rain to make a rainbow."
|
||||
Misc,Mahatma Gandhi,"We must become the change we want to see."
|
||||
Misc,Johann Wolfgang von Goethe,"Knowing is not enough; we must apply!"
|
||||
Misc,Immanuel Kant,"Science is organized knowledge. Wisdom is organized life."
|
||||
Misc,Indira Gandhi,"You can't shake hands with a clenched fist."
|
||||
Misc,Pierre Auguste Renoir,"The pain passes, but the beauty remains."
|
||||
Misc,Heraclitus,"All is flux; nothing stays still."
|
||||
Misc,Japanese proverb,"The day you decide to do it is your lucky day."
|
||||
Misc,Epictetus,"We have two ears and one mouth so that we can listen twice as much as we speak."
|
||||
Misc,Cervantes,"Be slow of tongue and quick of eye."
|
||||
Misc,Nelson Mandela,"The greatest glory in living lies not in never falling, but in rising every time we fall."
|
||||
Misc,Mother Teresa,"Spread love everywhere you go. Let no one ever come to you without leaving happier."
|
||||
Misc,Mae West,"You only live once, but if you do it right, once is enough."
|
||||
Misc,Hans Christian Andersen,"Life itself is the most wonderful fairy tale."
|
||||
Misc,Walt Disney,"The way to get started is to quit talking and begin doing."
|
||||
Misc,William Shakespeare,"Having nothing, nothing can he lose."
|
||||
Misc,Tony Robbins,"The only impossible journey is the one you never begin."
|
||||
Misc,Ralph Waldo Emerson,"Do not go where the path may lead, go instead where there is no path and leave a trail."
|
||||
Misc,Margaret Mead,"Always remember that you are absolutely unique. Just like everyone else."
|
||||
Success,Albert Einstein,"Try not to become a man of success, but rather try to become a man of value."
|
||||
Success,Steve Jobs,"If you really look closely, most overnight successes took a long time."
|
||||
Success,Oprah Winfrey,"You know you are on the road to success if you would do your job and not be paid for it."
|
||||
Success,David Brinkley,"A successful man is one who can lay a firm foundation with the bricks others have thrown at him."
|
||||
Success,Estee Lauder,"I never dreamed about success, I worked for it."
|
||||
Success,Henry David Thoreau,"Success usually comes to those who are too busy to be looking for it."
|
||||
Success,Colin Powell,"There are no secrets to success. It is the result of preparation, hard work, and learning from failure."
|
||||
Success,John D. Rockefeller,"The secret of success is to do the common thing uncommonly well."
|
|
293
Data/scripts.csv
293
Data/scripts.csv
@ -1,293 +0,0 @@
|
||||
Script,Description
|
||||
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 a Git repository
|
||||
build-repos.ps1, Builds all Git repositories in a folder
|
||||
cd-autostart.ps1, Set the working directory to the user's autostart folder
|
||||
cd-desktop.ps1, Set the working directory to the user's desktop folder
|
||||
cd-docs.ps1, Set the working directory to the user's documents folder
|
||||
cd-downloads.ps1, Set the working directory to the user's downloads folder
|
||||
cd-dropbox.ps1, Set the working directory to the user's Dropbox folder
|
||||
cd-home.ps1, Set the working directory to the user's home folder
|
||||
cd-music.ps1, Set the working directory to the user's music folder
|
||||
cd-onedrive.ps1, Set the working directory to the user's OneDrive folder
|
||||
cd-pics.ps1, Set the working directory to the user's pictures folder
|
||||
cd-recycle-bin.ps1, Set the working directory to the user's recycle bin folder
|
||||
cd-repos.ps1, Set the working directory to the user's Git repositories folder
|
||||
cd-root.ps1, Set the working directory to the root directory (C: on Windows)
|
||||
cd-scripts.ps1, Set the working directory to the PowerShell Scripts folder
|
||||
cd-ssh.ps1, Set the working directory to the user's SSH folder
|
||||
cd-up.ps1, Set the working directory to one directory level up
|
||||
cd-up2.ps1, Set the working directory to two directory levels up
|
||||
cd-up3.ps1, Set the working directory to three directory levels up
|
||||
cd-up4.ps1, Set the working directory to four directory levels up
|
||||
cd-videos.ps1, Set the working directory 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 a drive for free space left
|
||||
check-file-system.ps1, Checks the file system of a drive (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-subnet-mask.ps1, Checks the given subnet mask for validity
|
||||
check-swap-space.ps1, Checks the swap space for free space left
|
||||
check-symlinks.ps1, Checks every symlink in a 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-repo.ps1, Cleans the current/given Git repository from untracked files (including submodules)
|
||||
clean-repos.ps1, Cleans all Git repositories under the current/given directory 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-cortana.ps1, Closes Cortana gracefully
|
||||
close-file-explorer.ps1, Closes Microsoft File Explorer gracefully
|
||||
close-google-chrome.ps1, Closes the Google Chrome Web browser
|
||||
close-program.ps1, Closes the given program gracefully
|
||||
close-microsoft-edge.ps1, Closes the Microsoft Edge Web browser
|
||||
close-microsoft-store.ps1, Closes the Microsoft Store app
|
||||
close-mozilla-firefox.ps1, Closes the Mozilla Firefox Web browser
|
||||
close-netflix.ps1, Closes the Netflix application gracefully
|
||||
close-onedrive.ps1, Closes Microsoft OneDrive gracefully
|
||||
close-serenade.ps1, Closes the Serenade.ai application gracefully
|
||||
close-snipping-tool.ps1, Closes the Snipping Tool application gracefully
|
||||
close-spotify.ps1, Closes Spotify
|
||||
close-system-settings.ps1, Closes the System Settings gracefully
|
||||
close-thunderbird.ps1, Closes Mozilla Thunderbird gracefully
|
||||
close-vlc.ps1, Closes the VLC media player application
|
||||
close-windows-terminal.ps1, Closes the Windows Terminal application
|
||||
copy-photos-sorted.ps1, Copy image files sorted by year and month
|
||||
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-ps2bat.ps1, Converts PowerShell script(s) to .bat files
|
||||
convert-ps2md.ps1, Converts the comment-based help of a PowerShell script to Markdown
|
||||
convert-sql2csv.ps1, Converts the SQL database table to a CSV file
|
||||
convert-txt2wav.ps1, Converts text into a audio .WAV file
|
||||
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-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)
|
||||
encrypt-file.ps1, Encrypts the given file
|
||||
export-to-manuals.ps1, Converts all scripts as manuals
|
||||
export-to-serenade.ps1, Converts all scripts to Serenade for voice control
|
||||
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)
|
||||
get-md5.ps1, Prints the MD5 checksum of the given file
|
||||
get-sha1.ps1, Prints the SHA1 checksum of the given file
|
||||
get-sha256.ps1, Prints the SHA256 checksum of the given file
|
||||
hibernate.ps1, Enables hibernate mode for the local computer (needs admin rights)
|
||||
inspect-exe.ps1, Prints basic information of the given executable file
|
||||
install-github-cli.ps1, Installs GitHub CLI
|
||||
install-google-chrome.ps1, Installs the Google Chrome browser
|
||||
install-knot-resolver.ps1, Installs the Knot Resolver (needs admin rights)
|
||||
install-signal-cli.ps1, Installs signal-cli from github.com/AsamK/signal-cli
|
||||
install-ssh-client.ps1, Installs the SSH client (needs admin rights)
|
||||
install-ssh-server.ps1, Installs the SSH server (needs admin rights)
|
||||
install-updates.ps1, Installs updates (needs admin rights)
|
||||
install-vscode.ps1, Installs Visual Studio Code
|
||||
install-wsl.ps1, Installs Windows Subsystem for Linux (WSL), needs admin rights
|
||||
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 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-console-colors.ps1, Lists all console colors
|
||||
list-countries.ps1, Lists details of all countries
|
||||
list-cli-tools.ps1, Lists available command-line interface (CLI) tools
|
||||
list-clipboard.ps1, Lists the contents of the clipboard
|
||||
list-credits.ps1, Shows the credits
|
||||
list-crypto-rates.ps1, Lists the current crypto exchange rates
|
||||
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-folder.ps1, Lists the folder content
|
||||
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-latest-tag.ps1, Lists the latest tag on the current branch in a Git repository
|
||||
list-latest-tags.ps1, Lists the latests tags in all Git repositories under the current/given directory
|
||||
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-exchange-rates.ps1, Lists the exchange rates for the given currency
|
||||
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 operating system releases and download URL
|
||||
list-os-updates.ps1, Lists operating system updates
|
||||
list-passwords.ps1, Prints a list of random passwords
|
||||
list-pins.ps1, Prints a list of random PIN's
|
||||
list-printers.ps1, Lists all printer known to the computer
|
||||
list-print-jobs.ps1, Lists all jobs of all printers
|
||||
list-processes.ps1, Lists the local computer processes
|
||||
list-profiles.ps1, Lists your PowerShell profiles
|
||||
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-submodules.ps1, Lists the submodules of the current/given Git repository
|
||||
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-tiobe-index.ps1, Lists the TIOBE index of top programming languages
|
||||
list-user-groups.ps1, Lists the user groups on the local computer
|
||||
list-voices.ps1, Lists the installed text-to-speech (TTS) voices
|
||||
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
|
||||
make-install.ps1, Installs built executables and libs to the installation directory
|
||||
moon.ps1, Prints the current moon phase
|
||||
mute-audio.ps1, Mutes the audio device
|
||||
open-amazon.ps1, Opens Amazon's website
|
||||
open-browser.ps1, Starts the default Web browser
|
||||
open-calculator.ps1, Starts the calculator program
|
||||
open-c-drive.ps1, Opens the C: drive folder
|
||||
open-downloads-folder.ps1, Opens the user's downloads folder
|
||||
open-dropbox-folder.ps1, Opens the user's Dropbox folder
|
||||
open-email-client.ps1, Starts the default email client
|
||||
open-facebook.ps1, Opens Facebook's website
|
||||
open-file-explorer.ps1, Opens the File Explorer
|
||||
open-fritz-box.ps1, Opens FRITZ!Box's web interface
|
||||
open-github.ps1, Opens GitHub's website
|
||||
open-google-contacts.ps1, Opens Google Contacts
|
||||
open-google-earth.ps1, Opens Google Earth
|
||||
open-google-maps.ps1, Opens Google Maps
|
||||
open-google-mail.ps1, Opens Google Mail
|
||||
open-google-news.ps1, Opens Google News
|
||||
open-google-play.ps1, Opens Google Play
|
||||
open-google-search.ps1, Opens Google Search
|
||||
open-google-translate.ps1, Opens Google Translate
|
||||
open-home-folder.ps1, Opens the user's home folder
|
||||
open-music-folder.ps1, Opens the user's music folder
|
||||
open-microsoft-edge.ps1, Launches the Microsoft Edge Web browser
|
||||
open-microsoft-store.ps1, Starts the Microsoft Store app
|
||||
open-netflix.ps1, Starts the Netflix app
|
||||
open-notepad.ps1, Starts the Notepad app
|
||||
open-onedrive-folder.ps1, Opens the user's OneDrive folder
|
||||
open-recycle-bin.ps1, Opens the user's recycle bin folder
|
||||
open-repos-folder.ps1, Opens the user's Git repositories folder
|
||||
open-snipping-tools.ps1, Opens the Snipping Tool
|
||||
open-speed-test.ps1, Opens Cloudflare's speed test
|
||||
open-spotify.ps1, Opens the Spotify app
|
||||
open-system-settings.ps1, Launches the Windows system settings
|
||||
open-task-manager.ps1, Launches the Task Manager
|
||||
open-toggl-track.ps1, Opens Toggl Track
|
||||
open-videos-folder.ps1, Opens the user's videos folder
|
||||
open-windows-terminal.ps1, Launches Windows Terminal
|
||||
open-wikipedia.ps1, Opens Wikipedia's website
|
||||
open-youtube.ps1, Opens YouTube.com
|
||||
pick-commit.ps1, Cherry-picks a Git commit into multiple branches
|
||||
play-beep-sound.ps1, Plays a short beep sound
|
||||
play-files.ps1, Plays the given audio files
|
||||
play-happy-birthday.ps1, Plays the Happy Birthday song
|
||||
play-imperial-march.ps1, Plays the Imperial March (Star Wars)
|
||||
play-jingle-bells.ps1, Plays Jingle Bells
|
||||
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-tetris-melody.ps1, Plays the Tetris melody
|
||||
poweroff.ps1, Halts the local computer (needs admin rights)
|
||||
publish-to-ipfs.ps1, Publishes the given files or directory to IPFS
|
||||
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-branch.ps1, Creates a new branch in the current/given Git repository
|
||||
new-email.ps1, Starts the default email client to write a new email
|
||||
new-qrcode.ps1, Generates a new QR code
|
||||
new-script.ps1, Creates a new PowerShell script
|
||||
new-shortcut.ps1, Creates a new shortcut file
|
||||
new-symlink.ps1, Creates a new symbolic link file
|
||||
new-tag.ps1, Creates a new tag in a Git repository
|
||||
new-zipfile.ps1, Creates a new .zip file from a directory
|
||||
reboot.ps1, Reboots the local computer (needs admin rights)
|
||||
reboot-fritzbox.ps1, Reboots the FRITZ!box device
|
||||
remind-me.ps1, Creates a scheduled task that will display a popup message
|
||||
remove-empty-dirs.ps1, Removes empty subfolders within the given directory tree
|
||||
remove-print-jobs.ps1, Removes all jobs from all printers
|
||||
remove-tag.ps1, Removes a tag in a Git repository
|
||||
replace-in-files.ps1, Search and replace a pattern in the given files by the replacement
|
||||
restart-network-adapters.ps1, Restarts all local network adapters
|
||||
save-screenshot.ps1, Saves a single screenshot
|
||||
say-date.ps1, Say the current date by text-to-speech
|
||||
say-joke.ps1, Say a random Chuck Norris joke by text-to-speech
|
||||
say-quote.ps1, Say a random quote by text-to-speech
|
||||
say-time.ps1, Say the current time by text-to-speech
|
||||
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
|
||||
send-tcp.ps1, Sends a TCP message to the given IP address and port
|
||||
send-udp.ps1, Sends a UDP datagram message to the given IP address and port
|
||||
set-profile.ps1, Updates your PowerShell user profile
|
||||
set-timer.ps1, Sets a timer for a countdown
|
||||
set-wallpaper.ps1, Sets the given image as wallpaper
|
||||
simulate-matrix.ps1, Simulates the Matrix (fun)
|
||||
simulate-presence.ps1, Simulates the human presence against burglars
|
||||
speak-checklist.ps1, Speaks the given checklist by text-to-speech
|
||||
speak-countdown.ps1, Starts a countdown by text-to-speech
|
||||
speak-english.ps1, Speaks the given text with an English text-to-speech voice
|
||||
speak-epub.ps1, Speaks the content of the given Epub file by text-to-speech
|
||||
speak-file.ps1, Speaks the content of the given text file by text-to-speech
|
||||
speak-french.ps1, Speaks the given text with a French text-to-speech voice
|
||||
speak-german.ps1, Speaks the given text with a German text-to-speech voice
|
||||
speak-italian.ps1, Speaks the given text with an Italian text-to-speech voice
|
||||
speak-spanish.ps1, Speaks the given text with a Spanish text-to-speech voice
|
||||
speak-test.ps1, Performs a speak test by text-to-speech
|
||||
speak-text.ps1, Speaks the given text by text-to-speech
|
||||
start-calibre-server.ps1, Starts a local Calibre server
|
||||
start-ipfs-server.ps1, Starts a local IPFS server
|
||||
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)
|
||||
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)
|
||||
unmute-audio.ps1, Unmutes audio
|
||||
upgrade-ubuntu.ps1, Upgrades Ubuntu Linux to the latest (LTS) release
|
||||
upload-file.ps1, Uploads the local file to the given FTP server
|
||||
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-calendar.ps1, Writes the calendar (month or year)
|
||||
write-green.ps1, Writes the given text in a green foreground color
|
||||
write-joke.ps1], Writes a random Juck Norris joke
|
||||
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)
|
||||
write-quote.ps1, Writes a random quote
|
||||
write-red.ps1, Writes the given text in a red foreground color
|
||||
write-rot13.ps1, Encodes or decodes the given text with ROT13
|
||||
write-typewriter.ps1, Writes the given text with the typewriter effect
|
||||
write-uppercase.ps1, Writes the given text in uppercase letters
|
||||
write-vertical.ps1, Writes the given text in vertical direction
|
Can't render this file because it has a wrong number of fields in line 95.
|
@ -1,33 +0,0 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
← enter overview of script here
|
||||
.DESCRIPTION
|
||||
← enter brief description of script here
|
||||
.INPUTS
|
||||
← enter inputs here (if any, otherwise state None)
|
||||
.OUTPUTS
|
||||
← enter outputs here (if any, otherwise state None)
|
||||
.EXAMPLE
|
||||
PS> .\template.ps1 ← enter example here (repeat this attribute for more than one example)
|
||||
.NOTES
|
||||
Author: ← enter full name here
|
||||
License: ← enter license here
|
||||
.LINK
|
||||
← enter URL here
|
||||
#>
|
||||
|
||||
#requires -version 4
|
||||
|
||||
param() # ← enter script parameters here
|
||||
|
||||
# ← enter functions here
|
||||
|
||||
try {
|
||||
# ← enter instructions here
|
||||
|
||||
"✔️ Done."
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
118
Docs/FAQ.md
118
Docs/FAQ.md
@ -1,118 +0,0 @@
|
||||
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 and free** - see the Github repository at: https://github.com/PowerShell/PowerShell
|
||||
|
||||
✔️ it's **easy to learn** - see the tutorial for beginners at: https://www.guru99.com/powershell-tutorial.html
|
||||
|
||||
✔️ it's **fully documented** - see the PowerShell documentation at: https://docs.microsoft.com/en-us/powershell/
|
||||
|
||||
|
||||
How to install PowerShell?
|
||||
--------------------------
|
||||
* **On Windows** it's preinstalled. **However,** the execution policy is 'restricted' by default! To allow script execution: open the *Windows PowerShell (Administrator)* console and enter:
|
||||
```
|
||||
PS> Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser
|
||||
```
|
||||
* **On CentOS, Debian, Docker, Fedora, macOS, openSUSE, Red Hat, Ubuntu** visit https://github.com/PowerShell/PowerShell for installation.
|
||||
* **On Linux supporting Snaps** install PowerShell by executing:
|
||||
```
|
||||
$ snap install PowerShell
|
||||
$ ln -s /snap/bin/pwsh /usr/bin/pwsh
|
||||
```
|
||||
|
||||
How to get the PowerShell Scripts?
|
||||
----------------------------------
|
||||
* When using **Git**, execute in a terminal window: `> git clone https://github.com/fleschutz/PowerShell`
|
||||
* When using **Chocolatey**, execute in *Windows PowerShell (Administrator)*: `> choco install powershell-scripts --version=0.4`
|
||||
* **Otherwise,** download and unzip it from: https://github.com/fleschutz/PowerShell/archive/master.zip
|
||||
|
||||
|
||||
How to execute PowerShell Scripts?
|
||||
----------------------------------
|
||||
1. In the Windows desktop: right-click the script and select: *Execute with PowerShell*
|
||||
2. In a command-line interface (CLI, e.g. *Windows Terminal*, either local or remote via SSH) by typing: `./<FILENAME_OF_SCRIPT>`.
|
||||
3. By connecting a context menu item with a script.
|
||||
4. By voice control, e.g. see repo [talk2windows](https://github.com/fleschutz/talk2windows) for more information.
|
||||
5. By using automation software, e.g. [Jenkins](https://www.jenkins.io).
|
||||
6. Automatically on login (see AutoStart folder)/logoff/daily/etc.
|
||||
|
||||
|
||||
What about Security?
|
||||
--------------------
|
||||
* Execute scripts only that you trust (and/or where you have checked the code before)!
|
||||
* Prefer SSH Remoting instead of PowerShell Remoting
|
||||
* More recommendations by NSA and cyber security centers in the U.S. (CISA), New Zealand (NZ NCSC), and the U.K. (NCSC-UK) can be found here: https://media.defense.gov/2022/Jun/22/2003021689/-1/-1/1/CSI_KEEPING_POWERSHELL_SECURITY_MEASURES_TO_USE_AND_EMBRACE_20220622.PDF
|
||||
|
||||
|
||||
Why do some scripts show gibberish characters?
|
||||
----------------------------------------------
|
||||
Those PowerShell scripts are using Unicode characters. Use a modern console supporting UTF-8 such as *Windows Terminal*, please.
|
||||
|
||||
|
||||
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:
|
||||
|
||||
* **On Linux using Bash:** edit .profile in your home directory and add the line: PATH="$PATH:/path/to/PowerShell/Scripts"
|
||||
* **On Windows:** open Settings > System > About > Advanced system settings > Environment Variables, edit the user's variable "Path", and add the full path to the Scripts/ directory.
|
||||
|
||||
|
||||
How to use PowerShell in Windows context menus?
|
||||
-----------------------------------------------
|
||||
* to enable "right-click > New > Windows PowerShell Script" execute `Add_ps1_to_New_context_menu.reg` in subfolder [Data/](../Data)
|
||||
* to disable this execute `Remove_ps1_from_New_context_menu.reg` in subfolder [Data/](../Data)
|
||||
|
||||
|
||||
Which editor to use for PowerShell scripts?
|
||||
-------------------------------------------
|
||||
* **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, now recommended by Microsoft).
|
||||
* **PowerShell ISE** (Integrated Scripting Environment) - Former official PowerShell development environment included with Microsoft Windows.
|
||||
* **PowerShell Studio** - Powerful PowerShell IDE with module, help, and user interface development tools, high DPI support and regular updates.
|
||||
* **PowerShell Plus** - All in one IDE.
|
||||
* **Atom package** - Add-on with PowerShell language support for Atom.
|
||||
* **SublimeText package** - Add-on with PowerShell language support for Sublime Text.
|
||||
* or your **favorite text editor** as an alternative.
|
||||
|
||||
|
||||
How to write good PowerShell scripts?
|
||||
-------------------------------------
|
||||
Good PowerShell scripts are user-friendly and platform-independent. The following rules should be a good starting point:
|
||||
|
||||
1. Use the `<verb>-<object>.ps1` scheme to name the script.
|
||||
2. Use `UTF-8 BOM` encoding to support Unicode characters in the script.
|
||||
3. Add a comment-based help at the beginning with: `.SYNOPSIS`, `.DESCRIPTION`, `.PARAMETER`, `.EXAMPLE`, `.LINK`, and `.NOTES`.
|
||||
4. Check the requirements for the script, e.g. `#Requires -RunAsAdministrator`, or `#Requires -Version 3`
|
||||
5. Prefer command-line options, else ask the user for help
|
||||
6. Recommended is `Set-StrictMode -Version Latest` to enable additional error checking.
|
||||
7. For readibility use UpperCamelCase for variables and functions, lowerCamelCase for everything else.
|
||||
8. Set *execute* file permissions for Linux: `chmod a+rx <filename>`
|
||||
9. On success exit with error code 0 (`exit 0`), otherwise print the error with keyword "ERROR:" (to support log parsers) and exit the error code (mostly 1)
|
||||
|
||||
|
||||
Want to contribute or found a bug or issue?
|
||||
-------------------------------------------
|
||||
If you find something bad (like a bug, error, or any issue), please report it here by open an Issue.
|
||||
|
||||
Or even better: Fork the repository, add or fix the script and submit a pull request, so others can participate too.
|
||||
|
||||
|
||||
Your question is not answered here?
|
||||
-----------------------------------
|
||||
Send your question to: markus [at] fleschutz [dot] de
|
@ -1,106 +0,0 @@
|
||||
## The *add-firewall-rules.ps1* Script
|
||||
|
||||
This PowerShell script adds firewall rules for the given executable. Administrator rights are required.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
add-firewall-rules.ps1 [[-PathToExecutables] <String>] [<CommonParameters>]
|
||||
|
||||
-PathToExecutables <String>
|
||||
Specifies the path to the executables
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./add-firewall-rules C:\MyApp\bin
|
||||
Adding firewall rule for C:\MyApp\bin\app1.exe
|
||||
Adding firewall rule for C:\MyApp\bin\app2.exe
|
||||
...
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Adds firewall rules for executables (needs admin rights)
|
||||
.DESCRIPTION
|
||||
This PowerShell script adds firewall rules for the given executable. Administrator rights are required.
|
||||
.PARAMETER PathToExecutables
|
||||
Specifies the path to the executables
|
||||
.EXAMPLE
|
||||
PS> ./add-firewall-rules C:\MyApp\bin
|
||||
Adding firewall rule for C:\MyApp\bin\app1.exe
|
||||
Adding firewall rule for C:\MyApp\bin\app2.exe
|
||||
...
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
#Requires -RunAsAdministrator
|
||||
|
||||
param([string]$PathToExecutables = "")
|
||||
|
||||
$command = '
|
||||
$output = ''Firewall rules for path '' + $args[0]
|
||||
write-output $output
|
||||
for($i = 1; $i -lt $args.count; $i++){
|
||||
$path = $args[0]
|
||||
$path += ''\''
|
||||
$path += $args[$i]
|
||||
|
||||
$null = $args[$i] -match ''[^\\]*\.exe$''
|
||||
$name = $matches[0]
|
||||
$output = ''Adding firewall rule for '' + $name
|
||||
write-output $output
|
||||
$null = New-NetFirewallRule -DisplayName $name -Direction Inbound -Program $path -Profile Domain, Private -Action Allow
|
||||
}
|
||||
write-host -foregroundColor green -noNewline ''Done - press any key to continue...'';
|
||||
[void]$Host.UI.RawUI.ReadKey(''NoEcho,IncludeKeyDown'');
|
||||
'
|
||||
|
||||
|
||||
try {
|
||||
if ($PathToExecutables -eq "" ) {
|
||||
$PathToExecutables = read-host "Enter path to executables"
|
||||
}
|
||||
|
||||
$PathToExecutables = Convert-Path -Path $PathToExecutables
|
||||
|
||||
$Apps = Get-ChildItem "$PathToExecutables\*.exe" -Name
|
||||
|
||||
if($Apps.count -eq 0){
|
||||
write-warning "No executables found. No Firewall rules have been created."
|
||||
Write-Host -NoNewhLine 'Press any key to continue...';
|
||||
[void]$Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown');
|
||||
exit 1
|
||||
}
|
||||
|
||||
$arg = "PathToExecutables $Apps"
|
||||
Start-Process powershell -Verb runAs -ArgumentList "-command & {$command} $arg"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of add-firewall-rules.ps1*
|
@ -1,77 +0,0 @@
|
||||
## The *add-memo.ps1* Script
|
||||
|
||||
This PowerShell script adds the given memo text to $HOME/Memos.csv.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
add-memo.ps1 [[-text] <String>] [<CommonParameters>]
|
||||
|
||||
-text <String>
|
||||
Specifies the text to memorize
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./add-memo "Buy apples"
|
||||
✔️ added to 📄/home/markus/Memos.csv
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Adds a memo text
|
||||
.DESCRIPTION
|
||||
This PowerShell script adds the given memo text to $HOME/Memos.csv.
|
||||
.PARAMETER text
|
||||
Specifies the text to memorize
|
||||
.EXAMPLE
|
||||
PS> ./add-memo "Buy apples"
|
||||
✔️ added to 📄/home/markus/Memos.csv
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$text = "")
|
||||
|
||||
try {
|
||||
if ($text -eq "" ) { $text = read-host "Enter the memo text to add" }
|
||||
|
||||
$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" -pathType leaf)) {
|
||||
write-output "Time,User,text" > "$Path"
|
||||
}
|
||||
write-output $Line >> "$Path"
|
||||
|
||||
"✔️ added to 📄$Path"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of add-memo.ps1*
|
@ -1,167 +0,0 @@
|
||||
## The *build-repo.ps1* Script
|
||||
|
||||
This PowerShell script supports building with cmake, configure, autogen, Imakefile and Makefile.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
build-repo.ps1 [[-RepoDir] <String>] [<CommonParameters>]
|
||||
|
||||
-RepoDir <String>
|
||||
Specifies the path to the Git repository
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value "$PWD"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./build-repo C:\MyRepo
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Builds a Git repository
|
||||
.DESCRIPTION
|
||||
This PowerShell script supports building with cmake, configure, autogen, Imakefile and Makefile.
|
||||
.PARAMETER RepoDir
|
||||
Specifies the path to the Git repository
|
||||
.EXAMPLE
|
||||
PS> ./build-repo C:\MyRepo
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$RepoDir = "$PWD")
|
||||
|
||||
function MakeDir { param($Path)
|
||||
$DirName = (get-item "$Path").Name
|
||||
if (test-path "$Path/CMakeLists.txt" -pathType leaf) {
|
||||
"🔨 Building 📂$DirName using CMakeLists.txt to subfolder _My_Build/..."
|
||||
if (-not(test-path "$Path/_My_Build/" -pathType container)) {
|
||||
& mkdir "$Path/_My_Build/"
|
||||
}
|
||||
set-location "$Path/_My_Build/"
|
||||
|
||||
& cmake ..
|
||||
if ($lastExitCode -ne "0") { throw "Executing 'cmake ..' has failed" }
|
||||
|
||||
& make -j4
|
||||
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
|
||||
|
||||
& make test
|
||||
if ($lastExitCode -ne "0") { throw "Executing 'make test' has failed" }
|
||||
|
||||
} elseif (test-path "$Path/configure" -pathType leaf) {
|
||||
"🔨 Building 📂$DirName using 'configure'..."
|
||||
set-location "$Path/"
|
||||
|
||||
& ./configure
|
||||
#if ($lastExitCode -ne "0") { throw "Script 'configure' exited with error code $lastExitCode" }
|
||||
|
||||
& make -j4
|
||||
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
|
||||
|
||||
& make test
|
||||
if ($lastExitCode -ne "0") { throw "Executing 'make test' has failed" }
|
||||
|
||||
} elseif (test-path "$Path/autogen.sh" -pathType leaf) {
|
||||
"🔨 Building 📂$DirName using 'autogen.sh'..."
|
||||
set-location "$Path/"
|
||||
|
||||
& ./autogen.sh
|
||||
if ($lastExitCode -ne "0") { throw "Script 'autogen.sh' exited with error code $lastExitCode" }
|
||||
|
||||
& make -j4
|
||||
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
|
||||
|
||||
} elseif (test-path "$Path/build.gradle" -pathType leaf) {
|
||||
"🔨 Building 📂$DirName using build.gradle..."
|
||||
set-location "$Path"
|
||||
|
||||
& gradle build
|
||||
if ($lastExitCode -ne "0") { throw "'gradle build' has failed" }
|
||||
|
||||
& gradle test
|
||||
if ($lastExitCode -ne "0") { throw "'gradle test' has failed" }
|
||||
|
||||
} elseif (test-path "$Path/Imakefile" -pathType leaf) {
|
||||
"🔨 Building 📂$DirName 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 "$Path/Makefile" -pathType leaf) {
|
||||
"🔨 Building 📂$DirName using Makefile..."
|
||||
set-location "$Path"
|
||||
|
||||
& make -j4
|
||||
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
|
||||
|
||||
} elseif (test-path "$Path/compile.sh" -pathType leaf) {
|
||||
"🔨 Building 📂$DirName using 'compile.sh'..."
|
||||
set-location "$Path/"
|
||||
|
||||
& ./compile.sh
|
||||
if ($lastExitCode -ne "0") { throw "Script 'compile.sh' exited with error code $lastExitCode" }
|
||||
|
||||
& make -j4
|
||||
if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" }
|
||||
|
||||
} elseif (test-path "$Path/attower/src/build/DevBuild/build.bat" -pathType leaf) {
|
||||
"🔨 Building 📂$DirName using build.bat ..."
|
||||
set-location "$Path/attower/src/build/DevBuild/"
|
||||
|
||||
& ./build.bat build-all-release
|
||||
if ($lastExitCode -ne "0") { throw "Script 'build.bat' exited with error code $lastExitCode" }
|
||||
|
||||
} elseif (test-path "$Path/$DirName" -pathType container) {
|
||||
"🔨 No make rule found, trying subfolder 📂$($DirName)..."
|
||||
MakeDir "$Path/$DirName"
|
||||
} else {
|
||||
write-warning "Sorry, no make rule applies to: 📂$DirName"
|
||||
exit 0 # success
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
||||
$RepoDirName = (get-item "$RepoDir").Name
|
||||
|
||||
$PreviousPath = get-location
|
||||
MakeDir "$RepoDir"
|
||||
set-location "$PreviousPath"
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ built Git repository 📂$RepoDirName in $Elapsed sec"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of build-repo.ps1*
|
@ -1,26 +0,0 @@
|
||||
## bye-bye.ps1 - Replies to 'bye bye'
|
||||
|
||||
This script says a reply to 'bye bye' by text-to-speech (TTS).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
bye-bye.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./bye-bye
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of bye-bye.ps1*
|
@ -1,79 +0,0 @@
|
||||
## The *cd-repos.ps1* Script
|
||||
|
||||
This PowerShell script changes the working directory to the user's Git repositories folder.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
cd-repos.ps1 [[-Subpath] <String>] [<CommonParameters>]
|
||||
|
||||
-Subpath <String>
|
||||
Specifies an additional relative subpath (optional)
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./cd-repos
|
||||
📂C:\Users\Markus\Repos
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Sets the working directory to the user's repos folder
|
||||
.DESCRIPTION
|
||||
This PowerShell script changes the working directory to the user's Git repositories folder.
|
||||
.PARAMETER Subpath
|
||||
Specifies an additional relative subpath (optional)
|
||||
.EXAMPLE
|
||||
PS> ./cd-repos
|
||||
📂C:\Users\Markus\Repos
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$Subpath = "")
|
||||
|
||||
try {
|
||||
if (Test-Path "$HOME/Repos" -pathType Container) { # try short name
|
||||
$Path = "$HOME/Repos/$Subpath"
|
||||
} elseif (Test-Path "$HOME/Repositories" -pathType Container) { # try long name
|
||||
$Path = "$HOME/Repositories/$Subpath"
|
||||
} elseif (Test-Path "$HOME/source/repos" -pathType Container) { # try Visual Studio default
|
||||
$Path = "$HOME/source/repos/$Subpath"
|
||||
} else {
|
||||
throw "The folder for Git repositories at 📂$HOME/Reposh doesn't exist (yet)."
|
||||
}
|
||||
if (-not(Test-Path "$Path" -pathType Container)) {
|
||||
throw "The path to 📂$Path doesn't exist (yet)."
|
||||
}
|
||||
$Path = Resolve-Path "$Path"
|
||||
Set-Location "$Path"
|
||||
"📂$Path"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error: $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of cd-repos.ps1*
|
@ -1,62 +0,0 @@
|
||||
## The *cd-screenshots.ps1* Script
|
||||
|
||||
This PowerShell script changes the working directory to the user's screenshots folder.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
cd-screenshots.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./cd-screenshots
|
||||
📂C:\Users\Markus\Pictures\Screenshots
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Sets the working directory to the user's screenshots folder
|
||||
.DESCRIPTION
|
||||
This PowerShell script changes the working directory to the user's screenshots folder.
|
||||
.EXAMPLE
|
||||
PS> ./cd-screenshots
|
||||
📂C:\Users\Markus\Pictures\Screenshots
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
if ($IsLinux) {
|
||||
$Path = Resolve-Path "$HOME/Pictures/Screenshots"
|
||||
} else {
|
||||
$Path = [Environment]::GetFolderPath('MyPictures')
|
||||
$Path = "$Path\Screenshots"
|
||||
}
|
||||
if (-not(Test-Path "$Path" -pathType container)) {
|
||||
throw "Screenshots folder at 📂$Path doesn't exist (yet)"
|
||||
}
|
||||
Set-Location "$Path"
|
||||
"📂$Path"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of cd-screenshots.ps1*
|
@ -1,57 +0,0 @@
|
||||
## The *check-apps.ps1* Script
|
||||
|
||||
This PowerShell script queries application details and list it.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
check-apps.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-apps
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Query application details
|
||||
.DESCRIPTION
|
||||
This PowerShell script queries application details and list it.
|
||||
.EXAMPLE
|
||||
PS> ./check-apps
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
if ($IsLinux) {
|
||||
# TODO
|
||||
} else {
|
||||
Write-Progress "Querying installed apps and available updates..."
|
||||
$NumAppsInstalled = (Get-AppxPackage).Count
|
||||
$NumUpdates = (winget upgrade).Count - 5
|
||||
"✅ $NumAppsInstalled apps installed, $NumUpdates updates available"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-apps.ps1*
|
@ -1,67 +0,0 @@
|
||||
## The *check-battery.ps1* Script
|
||||
|
||||
This PowerShell script checks and prints the battery status.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
check-battery.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-battery
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the battery status
|
||||
.DESCRIPTION
|
||||
This PowerShell script checks and prints the battery status.
|
||||
.EXAMPLE
|
||||
PS> ./check-battery
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
if ($IsLinux) {
|
||||
# TODO
|
||||
} else {
|
||||
Add-Type -Assembly System.Windows.Forms
|
||||
$Details = [System.Windows.Forms.SystemInformation]::PowerStatus
|
||||
if ($Details.BatteryChargeStatus -eq "NoSystemBattery") {
|
||||
$BatteryStatus = "No battery"
|
||||
} else {
|
||||
[int]$Percent = 100*$Details.BatteryLifePercent
|
||||
[int]$Remaining = $Details.BatteryLifeRemaining / 60
|
||||
$BatteryStatus = "Battery $Percent%, $Remaining min left"
|
||||
}
|
||||
switch ($Details.PowerLineStatus) {
|
||||
"Online" { $PowerStatus = "plugged in to AC power" }
|
||||
"Offline" { $PowerStatus = "disconnected from AC power" }
|
||||
}
|
||||
"✅ $BatteryStatus, $PowerStatus"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-battery.ps1*
|
@ -1,62 +0,0 @@
|
||||
## The *check-bios.ps1* Script
|
||||
|
||||
This PowerShell script queries BIOS details and prints it.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
check-bios.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-bios
|
||||
✅ BIOS V1.10 by INSYDE Corp. (S/N NXA82EV0EBB07600, version ACRSYS - 2)
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks BIOS details
|
||||
.DESCRIPTION
|
||||
This PowerShell script queries BIOS details and prints it.
|
||||
.EXAMPLE
|
||||
PS> ./check-bios
|
||||
✅ BIOS V1.10 by INSYDE Corp. (S/N NXA82EV0EBB07600, version ACRSYS - 2)
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
Write-Progress "Querying BIOS details..."
|
||||
if ($IsLinux) {
|
||||
# TODO
|
||||
} else {
|
||||
$BIOS = Get-CimInstance -ClassName Win32_BIOS
|
||||
$Manufacturer = $BIOS.Manufacturer
|
||||
$Model = $BIOS.Name
|
||||
$Serial = $BIOS.SerialNumber
|
||||
$Version = $BIOS.Version
|
||||
"✅ BIOS $Model by $Manufacturer (S/N $Serial, version $Version)"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-bios.ps1*
|
@ -1,26 +0,0 @@
|
||||
## check-christmas.ps1 - Checks the time until Christmas
|
||||
|
||||
This script checks the time until Christmas and replies by text-to-speech (TTS).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
check-christmas.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-christmas
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-christmas.ps1*
|
@ -1,78 +0,0 @@
|
||||
## The *check-cpu.ps1* Script
|
||||
|
||||
check-cpu.ps1
|
||||
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Queries and prints CPU details
|
||||
.DESCRIPTION
|
||||
This PowerShell script queries CPU details (name, type, speed, temperature, etc.) and prints it.
|
||||
.EXAMPLE
|
||||
PS> ./check-cpu
|
||||
✅ CPU AMD Ryzen 5 5500U with Radeon Graphics (CPU0, 2100MHz, 31.3°C)
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
function GetCPUTemperatureInCelsius {
|
||||
$Temp = 99999.9 # unsupported
|
||||
if ($IsLinux) {
|
||||
if (Test-Path "/sys/class/thermal/thermal_zone0/temp" -pathType leaf) {
|
||||
[int]$IntTemp = Get-Content "/sys/class/thermal/thermal_zone0/temp"
|
||||
$Temp = [math]::round($IntTemp / 1000.0, 1)
|
||||
}
|
||||
} else {
|
||||
$Objects = Get-WmiObject -Query "SELECT * FROM Win32_PerfFormattedData_Counters_ThermalZoneInformation" -Namespace "root/CIMV2"
|
||||
foreach ($Obj in $Objects) {
|
||||
$HiPrec = $Obj.HighPrecisionTemperature
|
||||
$Temp = [math]::round($HiPrec / 100.0, 1)
|
||||
}
|
||||
}
|
||||
return $Temp;
|
||||
}
|
||||
|
||||
try {
|
||||
Write-Progress "Querying CPU details ..."
|
||||
$Celsius = GetCPUTemperatureInCelsius
|
||||
if ($Celsius -eq 99999.9) {
|
||||
$Temp = "no temp"
|
||||
} elseif ($Celsius -gt 50) {
|
||||
$Temp = "⚠️$($Celsius)°C"
|
||||
} elseif ($Celsius -lt 0) {
|
||||
$Temp = "⚠️$($Celsius)°C"
|
||||
} else {
|
||||
$Temp = "$($Celsius)°C"
|
||||
}
|
||||
|
||||
if ($IsLinux) {
|
||||
"✅ CPU has $Temp"
|
||||
} else {
|
||||
$Details = Get-WmiObject -Class Win32_Processor
|
||||
$CPUName = $Details.Name.trim()
|
||||
$DeviceID = $Details.DeviceID
|
||||
$Speed = "$($Details.MaxClockSpeed)MHz"
|
||||
$Socket = $Details.SocketDesignation
|
||||
"✅ CPU $CPUName ($DeviceID, $Speed, socket $Socket, $Temp)"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-cpu.ps1*
|
@ -1,27 +0,0 @@
|
||||
## check-dns-resolution.ps1 - Checks the DNS resolution with frequently used domain names
|
||||
|
||||
This script checks the DNS resolution with frequently used domain names.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
/home/markus/Repos/PowerShell/Scripts/check-dns-resolution.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-dns-resolution
|
||||
✔️ 11.8 domains/sec (177 domains resolved in 15 sec)
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-dns-resolution.ps1*
|
@ -1,72 +0,0 @@
|
||||
## The *check-dns-server.ps1* Script
|
||||
|
||||
check-dns-server.ps1
|
||||
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks DNS server
|
||||
.DESCRIPTION
|
||||
This PowerShell script checks the speed of public DNS server.
|
||||
.EXAMPLE
|
||||
PS> ./check-dns-server
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
function CheckDNS { param($Name, $PriIPv4, $SecIPv4)
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
$null = (nslookup whitehouse.gov $PriIPv4)
|
||||
[int]$PriIPv4Elapsed = $StopWatch.Elapsed.TotalMilliseconds
|
||||
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
$null = (nslookup whitehouse.gov $SecIPv4)
|
||||
[int]$SecIPv4Elapsed = $StopWatch.Elapsed.TotalMilliseconds
|
||||
|
||||
" `"$Name`"; `"$PriIPv4`"; `"$PriIPv4Elapsed ms`"; `"$SecIPv4`"; `"$SecIPv4Elapsed ms`"; "
|
||||
}
|
||||
|
||||
try {
|
||||
"Checking speed of public DNS server..."
|
||||
" `"Company`"; `"IPv4 primary`"; `"Latency in ms`"; `"IPv4 secondary`"; `"Latency in ms`"; "
|
||||
CheckDNS "Cloudflare" 1.1.1.1 1.0.0.1
|
||||
CheckDNS "Cloudflare with malware blocklist" 1.1.1.2 1.0.0.2
|
||||
CheckDNS "Cloudflare with malware+adult blocklist" 1.1.1.3 1.0.0.3
|
||||
CheckDNS "DNS.Watch" 84.200.69.80 84.200.70.40
|
||||
CheckDNS "FreeDNS Vienna" 37.235.1.174 37.235.1.177
|
||||
CheckDNS "Google Public DNS" 8.8.8.8 8.8.4.4
|
||||
CheckDNS "Level3 one" 4.2.2.1 4.2.2.1
|
||||
CheckDNS "Level3 two" 4.2.2.2 4.2.2.2
|
||||
CheckDNS "Level3 three" 4.2.2.3 4.2.2.3
|
||||
CheckDNS "Level3 four" 4.2.2.4 4.2.2.4
|
||||
CheckDNS "Level3 five" 4.2.2.5 4.2.2.5
|
||||
CheckDNS "Level3 six" 4.2.2.6 4.2.2.6
|
||||
CheckDNS "OpenDNS Basic" 208.67.222.222 208.67.220.220
|
||||
CheckDNS "OpenDNS Family Shield" 208.67.222.123 208.67.220.123
|
||||
CheckDNS "OpenNIC" 94.247.43.254 94.247.43.254
|
||||
CheckDNS "Quad9 with malware blocklist, with DNSSEC" 9.9.9.9 9.9.9.9
|
||||
CheckDNS "Quad9, no malware blocklist, no DNSSEC" 9.9.9.10 9.9.9.10
|
||||
CheckDNS "Quad9, with malware blocklist, with DNSSEC, with EDNS" 9.9.9.11 9.9.9.11
|
||||
CheckDNS "Quad9, with malware blocklist, with DNSSEC, NXDOMAIN only" 9.9.9.12 9.9.9.12
|
||||
CheckDNS "Verisign Public DNS" 64.6.64.6 64.6.65.6
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-dns-server.ps1*
|
@ -1,69 +0,0 @@
|
||||
## The *check-dns.ps1* Script
|
||||
|
||||
This PowerShell script measures and prints the DNS resolution speed by using 200 frequently used domain names.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
check-dns.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-dns
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the DNS resolution
|
||||
.DESCRIPTION
|
||||
This PowerShell script measures and prints the DNS resolution speed by using 200 frequently used domain names.
|
||||
.EXAMPLE
|
||||
PS> ./check-dns
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
Write-Progress "⏳ Step 1/2 - Reading from Data/frequent-domains.csv..."
|
||||
$Table = Import-CSV "$PSScriptRoot/../Data/frequent-domains.csv"
|
||||
$NumRows = $Table.Length
|
||||
|
||||
Write-Progress "⏳ Step 2/2 - Resolving $NumRows domains..."
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
if ($IsLinux) {
|
||||
foreach($Row in $Table){$nop=dig $Row.Domain +short}
|
||||
} else {
|
||||
foreach($Row in $Table){$nop=Resolve-DNSName $Row.Domain}
|
||||
}
|
||||
|
||||
[float]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
$Average = [math]::round($NumRows / $Elapsed, 1)
|
||||
|
||||
if ($Average -gt 10.0) {
|
||||
"✅ DNS resolves $Average domains per second"
|
||||
} else {
|
||||
"⚠️ DNS resolves only $Average domains per second!"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-dns.ps1*
|
@ -1,88 +0,0 @@
|
||||
## The *check-drive-space.ps1* Script
|
||||
|
||||
This PowerShell script checks a drive for free space left (20 GB by default).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
check-drive-space.ps1 [[-Drive] <String>] [[-MinLevel] <Int32>] [<CommonParameters>]
|
||||
|
||||
-Drive <String>
|
||||
Specifies the drive to check
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
-MinLevel <Int32>
|
||||
Specifies the minimum level in Gigabyte
|
||||
|
||||
Required? false
|
||||
Position? 2
|
||||
Default value 20
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-drive-space C
|
||||
✔️ 172 GB left on drive C (61 of 233 GB used)
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks a drive for free space left
|
||||
.DESCRIPTION
|
||||
This PowerShell script checks a drive for free space left (20 GB by default).
|
||||
.PARAMETER Drive
|
||||
Specifies the drive to check
|
||||
.PARAMETER MinLevel
|
||||
Specifies the minimum level in Gigabyte
|
||||
.EXAMPLE
|
||||
PS> ./check-drive-space C
|
||||
✔️ 172 GB left on drive C (61 of 233 GB used)
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$Drive = "", [int]$MinLevel = 20) # minimum level in GB
|
||||
|
||||
try {
|
||||
if ($Drive -eq "" ) { $Drive = read-host "Enter drive to check" }
|
||||
|
||||
$DriveDetails = (get-psdrive $Drive)
|
||||
[int]$Free = (($DriveDetails.Free / 1024) / 1024) / 1024
|
||||
[int]$Used = (($DriveDetails.Used / 1024) / 1024) / 1024
|
||||
[int]$Total = ($Used + $Free)
|
||||
|
||||
if ($Free -lt $MinLevel) {
|
||||
write-warning "Drive $Drive has only $Free GB left to use! ($Used of $Total GB used, minimum is $MinLevel GB)"
|
||||
exit 1
|
||||
}
|
||||
|
||||
& "$PSScriptRoot/speak-english.ps1" "Drive $Drive has $Free GB left ($Total GB total)"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-drive-space.ps1*
|
@ -1,96 +0,0 @@
|
||||
## The *check-drives.ps1* Script
|
||||
|
||||
This PowerShell script checks all drives for free space left.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
check-drives.ps1 [[-MinLevel] <Int32>] [<CommonParameters>]
|
||||
|
||||
-MinLevel <Int32>
|
||||
Specifies the minimum warning level (10 GB by default)
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value 10
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-drives
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the drive space
|
||||
.DESCRIPTION
|
||||
This PowerShell script checks all drives for free space left.
|
||||
.PARAMETER MinLevel
|
||||
Specifies the minimum warning level (10 GB by default)
|
||||
.EXAMPLE
|
||||
PS> ./check-drives
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([int]$MinLevel = 10) # 10 GB minimum
|
||||
|
||||
function Bytes2String { param([int64]$Bytes)
|
||||
if ($Bytes -lt 1000) { return "$Bytes bytes" }
|
||||
$Bytes /= 1000
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)KB" }
|
||||
$Bytes /= 1000
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)MB" }
|
||||
$Bytes /= 1000
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)GB" }
|
||||
$Bytes /= 1000
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)TB" }
|
||||
$Bytes /= 1000
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)PB" }
|
||||
$Bytes /= 1000
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)EB" }
|
||||
}
|
||||
|
||||
try {
|
||||
$Drives = Get-PSDrive -PSProvider FileSystem
|
||||
foreach($Drive in $Drives) {
|
||||
$ID = $Drive.Name
|
||||
$Details = (Get-PSDrive $ID)
|
||||
[int64]$Free = $Details.Free
|
||||
[int64]$Used = $Details.Used
|
||||
[int64]$Total = ($Used + $Free)
|
||||
|
||||
if ($Total -eq 0) {
|
||||
"✅ Drive $ID is empty"
|
||||
} elseif ($Free -lt $MinLevel) {
|
||||
"⚠️ Drive $ID has only $(Bytes2String $Free) of $(Bytes2String $Total) left to use!"
|
||||
} elseif ($Used -lt $Free) {
|
||||
"✅ Drive $ID uses $(Bytes2String $Used) of $(Bytes2String $Total)"
|
||||
} else {
|
||||
"✅ Drive $ID has $(Bytes2String $Free) free of $(Bytes2String $Total)"
|
||||
}
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-drives.ps1*
|
@ -1,65 +0,0 @@
|
||||
## The *check-health.ps1* Script
|
||||
|
||||
This PowerShell script checks some health parameter of the local computer.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
check-health.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-health
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the system health
|
||||
.DESCRIPTION
|
||||
This PowerShell script checks some health parameter of the local computer.
|
||||
.EXAMPLE
|
||||
PS> ./check-health
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
" "
|
||||
& "$PSScriptRoot/write-green.ps1" " H A R D W A R E"
|
||||
& "$PSScriptRoot/check-cpu.ps1"
|
||||
& "$PSScriptRoot/check-ram.ps1"
|
||||
& "$PSScriptRoot/check-gpu.ps1"
|
||||
& "$PSScriptRoot/check-bios.ps1"
|
||||
& "$PSScriptRoot/check-smart-devices.ps1"
|
||||
& "$PSScriptRoot/check-drives.ps1"
|
||||
& "$PSScriptRoot/check-battery.ps1"
|
||||
" "
|
||||
& "$PSScriptRoot/write-green.ps1" " S O F T W A R E"
|
||||
& "$PSScriptRoot/check-os.ps1"
|
||||
& "$PSScriptRoot/check-powershell.ps1"
|
||||
& "$PSScriptRoot/check-apps.ps1"
|
||||
& "$PSScriptRoot/check-uptime.ps1"
|
||||
& "$PSScriptRoot/check-time-zone.ps1"
|
||||
& "$PSScriptRoot/check-swap-space.ps1"
|
||||
& "$PSScriptRoot/check-dns.ps1"
|
||||
& "$PSScriptRoot/check-ping.ps1"
|
||||
& "$PSScriptRoot/check-vpn.ps1"
|
||||
& "$PSScriptRoot/check-pending-reboot.ps1"
|
||||
exit 0 # success
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-health.ps1*
|
@ -1,64 +0,0 @@
|
||||
## The *check-os.ps1* Script
|
||||
|
||||
This PowerShell script queries and lists operating system details.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
check-os.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-os
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Query OS details
|
||||
.DESCRIPTION
|
||||
This PowerShell script queries and lists operating system details.
|
||||
.EXAMPLE
|
||||
PS> ./check-os
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
if ($IsLinux) {
|
||||
"✅ $(uname -sr)"
|
||||
} else {
|
||||
$OS = Get-WmiObject -class Win32_OperatingSystem
|
||||
$Name = $OS.Caption
|
||||
$Arch = $OS.OSArchitecture
|
||||
$Version = $OS.Version
|
||||
|
||||
[system.threading.thread]::currentthread.currentculture = [system.globalization.cultureinfo]"en-US"
|
||||
$OSDetails = Get-CimInstance Win32_OperatingSystem
|
||||
$BuildNo = $OSDetails.BuildNumber
|
||||
$Serial = $OSDetails.SerialNumber
|
||||
$InstallDate = $OSDetails.InstallDate
|
||||
"✅ $($Name) ($Arch, v$Version, S/N $Serial) installed on $($InstallDate.ToShortDateString())"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-os.ps1*
|
@ -1,82 +0,0 @@
|
||||
## The *check-pending-reboot.ps1* Script
|
||||
|
||||
check-pending-reboot.ps1
|
||||
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Check for pending reboots
|
||||
.DESCRIPTION
|
||||
This PowerShell script checks different registry keys and values to determine if a reboot is pending.
|
||||
.EXAMPLE
|
||||
./check-pending-reboot.ps1
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
function Test-RegistryValue { param([parameter(Mandatory=$true)][ValidateNotNullOrEmpty()]$Path, [parameter(Mandatory=$true)] [ValidateNotNullOrEmpty()]$Value)
|
||||
try {
|
||||
Get-ItemProperty -Path $Path -Name $Value -EA Stop
|
||||
return $true
|
||||
} catch {
|
||||
return $false
|
||||
}
|
||||
}
|
||||
|
||||
$Reason = ""
|
||||
|
||||
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired") {
|
||||
$Reason += ", found registry entry '...\WindowsUpdate\Auto Update\RebootRequired'"
|
||||
}
|
||||
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\PostRebootReporting") {
|
||||
$Reason += ", found registry entry '...\WindowsUpdate\Auto Update\PostRebootReporting'"
|
||||
}
|
||||
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending") {
|
||||
$Reason += ", found registry entry '...\Component Based Servicing\RebootPending'"
|
||||
}
|
||||
if (Test-Path -Path "HKLM:\SOFTWARE\Microsoft\ServerManager\CurrentRebootAttempts") {
|
||||
$Reason += ", found registry entry '...\ServerManager\CurrentRebootAttempts'"
|
||||
}
|
||||
if (Test-RegistryValue -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing" -Value "RebootInProgress") {
|
||||
$Reason += ", found registry entry '...\CurrentVersion\Component Based Servicing' with 'RebootInProgress'"
|
||||
}
|
||||
if (Test-RegistryValue -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing" -Value "PackagesPending") {
|
||||
$Reason += ", found registry entry '...\CurrentVersion\Component Based Servicing' with 'PackagesPending'"
|
||||
}
|
||||
#if (Test-RegistryValue -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" -Value "PendingFileRenameOperations") {
|
||||
# $Reason += ", found registry entry '...\CurrentControlSet\Control\Session Manager' with 'PendingFileRenameOperations'"
|
||||
#}
|
||||
if (Test-RegistryValue -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" -Value "PendingFileRenameOperations2") {
|
||||
$Reason += ", found registry entry '...\CurrentControlSet\Control\Session Manager' with 'PendingFileRenameOperations2'"
|
||||
}
|
||||
if (Test-RegistryValue -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" -Value "DVDRebootSignal") {
|
||||
$Reason += ", found registry entry '...\Windows\CurrentVersion\RunOnce' with 'DVDRebootSignal'"
|
||||
}
|
||||
if (Test-RegistryValue -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon" -Value "JoinDomain") {
|
||||
$Reason += ", found registry entry '...\CurrentControlSet\Services\Netlogon' with 'JoinDomain'"
|
||||
}
|
||||
if (Test-RegistryValue -Path "HKLM:\SYSTEM\CurrentControlSet\Services\Netlogon" -Value "AvoidSpnSet") {
|
||||
$Reason += ", found registry entry '...\CurrentControlSet\Services\Netlogon' with 'AvoidSpnSet'"
|
||||
}
|
||||
if ($Reason -ne "") {
|
||||
"⚠️ Pending reboot ($($Reason.substring(2)))"
|
||||
} else {
|
||||
"✅ No pending reboot"
|
||||
}
|
||||
exit 0 # success
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-pending-reboot.ps1*
|
@ -1,78 +0,0 @@
|
||||
## The *check-ping.ps1* Script
|
||||
|
||||
This PowerShell script checks the ping latency from the local computer to some Internet hosts.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
check-ping.ps1 [[-hosts] <String>] [<CommonParameters>]
|
||||
|
||||
-hosts <String>
|
||||
Specifies the hosts to check, seperated by comma (default is: amazon.com,bing.com,cnn.com,dropbox.com,facebook.com,google.com,live.com,twitter.com,youtube.com)
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value amazon.com,bing.com,cnn.com,dropbox.com,facebook.com,google.com,live.com,twitter.com,youtube.com
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-ping
|
||||
✅ Ping is 25ms average, 13ms min, 109ms max.
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the ping latency
|
||||
.DESCRIPTION
|
||||
This PowerShell script checks the ping latency from the local computer to some Internet hosts.
|
||||
.PARAMETER hosts
|
||||
Specifies the hosts to check, seperated by comma (default is: amazon.com,bing.com,cnn.com,dropbox.com,facebook.com,google.com,live.com,twitter.com,youtube.com)
|
||||
.EXAMPLE
|
||||
PS> ./check-ping
|
||||
✅ Ping is 25ms average, 13ms min, 109ms max.
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$hosts = "amazon.com,bing.com,cnn.com,dropbox.com,facebook.com,google.com,live.com,twitter.com,youtube.com")
|
||||
|
||||
try {
|
||||
Write-Progress "⏳ Pinging $hosts..."
|
||||
$HostsArray = $hosts.Split(",")
|
||||
$Pings = Test-Connection -count 1 -computerName $HostsArray
|
||||
|
||||
[int]$Min = 9999999
|
||||
[int]$Max = [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 /= $Pings.count
|
||||
"✅ Ping is $($Avg)ms average, $($Min)ms min, $($Max)ms max"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-ping.ps1*
|
@ -1,59 +0,0 @@
|
||||
## The *check-powershell.ps1* Script
|
||||
|
||||
This PowerShell script queries and lists details of PowerShell.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
check-powershell.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-powershell
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Query PowerShell details
|
||||
.DESCRIPTION
|
||||
This PowerShell script queries and lists details of PowerShell.
|
||||
.EXAMPLE
|
||||
PS> ./check-powershell
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
$Version = $PSVersionTable.PSVersion
|
||||
$Edition = $PSVersionTable.PSEdition
|
||||
$NumModules = (Get-Module).Count
|
||||
$NumAliases = (Get-Alias).Count
|
||||
if ($IsLinux) {
|
||||
"✅ PowerShell $Version ($Edition edition) with $NumModules modules and $NumAliases aliases"
|
||||
} else {
|
||||
$NumCmdlets = (Get-Command -Command-Type cmdlet).Count
|
||||
"✅ PowerShell $Version ($Edition edition) with $NumModules modules, $NumCmdlets cmdlets and $NumAliases aliases"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-powershell.ps1*
|
@ -1,116 +0,0 @@
|
||||
## The *check-repo.ps1* Script
|
||||
|
||||
This PowerShell script verifies the integrity of a local Git repository.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
check-repo.ps1 [[-RepoDir] <String>] [<CommonParameters>]
|
||||
|
||||
-RepoDir <String>
|
||||
Specifies the path to the Git repository (current working dir by default)
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value "$PWD"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-repo
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks a Git repository
|
||||
.DESCRIPTION
|
||||
This PowerShell script verifies the integrity of a local Git repository.
|
||||
.PARAMETER RepoDir
|
||||
Specifies the path to the Git repository (current working dir by default)
|
||||
.EXAMPLE
|
||||
PS> ./check-repo
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$RepoDir = "$PWD")
|
||||
|
||||
try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
Write-Host "⏳ (1/11) Searching for Git executable... " -noNewline
|
||||
& git --version
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
Write-Host "⏳ (2/11) Checking path... " -noNewline
|
||||
$FullPath = Resolve-Path "$RepoDir"
|
||||
if (!(Test-Path "$FullPath" -pathType Container)) { throw "Can't access folder: $FullPath" }
|
||||
"$FullPath"
|
||||
|
||||
Write-Host "⏳ (3/11) Searching for 📂.git... " -noNewline
|
||||
if (!(Test-Path "$FullPath/.git" -pathType container)) { throw "Can't access folder: $FullPath/.git" }
|
||||
"OK"
|
||||
|
||||
Write-Host "⏳ (4/11) Query remote URL... " -noNewline
|
||||
& git -C "$FullPath" remote get-url origin
|
||||
if ($lastExitCode -ne "0") { throw "'git remote get-url origin' failed with exit code $lastExitCode" }
|
||||
|
||||
Write-Host "⏳ (5/11) Query current branch... " -noNewline
|
||||
& git -C "$FullPath" branch --show-current
|
||||
if ($lastExitCode -ne "0") { throw "'git branch --show-current' failed with exit code $lastExitCode" }
|
||||
|
||||
Write-Host "⏳ (6/11) Trying to fetch... " -noNewline
|
||||
& git -C "$FullPath" fetch
|
||||
if ($lastExitCode -ne "0") { throw "'git branch --show-current' failed with exit code $lastExitCode" }
|
||||
Write-Host "OK"
|
||||
|
||||
Write-Host "⏳ (7/11) Query latest tag... " -noNewline
|
||||
$LatestTagCommitID = (git -C "$FullPath" rev-list --tags --max-count=1)
|
||||
$LatestTagName = (git -C "$FullPath" describe --tags $LatestTagCommitID)
|
||||
Write-Host "$LatestTagName (commit $LatestTagCommitID)"
|
||||
|
||||
Write-Host "⏳ (8/11) Verify data integrity..."
|
||||
& git -C "$FullPath" fsck
|
||||
if ($lastExitCode -ne "0") { throw "'git fsck' failed with exit code $lastExitCode" }
|
||||
|
||||
Write-Host "⏳ (9/11) Run maintenance tasks..."
|
||||
& git -C "$FullPath" maintenance run
|
||||
if ($lastExitCode -ne "0") { throw "'git maintenance run' failed with exit code $lastExitCode" }
|
||||
|
||||
Write-Host "⏳ (10/11) Query submodule status... " -noNewline
|
||||
& git -C "$FullPath" submodule status
|
||||
if ($lastExitCode -ne "0") { throw "'git submodule status' failed with exit code $lastExitCode" }
|
||||
" "
|
||||
|
||||
Write-Host "⏳ (11/11) Query repository status... " -noNewline
|
||||
& git -C "$FullPath" status --short
|
||||
if ($lastExitCode -ne "0") { throw "'git status --short' failed with exit code $lastExitCode" }
|
||||
" "
|
||||
|
||||
$RepoDirName = (Get-Item "$FullPath").Name
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ checked 📂$RepoDirName repo in $Elapsed sec"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-repo.ps1*
|
@ -1,93 +0,0 @@
|
||||
## The *check-smart-devices.ps1* Script
|
||||
|
||||
check-smart-devices.ps1
|
||||
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks SMART devices
|
||||
.DESCRIPTION
|
||||
This PowerShell script queries S.M.A.R.T. HDD/SSD device details and prints it.
|
||||
.EXAMPLE
|
||||
PS> ./check-smart-devices
|
||||
✅ 1TB Samsung SSD 970 EVO via NVMe: 37°C, 2388 hours, 289x on, v2B2QEXE7, selftest passed
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
function Bytes2String { param([int64]$Bytes)
|
||||
if ($Bytes -lt 1000) { return "$Bytes bytes" }
|
||||
$Bytes /= 1000
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)KB" }
|
||||
$Bytes /= 1000
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)MB" }
|
||||
$Bytes /= 1000
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)GB" }
|
||||
$Bytes /= 1000
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)TB" }
|
||||
$Bytes /= 1000
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)PB" }
|
||||
$Bytes /= 1000
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)EB" }
|
||||
}
|
||||
|
||||
try {
|
||||
Write-Progress "⏳ Step 1/3 - Searching for smartctl executable..."
|
||||
$Result = (smartctl --version)
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'smartctl' - make sure smartmontools are installed" }
|
||||
|
||||
Write-Progress "⏳ Step 2/3 - Scanning S.M.A.R.T devices..."
|
||||
if ($IsLinux) {
|
||||
$Devices = $(sudo smartctl --scan-open)
|
||||
} else {
|
||||
$Devices = $(smartctl --scan-open)
|
||||
}
|
||||
foreach($Device in $Devices) {
|
||||
Write-Progress "⏳ Step 3/3 - Querying S.M.A.R.T devices..."
|
||||
$Array = $Device.split(" ")
|
||||
$Device = $Array[0]
|
||||
if ("$Device" -eq "#") {
|
||||
continue
|
||||
} elseif ($IsLinux) {
|
||||
$Details = (sudo smartctl --all --json $Device) | ConvertFrom-Json
|
||||
$null = (sudo smartctl --test=short $Device)
|
||||
} else {
|
||||
$Details = (smartctl --all --json $Device) | ConvertFrom-Json
|
||||
$null = (smartctl --test=short $Device)
|
||||
}
|
||||
$ModelName = $Details.model_name
|
||||
$Protocol = $Details.device.protocol
|
||||
[int64]$GBytes = $Details.user_capacity.bytes
|
||||
if ($GBytes -gt 0) {
|
||||
$Capacity = "$(Bytes2String $GBytes) "
|
||||
} else {
|
||||
$Capacity = ""
|
||||
}
|
||||
$Temp = $Details.temperature.current
|
||||
$Firmware = $Details.firmware_version
|
||||
$PowerOn = $Details.power_cycle_count
|
||||
$Hours = $Details.power_on_time.hours
|
||||
if ($Details.smart_status.passed) { $Status = "passed" } else { $Status = "FAILED" }
|
||||
"✅ $($Capacity)$ModelName via $($Protocol): $($Temp)°C, $($Hours) hours, $($PowerOn)x on, v$($Firmware), selftest $Status"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-smart-devices.ps1*
|
@ -1,101 +0,0 @@
|
||||
## The *check-swap-space.ps1* Script
|
||||
|
||||
This PowerShell script checks the free swap space.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
check-swap-space.ps1 [[-MinLevel] <Int32>] [<CommonParameters>]
|
||||
|
||||
-MinLevel <Int32>
|
||||
Specifies the minimum level (10 GB by default)
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value 10
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-swap-space
|
||||
✅ Swap space uses 63 GB of 1856 GB.
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the swap space
|
||||
.DESCRIPTION
|
||||
This PowerShell script checks the free swap space.
|
||||
.PARAMETER MinLevel
|
||||
Specifies the minimum level (10 GB by default)
|
||||
.EXAMPLE
|
||||
PS> ./check-swap-space
|
||||
✅ Swap space uses 63 GB of 1856 GB.
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([int]$MinLevel = 10) # minimum level in GB
|
||||
|
||||
function MB2String { param([int64]$Bytes)
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)MB" }
|
||||
$Bytes /= 1000
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)GB" }
|
||||
$Bytes /= 1000
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)TB" }
|
||||
$Bytes /= 1000
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)PB" }
|
||||
$Bytes /= 1000
|
||||
if ($Bytes -lt 1000) { return "$($Bytes)EB" }
|
||||
}
|
||||
|
||||
try {
|
||||
[int]$Total = [int]$Used = [int]$Free = 0
|
||||
if ($IsLinux) {
|
||||
$Result = $(free --mega | grep Swap:)
|
||||
[int]$Total = $Result.subString(5,14)
|
||||
[int]$Used = $Result.substring(20,13)
|
||||
[int]$Free = $Result.substring(32,11)
|
||||
} else {
|
||||
$Items = Get-WmiObject -class "Win32_PageFileUsage" -namespace "root\CIMV2" -computername localhost
|
||||
foreach ($Item in $Items) {
|
||||
$Total = $Item.AllocatedBaseSize
|
||||
$Used = $Item.CurrentUsage
|
||||
$Free = ($Total - $Used)
|
||||
}
|
||||
}
|
||||
if ($Total -eq 0) {
|
||||
"⚠️ No swap space configured!"
|
||||
} elseif ($Free -lt $MinLevel) {
|
||||
"⚠️ Only $(MB2String $Free) of $(MB2String $Total) swap space left to use!"
|
||||
} elseif ($Used -eq 0) {
|
||||
"✅ Swap space with $(MB2String $Total) reserved"
|
||||
} elseif ($Used -lt $Free) {
|
||||
"✅ Swap space uses $(MB2String $Used) of $(MB2String $Total)"
|
||||
} else {
|
||||
"✅ Swap space has $(MB2String $Free) of $(MB2String $Total) left to use"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-swap-space.ps1*
|
@ -1,54 +0,0 @@
|
||||
## The *check-time-zone.ps1* Script
|
||||
|
||||
This PowerShell script determines and prints the current time zone.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
check-time-zone.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-time-zone
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the time zone setting
|
||||
.DESCRIPTION
|
||||
This PowerShell script determines and prints the current time zone.
|
||||
.EXAMPLE
|
||||
PS> ./check-time-zone
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
[system.threading.thread]::currentThread.currentCulture = [system.globalization.cultureInfo]"en-US"
|
||||
$Time = $((Get-Date).ToShortTimeString())
|
||||
$TZ = (Get-Timezone)
|
||||
if ($TZ.SupportsDaylightSavingTime) { $DST=" & +01:00:00 DST" } else { $DST="" }
|
||||
"✅ $Time in $($TZ.Id) (UTC+$($TZ.BaseUtcOffset)$DST)."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-time-zone.ps1*
|
@ -1,76 +0,0 @@
|
||||
## The *check-uptime.ps1* Script
|
||||
|
||||
This PowerShell script queries and prints the uptime.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
check-uptime.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-uptime
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Check uptime
|
||||
.DESCRIPTION
|
||||
This PowerShell script queries and prints the uptime.
|
||||
.EXAMPLE
|
||||
PS> ./check-uptime
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
if ($IsLinux) {
|
||||
$Uptime = (get-uptime)
|
||||
} else {
|
||||
$BootTime = Get-WinEvent -ProviderName eventlog | Where-Object {$_.Id -eq 6005} | Select-Object TimeCreated -First 1
|
||||
$Uptime = New-TimeSpan -Start $BootTime.TimeCreated.Date -End (Get-Date)
|
||||
}
|
||||
$Days = $Uptime.Days
|
||||
$Hours = $Uptime.Hours
|
||||
$Minutes = $Uptime.Minutes
|
||||
|
||||
$Reply = "Up for "
|
||||
if ($Days -eq "1") {
|
||||
$Reply += "1 day, "
|
||||
} elseif ($Days -ne "0") {
|
||||
$Reply += "$Days days, "
|
||||
}
|
||||
if ($Hours -eq "1") {
|
||||
$Reply += "1 hour, "
|
||||
} elseif ($Hours -ne "0") {
|
||||
$Reply += "$Hours hours, "
|
||||
}
|
||||
if ($Minutes -eq "1") {
|
||||
$Reply += "1 minute"
|
||||
} else {
|
||||
$Reply += "$Minutes minutes"
|
||||
}
|
||||
"✅ $Reply."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-uptime.ps1*
|
@ -1,60 +0,0 @@
|
||||
## The *check-vpn.ps1* Script
|
||||
|
||||
This PowerShell script queries and prints the status of any VPN connection.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
check-vpn.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./check-vpn
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks the VPN connection
|
||||
.DESCRIPTION
|
||||
This PowerShell script queries and prints the status of any VPN connection.
|
||||
.EXAMPLE
|
||||
PS> ./check-vpn
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
$NoVPN = $true
|
||||
if ($IsLinux) {
|
||||
# TODO
|
||||
} else {
|
||||
$Connections = (Get-VPNConnection)
|
||||
foreach($Connection in $Connections) {
|
||||
"✅ VPN '$($Connection.Name)' is $($Connection.ConnectionStatus)"
|
||||
$NoVPN = $false
|
||||
}
|
||||
}
|
||||
if ($NoVPN) { "⚠️ No VPN connection" }
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of check-vpn.ps1*
|
@ -1,88 +0,0 @@
|
||||
## The *clean-repo.ps1* Script
|
||||
|
||||
This PowerShell script deletes all untracked files and folders in a Git repository (including submodules).
|
||||
NOTE: To be used with care! This cannot be undone!
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
clean-repo.ps1 [[-RepoDir] <String>] [<CommonParameters>]
|
||||
|
||||
-RepoDir <String>
|
||||
Specifies the path to the Git repository
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value "$PWD"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./clean-repo C:\MyRepo
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Clean a repository
|
||||
.DESCRIPTION
|
||||
This PowerShell script deletes all untracked files and folders in a Git repository (including submodules).
|
||||
NOTE: To be used with care! This cannot be undone!
|
||||
.PARAMETER RepoDir
|
||||
Specifies the path to the Git repository
|
||||
.EXAMPLE
|
||||
PS> ./clean-repo C:\MyRepo
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$RepoDir = "$PWD")
|
||||
|
||||
try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
Write-Host "⏳ (1/4) Searching for Git executable... " -noNewline
|
||||
& git --version
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
$RepoDirName = (Get-Item "$RepoDir").Name
|
||||
"⏳ (2/4) Checking Git repository 📂$RepoDirName..."
|
||||
if (-not(Test-Path "$RepoDir" -pathType container)) { throw "Can't access folder '$RepoDir' - maybe a typo or missing folder permissions?" }
|
||||
|
||||
"⏳ (3/4) Removing untracked files in repository..."
|
||||
& git -C "$RepoDir" clean -xfd -f # to delete all untracked files in the main repo
|
||||
if ($lastExitCode -ne "0") {
|
||||
"'git clean' failed with exit code $lastExitCode, retrying once..."
|
||||
& git -C "$RepoDir" clean -xfd -f
|
||||
if ($lastExitCode -ne "0") { throw "'git clean' failed with exit code $lastExitCode" }
|
||||
}
|
||||
|
||||
"⏳ (4/4) Removing untracked files in submodules..."
|
||||
& git -C "$RepoDir" submodule foreach --recursive git clean -xfd -f # to delete all untracked files in the submodules
|
||||
if ($lastExitCode -ne "0") { throw "'git clean' in the submodules failed with exit code $lastExitCode" }
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ cleaned Git repository 📂$RepoDirName in $Elapsed sec"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of clean-repo.ps1*
|
@ -1,89 +0,0 @@
|
||||
## The *clean-repos.ps1* Script
|
||||
|
||||
This PowerShell script cleans all Git repositories in a folder from untracked files (including submodules).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
clean-repos.ps1 [[-ParentDir] <String>] [<CommonParameters>]
|
||||
|
||||
-ParentDir <String>
|
||||
Specifies the path to the parent folder
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value "$PWD"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./clean-repos C:\MyRepos
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Cleans all Git repositories in a folder from untracked files
|
||||
.DESCRIPTION
|
||||
This PowerShell script cleans all Git repositories in a folder from untracked files (including submodules).
|
||||
.PARAMETER ParentDir
|
||||
Specifies the path to the parent folder
|
||||
.EXAMPLE
|
||||
PS> ./clean-repos C:\MyRepos
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$ParentDir = "$PWD")
|
||||
|
||||
try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
Write-Host "⏳ (1) Searching for Git executable... " -noNewline
|
||||
& git --version
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
$ParentDirName = (Get-Item "$ParentDir").Name
|
||||
Write-Host "⏳ (2) Checking parent folder 📂$ParentDirName... " -noNewline
|
||||
if (-not(Test-Path "$ParentDir" -pathType container)) { throw "Can't access folder: $ParentDir" }
|
||||
$Folders = (Get-ChildItem "$ParentDir" -attributes Directory)
|
||||
$NumFolders = $Folders.Count
|
||||
Write-Host "$NumFolders subfolders found"
|
||||
|
||||
[int]$Step = 2
|
||||
foreach ($Folder in $Folders) {
|
||||
$FolderName = (Get-Item "$Folder").Name
|
||||
$Step++
|
||||
"⏳ ($Step/$($NumFolders + 2)) Cleaning 📂$FolderName..."
|
||||
|
||||
& git -C "$Folder" clean -xfd -f # force + recurse into dirs + don't use the standard ignore rules
|
||||
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' failed with exit code $lastExitCode" }
|
||||
|
||||
& git -C "$Folder" submodule foreach --recursive git clean -xfd -f
|
||||
if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed with exit code $lastExitCode" }
|
||||
}
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ cleaned $NumFolders Git repositories at 📂$ParentDirName in $Elapsed sec."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of clean-repos.ps1*
|
@ -1,110 +0,0 @@
|
||||
## The *clone-repos.ps1* Script
|
||||
|
||||
This PowerShell script clones well-known Git repositories into a folder.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
clone-repos.ps1 [[-FolderPath] <String>] [<CommonParameters>]
|
||||
|
||||
-FolderPath <String>
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value "$PWD"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./clone-repos C:\Repos
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Clones Git repositories
|
||||
.DESCRIPTION
|
||||
This PowerShell script clones well-known Git repositories into a folder.
|
||||
.PARAMETER folder
|
||||
Specifies the target folder (default is current working directory)
|
||||
.EXAMPLE
|
||||
PS> ./clone-repos C:\Repos
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$FolderPath = "$PWD")
|
||||
|
||||
try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
Write-Host "⏳ (1) Searching for Git executable... " -noNewline
|
||||
& git --version
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
Write-Host "⏳ (2) Loading database table from Data/git-repos.csv... " -noNewline
|
||||
$Table = Import-CSV "$PSScriptRoot/../Data/git-repos.csv"
|
||||
$NumEntries = $Table.count
|
||||
Write-Host "$NumEntries entries found"
|
||||
|
||||
$ParentFolderName = (Get-Item "$FolderPath").Name
|
||||
"⏳ (3) Checking target folder 📂$ParentFolderName..."
|
||||
if (-not(Test-Path "$FolderPath" -pathType container)) { throw "Can't access directory: $FolderPath" }
|
||||
|
||||
|
||||
[int]$Step = 3
|
||||
[int]$Cloned = 0
|
||||
[int]$Skipped = 0
|
||||
foreach($Row in $Table) {
|
||||
[string]$Group = $Row.GROUP
|
||||
[string]$FolderName = $Row.FOLDERNAME
|
||||
[string]$Branch = $Row.BRANCH
|
||||
[string]$Full = $Row.FULL
|
||||
[string]$URL = $Row.URL
|
||||
$Step++
|
||||
|
||||
if (Test-Path "$FolderPath/$FolderName" -pathType container) {
|
||||
"⏳ ($Step/$($NumEntries + 4)) Skipping 📂$($FolderName), it exists already..."
|
||||
$Skipped++
|
||||
continue
|
||||
}
|
||||
if ($Full -eq "yes") {
|
||||
"⏳ ($Step/$($NumEntries + 4)) Cloning into 📂$($FolderName) ($Branch branch with full history)..."
|
||||
& git clone --branch "$Branch" --recurse-submodules "$URL" "$FolderPath/$FolderName"
|
||||
if ($lastExitCode -ne "0") { throw "'git clone --branch $Branch $URL' failed with exit code $lastExitCode" }
|
||||
} else {
|
||||
"⏳ ($Step/$($NumEntries + 4)) Cloning $Branch branch into 📂$FolderName..."
|
||||
& git clone --branch "$Branch" --single-branch --recurse-submodules "$URL" "$FolderPath/$FolderName"
|
||||
if ($lastExitCode -ne "0") { throw "'git clone --branch $Branch $URL' failed with exit code $lastExitCode" }
|
||||
}
|
||||
$Cloned++
|
||||
}
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
if ($Cloned -eq 1) {
|
||||
"✔️ 1 Git repository cloned into 📂$ParentFolderName in $Elapsed sec ($Skipped skipped)."
|
||||
} else {
|
||||
"✔️ $Cloned Git repos cloned into 📂$ParentFolderName in $Elapsed sec ($Skipped skipped)."
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of clone-repos.ps1*
|
@ -1,101 +0,0 @@
|
||||
## The *copy-photos-sorted.ps1* Script
|
||||
|
||||
copy-photos-sorted.ps1 [[-SourceDir] <string>] [[-TargetDir] <string>]
|
||||
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Copy photos sorted by year and month
|
||||
.DESCRIPTION
|
||||
This PowerShell script copies image files from SourceDir to TargetDir sorted by year and month.
|
||||
.PARAMETER SourceDir
|
||||
Specifies the path to the source folder
|
||||
.PARAMTER TargetDir
|
||||
Specifies the path to the target folder
|
||||
.EXAMPLE
|
||||
PS> ./copy-photos-sorted D:\MyPhone\DCIM C:\MyPhotos
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$SourceDir = "", [string]$TargetDir = "")
|
||||
|
||||
function CopyFile { param([string]$SourcePath, [string]$TargetDir, [int]$Date, [string]$Filename)
|
||||
[int]$Year = $Date / 10000
|
||||
[int]$Month = ($Date / 100) % 100
|
||||
$MonthDir = switch($Month) {
|
||||
1 {"01 JAN"}
|
||||
2 {"02 FEB"}
|
||||
3 {"03 MAR"}
|
||||
4 {"04 APR"}
|
||||
5 {"05 MAY"}
|
||||
6 {"06 JUN"}
|
||||
7 {"07 JUL"}
|
||||
8 {"08 AUG"}
|
||||
9 {"09 SEP"}
|
||||
10 {"10 OCT"}
|
||||
11 {"11 NOV"}
|
||||
12 {"12 DEC"}
|
||||
}
|
||||
$TargetPath = "$TargetDir/$Year/$MonthDir/$Filename"
|
||||
if (test-path "$TargetPath" -pathType leaf) {
|
||||
"⏳ Skipping $($Filename): already existing..."
|
||||
} else {
|
||||
"⏳ Copying $Filename to $Year/$MonthDir..."
|
||||
new-item -path "$TargetDir" -name "$Year" -itemType "directory" -force | out-null
|
||||
new-item -path "$TargetDir/$Year" -name "$MonthDir" -itemType "directory" -force | out-null
|
||||
copy-item "$SourcePath" "$TargetPath" -force
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if ($SourceDir -eq "") { $SourceDir = read-host "Enter path to source directory" }
|
||||
if ($TargetDir -eq "") { $TargetDir = read-host "Enter path to target directory" }
|
||||
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
$Files = (Get-ChildItem "$SourceDir\*.jpg" -attributes !Directory)
|
||||
"Found $($Files.Count) photos in 📂$SourceDir..."
|
||||
foreach ($File in $Files) {
|
||||
$Filename = (Get-Item "$File").Name
|
||||
if ("$Filename" -like "IMG_*_*.jpg") {
|
||||
$Array = $Filename.split("_")
|
||||
CopyFile "$File" "$TargetDir" $Array[1] "$Filename"
|
||||
} elseif ("$Filename" -like "IMG-*-*.jpg") {
|
||||
$Array = $Filename.split("-")
|
||||
CopyFile "$File" "$TargetDir" $Array[1] "$Filename"
|
||||
} elseif ("$Filename" -like "PANO_*_*.jpg") {
|
||||
$Array = $Filename.split("_")
|
||||
CopyFile "$File" "$TargetDir" $Array[1] "$Filename"
|
||||
} elseif ("$Filename" -like "PANO-*-*.jpg") {
|
||||
$Array = $Filename.split("-")
|
||||
CopyFile "$File" "$TargetDir" $Array[1] "$Filename"
|
||||
} elseif ("$Filename" -like "SAVE_*_*.jpg") {
|
||||
$Array = $Filename.split("_")
|
||||
CopyFile "$File" "$TargetDir" $Array[1] "$Filename"
|
||||
} else {
|
||||
"⏳ Skipping $($Filename): unknown filename format..."
|
||||
}
|
||||
}
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ $($Files.Count) photos copied from 📂$SourceDir to 📂$TargetDir in $Elapsed sec"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of copy-photos-sorted.ps1*
|
@ -1,82 +0,0 @@
|
||||
## The *count-lines-of-code.ps1* Script
|
||||
|
||||
This PowerShell script counts the number of code lines in a folder (including subfolders).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
count-lines-of-code.ps1 [[-Folder] <String>] [<CommonParameters>]
|
||||
|
||||
-Folder <String>
|
||||
Specifies the path to the folder
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./count-lines-of-code .
|
||||
⏳ Counting lines at 📂C:\PowerShell\Scripts ...
|
||||
✔️ 📂Scripts contains 15287 lines of code in 485 files (took 1 sec)
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Counts lines of code
|
||||
.DESCRIPTION
|
||||
This PowerShell script counts the number of code lines in a folder (including subfolders).
|
||||
.PARAMETER Folder
|
||||
Specifies the path to the folder
|
||||
.EXAMPLE
|
||||
PS> ./count-lines-of-code .
|
||||
⏳ Counting lines at 📂C:\PowerShell\Scripts ...
|
||||
✔️ 📂Scripts contains 15287 lines of code in 485 files (took 1 sec)
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$Folder = "")
|
||||
|
||||
try {
|
||||
if ($Folder -eq "" ) { $Folder = read-host "Enter the path to the folder" }
|
||||
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
$Folder = Resolve-Path "$Folder"
|
||||
"⏳ Counting lines at 📂$Folder ..."
|
||||
|
||||
[int]$Files = [int]$CodeLines = 0
|
||||
Get-ChildItem -Path $Folder -Include *.c,*.h,*.cpp,*.hpp,*.java,*.ps1 -Recurse | ForEach-Object {
|
||||
$FileStats = Get-Content $_.FullName | Measure-Object -line
|
||||
$CodeLines += $FileStats.Lines
|
||||
$Files++
|
||||
}
|
||||
|
||||
$FolderName = (Get-Item "$Folder").Name
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ 📂$FolderName contains $CodeLines lines of code in $Files files (took $Elapsed sec)"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of count-lines-of-code.ps1*
|
70
Docs/edit.md
70
Docs/edit.md
@ -1,70 +0,0 @@
|
||||
## The *edit.ps1* Script
|
||||
|
||||
This PowerShell script opens a text editor to edit the given file.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
edit.ps1 [[-Filename] <String>] [<CommonParameters>]
|
||||
|
||||
-Filename <String>
|
||||
Specifies the path to the filename
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./edit C:\MyFile.txt
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Opens an editor to edit a file
|
||||
.DESCRIPTION
|
||||
This PowerShell script opens a text editor to edit the given file.
|
||||
.PARAMETER Filename
|
||||
Specifies the path to the filename
|
||||
.EXAMPLE
|
||||
PS> ./edit C:\MyFile.txt
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$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 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of edit.ps1*
|
@ -1,57 +0,0 @@
|
||||
## The *enable-god-mode.ps1* Script
|
||||
|
||||
This PowerShell script enables the god mode. It adds a new icon to the desktop.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
enable-god-mode.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./enable-god-mode
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Enables the god mode
|
||||
.DESCRIPTION
|
||||
This PowerShell script enables the god mode. It adds a new icon to the desktop.
|
||||
.EXAMPLE
|
||||
PS> ./enable-god-mode
|
||||
.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
|
||||
|
||||
"✔️ enabled god mode - see the new desktop icon"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of enable-god-mode.ps1*
|
@ -1,87 +0,0 @@
|
||||
## The *export-to-manuals.ps1* Script
|
||||
|
||||
This PowerShell script exports the comment based help of all PowerShell scripts as manuals.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
export-to-manuals.ps1 [[-FilePattern] <String>] [[-TargetDir] <String>] [<CommonParameters>]
|
||||
|
||||
-FilePattern <String>
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value "$PSScriptRoot/*.ps1"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
-TargetDir <String>
|
||||
|
||||
Required? false
|
||||
Position? 2
|
||||
Default value "$PSScriptRoot/../Docs"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./export-to-manuals.ps1
|
||||
⏳ (1/2) Reading scripts from: /home/mf/PowerShell/Scripts/*.ps1...
|
||||
⏳ (2/2) Exporting manuals to: /home/mf/PowerShell/Scripts/../Docs...
|
||||
✔️ exported 518 PowerShell scripts in 28 sec
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Exports all scripts as manuals
|
||||
.DESCRIPTION
|
||||
This PowerShell script exports the comment based help of all PowerShell scripts as manuals.
|
||||
.EXAMPLE
|
||||
PS> ./export-to-manuals.ps1
|
||||
⏳ (1/2) Reading scripts from: /home/mf/PowerShell/Scripts/*.ps1...
|
||||
⏳ (2/2) Exporting manuals to: /home/mf/PowerShell/Scripts/../Docs...
|
||||
✔️ exported 518 PowerShell scripts in 28 sec
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
#requires -version 2
|
||||
|
||||
param([string]$FilePattern = "$PSScriptRoot/*.ps1", [string]$TargetDir = "$PSScriptRoot/../Docs")
|
||||
|
||||
try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
"⏳ (1/2) Reading scripts from: $FilePattern..."
|
||||
$Scripts = Get-ChildItem "$FilePattern"
|
||||
|
||||
"⏳ (2/2) Exporting manuals to: $TargetDir..."
|
||||
foreach ($Script in $Scripts) {
|
||||
& "$PSScriptRoot/convert-ps2md.ps1" "$Script" > "$TargetDir/$($Script.BaseName).md"
|
||||
}
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ exported $($Scripts.Count) PowerShell scripts in $Elapsed sec"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of export-to-manuals.ps1*
|
@ -1,86 +0,0 @@
|
||||
## The *fetch-repo.ps1* Script
|
||||
|
||||
This PowerShell script fetches updates for a local Git repository (including submodules).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
fetch-repo.ps1 [[-RepoDir] <String>] [<CommonParameters>]
|
||||
|
||||
-RepoDir <String>
|
||||
Specifies the path to the Git repository.
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value "$PWD"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./fetch-repo
|
||||
⏳ (1/3) Searching for Git executable... git version 2.38.1.windows.1
|
||||
⏳ (2/3) Checking Git repository 📂PowerShell...
|
||||
⏳ (3/3) Fetching updates (including submodules)...
|
||||
✔️ fetched updates for Git repository 📂PowerShell in 2 sec.
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Fetches updates for a Git repo
|
||||
.DESCRIPTION
|
||||
This PowerShell script fetches updates for a local Git repository (including submodules).
|
||||
.PARAMETER RepoDir
|
||||
Specifies the path to the Git repository.
|
||||
.EXAMPLE
|
||||
PS> ./fetch-repo
|
||||
⏳ (1/3) Searching for Git executable... git version 2.38.1.windows.1
|
||||
⏳ (2/3) Checking Git repository 📂PowerShell...
|
||||
⏳ (3/3) Fetching updates (including submodules)...
|
||||
✔️ fetched updates for Git repository 📂PowerShell in 2 sec.
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$RepoDir = "$PWD")
|
||||
|
||||
try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
Write-Host "⏳ (1/3) Searching for Git executable... " -noNewline
|
||||
& git --version
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
$RepoDirName = (Get-Item "$RepoDir").Name
|
||||
"⏳ (2/3) Checking Git repository 📂$RepoDirName... "
|
||||
if (!(Test-Path "$RepoDir" -pathType container)) { throw "Can't access folder: $RepoDir" }
|
||||
|
||||
"⏳ (3/3) Fetching updates (including submodules)... "
|
||||
& git -C "$RepoDir" fetch --all --recurse-submodules --prune --prune-tags --force
|
||||
if ($lastExitCode -ne "0") { throw "'git fetch' failed with exit code $lastExitCode" }
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ fetched updates for Git repository 📂$RepoDirName in $Elapsed sec."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of fetch-repo.ps1*
|
@ -1,86 +0,0 @@
|
||||
## The *fetch-repos.ps1* Script
|
||||
|
||||
This PowerShell script fetches updates for all Git repositories in a folder (including submodules).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
fetch-repos.ps1 [[-ParentDir] <String>] [<CommonParameters>]
|
||||
|
||||
-ParentDir <String>
|
||||
Specifies the path to the parent folder
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value "$PWD"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./fetch-repos C:\MyRepos
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Fetches updates for Git repos
|
||||
.DESCRIPTION
|
||||
This PowerShell script fetches updates for all Git repositories in a folder (including submodules).
|
||||
.PARAMETER ParentDir
|
||||
Specifies the path to the parent folder
|
||||
.EXAMPLE
|
||||
PS> ./fetch-repos C:\MyRepos
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$ParentDir = "$PWD")
|
||||
|
||||
try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
Write-Host "⏳ (1) Searching for Git executable... " -noNewline
|
||||
& git --version
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
$ParentDirName = (Get-Item "$ParentDir").Name
|
||||
Write-Host "⏳ (2) Checking parent folder 📂$ParentDirName... " -noNewline
|
||||
if (-not(Test-Path "$ParentDir" -pathType container)) { throw "Can't access folder: $ParentDir" }
|
||||
$Folders = (Get-ChildItem "$ParentDir" -attributes Directory)
|
||||
$NumFolders = $Folders.Count
|
||||
Write-Host "$NumFolders subfolders found"
|
||||
|
||||
[int]$Step = 2
|
||||
foreach ($Folder in $Folders) {
|
||||
$FolderName = (Get-Item "$Folder").Name
|
||||
$Step++
|
||||
Write-Host "⏳ ($Step/$($NumFolders + 2)) Fetching into 📂$FolderName... "
|
||||
|
||||
& git -C "$Folder" fetch --all --recurse-submodules --prune --prune-tags --force
|
||||
if ($lastExitCode -ne "0") { throw "'git fetch' in $Folder failed with exit code $lastExitCode" }
|
||||
}
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ fetched $NumFolders Git repositories in $Elapsed sec."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of fetch-repos.ps1*
|
@ -1,46 +0,0 @@
|
||||
## The *get-md5.ps1* Script
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Prints the MD5 checksum of a file
|
||||
.DESCRIPTION
|
||||
This PowerShell script calculates and prints the MD5 checksum of the given file.
|
||||
.PARAMETER file
|
||||
Specifies the path to the file
|
||||
.EXAMPLE
|
||||
PS> ./get-md5 C:\MyFile.txt
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$file = "")
|
||||
|
||||
try {
|
||||
if ($file -eq "" ) { $file = read-host "Enter path to file" }
|
||||
|
||||
$Result = get-filehash $file -algorithm MD5
|
||||
|
||||
"✔️ MD5 hash is" $Result.Hash
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of get-md5.ps1*
|
@ -1,46 +0,0 @@
|
||||
## The *get-sha1.ps1* Script
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Prints the SHA1 checksum of a file
|
||||
.DESCRIPTION
|
||||
This PowerShell script calculates and prints the SHA1 checksum of the given file.
|
||||
.PARAMETER file
|
||||
Specifies the path to the file
|
||||
.EXAMPLE
|
||||
PS> ./get-sha1 C:\MyFile.txt
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$file = "")
|
||||
|
||||
try {
|
||||
if ($file -eq "" ) { $file = read-host "Enter the filename" }
|
||||
|
||||
$Result = get-filehash $file -algorithm SHA1
|
||||
|
||||
"✔️ SHA1 hash is" $Result.Hash
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of get-sha1.ps1*
|
@ -1,46 +0,0 @@
|
||||
## The *get-sha256.ps1* Script
|
||||
|
||||
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Prints the SHA256 checksum of a file
|
||||
.DESCRIPTION
|
||||
This PowerShell script calculates and prints the SHA256 checksum of the given file.
|
||||
.PARAMETER file
|
||||
Specifies the path to the file
|
||||
.EXAMPLE
|
||||
PS> ./get-sha256 C:\MyFile.txt
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$file = "")
|
||||
|
||||
try {
|
||||
if ($file -eq "" ) { $file = read-host "Enter the filename" }
|
||||
|
||||
$Result = get-filehash $file -algorithm SHA256
|
||||
|
||||
"✔️ SHA256 hash is:" $Result.Hash
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of get-sha256.ps1*
|
@ -1,26 +0,0 @@
|
||||
## good-bye.ps1 - Replies to 'good bye'
|
||||
|
||||
This script says a reply to 'good bye' by text-to-speech (TTS).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
good-bye.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./good-bye
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of good-bye.ps1*
|
@ -1,26 +0,0 @@
|
||||
## good-evening.ps1 - Replies to 'good evening'
|
||||
|
||||
This script says a reply to 'good evening' by text-to-speech (TTS).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
good-evening.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./good-evening
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of good-evening.ps1*
|
@ -1,26 +0,0 @@
|
||||
## good-morning.ps1 - Answers to 'good morning'
|
||||
|
||||
This script says a reply to "good morning" by text-to-speech (TTS).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
good-morning.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./good-morning
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of good-morning.ps1*
|
@ -1,26 +0,0 @@
|
||||
## good-night.ps1 - Replies to 'good night'
|
||||
|
||||
This script says a reply to 'good night' by text-to-speech (TTS).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
good-night.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./good-night
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of good-night.ps1*
|
26
Docs/hi.md
26
Docs/hi.md
@ -1,26 +0,0 @@
|
||||
## hi.ps1 - Replies to "Hi"
|
||||
|
||||
This script replies to 'Hi' by text-to-speech (TTS).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
hi.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./hi
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of hi.ps1*
|
@ -1,51 +0,0 @@
|
||||
## The *hibernate.ps1* Script
|
||||
|
||||
This PowerShell script enables hibernate mode for the local computer immediately.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
hibernate.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./hibernate
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Hibernates the computer
|
||||
.DESCRIPTION
|
||||
This PowerShell script enables hibernate mode for the local computer immediately.
|
||||
.EXAMPLE
|
||||
PS> ./hibernate
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
"Bye bye."
|
||||
& rundll32.exe powrprof.dll,SetSuspendState 1,1,0 # bHibernate,bForce,bWakeupEventsDisabled
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of hibernate.ps1*
|
@ -1,26 +0,0 @@
|
||||
## how-are-you.ps1 - Answers to 'how are you?'
|
||||
|
||||
This script says a reply to "how are you?" by text-to-speech (TTS).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
how-are-you.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./how-are-you
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of how-are-you.ps1*
|
@ -1,26 +0,0 @@
|
||||
## i-will-be-back.ps1 - Replies to 'I'll be back'
|
||||
|
||||
This script replies to "I'll be back" by text-to-speech (TTS).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
i-will-be-back.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./i-will-be-back
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz · License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of i-will-be-back.ps1*
|
@ -1,78 +0,0 @@
|
||||
## The *install-basic-apps.ps1* Script
|
||||
|
||||
This PowerShell script installs basic Windows apps (browser, e-mail client, etc).
|
||||
Apps from the Microsoft Store are preferred for automatic updates.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
install-basic-apps.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./install-basic-apps
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Installs basic apps
|
||||
.DESCRIPTION
|
||||
This PowerShell script installs basic Windows apps (browser, e-mail client, etc).
|
||||
Apps from the Microsoft Store are preferred for automatic updates.
|
||||
.EXAMPLE
|
||||
PS> ./install-basic-apps
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
"⏳ Step 1 - Loading table from Data/basic-apps.csv..."
|
||||
$Table = Import-CSV "$PSScriptRoot/../Data/basic-apps.csv"
|
||||
$NumEntries = $Table.count
|
||||
Write-Host " About to install $NumEntries apps: " -NoNewline
|
||||
foreach($Row in $Table) {
|
||||
[string]$AppName = $Row.AppName
|
||||
Write-Host "$AppName, " -NoNewline
|
||||
}
|
||||
""
|
||||
"Press <Control> <C> to abort, otherwise the installation will start..."
|
||||
sleep -s 3
|
||||
|
||||
[int]$Step = 2
|
||||
foreach($Row in $Table) {
|
||||
[string]$AppName = $Row.AppName
|
||||
[string]$Category = $Row.Category
|
||||
[string]$AppID = $Row.AppID
|
||||
|
||||
"⏳ Step $Step/$($NumEntries + 1) - Installing $AppName ($Category)..."
|
||||
& winget install --id $AppID --accept-package-agreements --accept-source-agreements
|
||||
if ($lastExitCode -ne "0") { throw "'winget install' for $AppName failed" }
|
||||
$Step++
|
||||
}
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ installed $NumEntries apps in $Elapsed sec"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of install-basic-apps.ps1*
|
@ -1,62 +0,0 @@
|
||||
## The *install-github-cli.ps1* Script
|
||||
|
||||
This PowerShell script installs GitHub command-line interface (CLI).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
install-github-cli.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./install-github-cli
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Installs GitHub CLI
|
||||
.DESCRIPTION
|
||||
This PowerShell script installs GitHub command-line interface (CLI).
|
||||
.EXAMPLE
|
||||
PS> ./install-github-cli
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
if ($IsMacOS) {
|
||||
brew install gh
|
||||
} elseif ($IsLinux) {
|
||||
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
|
||||
sudo apt update
|
||||
sudo apt install gh
|
||||
}
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✔️ installed GitHub CLI in $Elapsed sec"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of install-github-cli.ps1*
|
@ -1,72 +0,0 @@
|
||||
## The *install-updates.ps1* Script
|
||||
|
||||
This PowerShell script installs updates for the local machine (needs admin rights).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
install-updates.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./install-updates
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Installs software updates
|
||||
.DESCRIPTION
|
||||
This PowerShell script installs updates for the local machine (needs admin rights).
|
||||
.EXAMPLE
|
||||
PS> ./install-updates
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
if ($IsLinux) {
|
||||
"⏳ (1/4) Querying updates for installed Debian packages..."
|
||||
& sudo apt update
|
||||
|
||||
"⏳ (2/4) Upgrading installed Debian packages..."
|
||||
& sudo apt upgrade --yes
|
||||
|
||||
"⏳ (3/4) Removing obsolete Debian packages..."
|
||||
& sudo apt autoremove --yes
|
||||
|
||||
"⏳ (4/4) Upgrading installed Snap packages..."
|
||||
& sudo snap refresh
|
||||
} else {
|
||||
"⏳ (1/2) Querying application updates..."
|
||||
& winget upgrade
|
||||
" "
|
||||
"⏳ (2/2) Upgrading applications..."
|
||||
& winget upgrade --all
|
||||
}
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
"✅ updates installed in $Elapsed sec."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of install-updates.ps1*
|
@ -1,55 +0,0 @@
|
||||
## The *install-vlc.ps1* Script
|
||||
|
||||
This PowerShell script installs the VLC media player.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
install-vlc.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./install-vlc
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Installs VLC
|
||||
.DESCRIPTION
|
||||
This PowerShell script installs the VLC media player.
|
||||
.EXAMPLE
|
||||
PS> ./install-vlc
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
"Installing VLC media player, please wait..."
|
||||
|
||||
& winget install --id VideoLAN.VLC --accept-package-agreements --accept-source-agreements
|
||||
if ($lastExitCode -ne "0") { throw "'winget install' failed" }
|
||||
|
||||
"VLC media player installed successfully."
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of install-vlc.ps1*
|
@ -1,73 +0,0 @@
|
||||
## The *introduce-powershell.ps1* Script
|
||||
|
||||
This PowerShell script introduces PowerShell to new users.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
introduce-powershell.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./introduce-powershell
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Introduces PowerShell to new users
|
||||
.DESCRIPTION
|
||||
This PowerShell script introduces PowerShell to new users.
|
||||
.EXAMPLE
|
||||
PS> ./introduce-powershell
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
Clear
|
||||
& "$PSScriptRoot/write-big.ps1" " WELCOME"
|
||||
""
|
||||
$Version = $PSVersionTable.PSVersion
|
||||
$Edition = $PSVersionTable.PSEdition
|
||||
$NumModules = (Get-Module).Count
|
||||
$NumCmdlets = (Get-Command -Command-Type cmdlet).Count
|
||||
$NumAliases = (Get-Alias).Count
|
||||
$Details = "to POWERSHELL $Version ($Edition edition) with $NumModules modules, $NumCmdlets cmdlets and $NumAliases aliases"
|
||||
& "$PSScriptRoot/write-animated.ps1" "$Details"
|
||||
""
|
||||
""
|
||||
& "$PSScriptRoot/write-typewriter.ps1" "* Want to learn PowerShell? See the tutorials at: https://www.guru99.com/powershell-tutorial.html" 25
|
||||
""
|
||||
& "$PSScriptRoot/write-typewriter.ps1" "* Need docs? See the official documentation at: https://docs.microsoft.com/en-us/powershell" 25
|
||||
""
|
||||
& "$PSScriptRoot/write-typewriter.ps1" "* Want to look inside? See the PowerShell Github repository at: https://github.com/PowerShell/PowerShell" 25
|
||||
""
|
||||
& "$PSScriptRoot/write-typewriter.ps1" "* Want examples? See the huge collection of PowerShell scripts at: https://github.com/fleschutz/PowerShell" 25
|
||||
""
|
||||
|
||||
& "$PSScriptRoot/write-typewriter.ps1" "NOTE: use <Ctrl> + <Click> to follow the links above and HAVE FUN!" 20
|
||||
""
|
||||
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of introduce-powershell.ps1*
|
@ -1,50 +0,0 @@
|
||||
## The *list-bluetooth-devices.ps1* Script
|
||||
|
||||
This PowerShell script lists all Bluetooth devices connected to the computer.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-bluetooth-devices.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-bluetooth-devices
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists Bluetooth devices
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists all Bluetooth devices connected to the computer.
|
||||
.EXAMPLE
|
||||
PS> ./list-bluetooth-devices
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
Get-PnpDevice | Where-Object {$_.Class -eq "Bluetooth"}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-bluetooth-devices.ps1*
|
@ -1,94 +0,0 @@
|
||||
## The *list-branches.ps1* Script
|
||||
|
||||
This PowerShell script lists all branches in a Git repository.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-branches.ps1 [[-RepoDir] <String>] [[-SearchPattern] <String>] [<CommonParameters>]
|
||||
|
||||
-RepoDir <String>
|
||||
Specifies the path to the Git repository (current working directory by default)
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value "$PWD"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
-SearchPattern <String>
|
||||
Specifies the search patter (anything by default)
|
||||
|
||||
Required? false
|
||||
Position? 2
|
||||
Default value *
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-branches
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists all branches in a Git repository
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists all branches in a Git repository.
|
||||
.PARAMETER RepoDir
|
||||
Specifies the path to the Git repository (current working directory by default)
|
||||
.PARAMETER SearchPattern
|
||||
Specifies the search patter (anything by default)
|
||||
.EXAMPLE
|
||||
PS> ./list-branches
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$RepoDir = "$PWD", [string]$SearchPattern = "*")
|
||||
|
||||
try {
|
||||
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
||||
|
||||
$Null = (git --version)
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
& git -C "$RepoDir" fetch
|
||||
if ($lastExitCode -ne "0") { throw "'git fetch' failed" }
|
||||
|
||||
$Branches = $(git -C "$RepoDir" branch --list --remotes --no-color --no-column)
|
||||
if ($lastExitCode -ne "0") { throw "'git branch --list' failed" }
|
||||
|
||||
""
|
||||
"List of Git Branches"
|
||||
"--------------------"
|
||||
foreach($Branch in $Branches) {
|
||||
if ("$Branch" -match "origin/HEAD") { continue }
|
||||
$BranchName = $Branch.substring(9)
|
||||
if ("$BranchName" -notlike "$SearchPattern") { continue }
|
||||
"$BranchName"
|
||||
}
|
||||
""
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-branches.ps1*
|
@ -1,60 +0,0 @@
|
||||
## The *list-city-weather.ps1* Script
|
||||
|
||||
This PowerShell script lists the current weather of cities world-wide (west to east).
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-city-weather.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-city-weather
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists current weather of cities world-wide
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists the current weather of cities world-wide (west to east).
|
||||
.EXAMPLE
|
||||
PS> ./list-city-weather
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
$Cities="Hawaii","Los Angeles","Mexico City","Dallas","Miami","New York","Rio de Janeiro","Paris","London","Berlin","Cape Town","Dubai","Mumbai","Singapore","Hong Kong","Perth","Peking","Tokyo","Sydney"
|
||||
|
||||
function ListCityWeather {
|
||||
foreach($City in $Cities) {
|
||||
$Conditions = (Invoke-WebRequest http://wttr.in/${City}?format="%c +%t`t+%p`t+%h`t+%P +%w" -UserAgent "curl" -useBasicParsing).Content
|
||||
$Sun = (Invoke-WebRequest http://wttr.in/${City}?format="+%S →+%s" -UserAgent "curl" -useBasicParsing).Content
|
||||
New-Object PSObject -Property @{ City="$City"; Conditions="$Conditions"; Sun="$Sun" }
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
ListCityWeather | Format-Table -property City,Conditions,Sun
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-city-weather.ps1*
|
@ -1,303 +0,0 @@
|
||||
## The *list-cli-tools.ps1* Script
|
||||
|
||||
list-cli-tools.ps1
|
||||
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists installed command-line tools
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists all installed command-line tools (name/version/path/file size, sorted by name).
|
||||
.EXAMPLE
|
||||
PS> ./list-cli-tools
|
||||
|
||||
Name Version Path FileSize
|
||||
---- ------- ---- --------
|
||||
at 10.0.19041.1 C:\WINDOWS\system32\at.exe 31232
|
||||
...
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
function TryCmd { param([string]$Cmd, [string]$VersionArg)
|
||||
try {
|
||||
$Info = Get-Command $Cmd -ErrorAction Stop
|
||||
$Path = $Info.Source
|
||||
if ("$($Info.Version)" -eq "0.0.0.0") {
|
||||
if ("$VersionArg" -ne "") {
|
||||
$Result = Invoke-Expression "$Path $VersionArg"
|
||||
if ("$Result" -match '\d+.\d+\.\d+') {
|
||||
$Version = "$($Matches[0])"
|
||||
} elseif ("$Result" -match '\d+\.\d+') {
|
||||
$Version = "$($Matches[0])"
|
||||
} else {
|
||||
$Version = ""
|
||||
}
|
||||
} else {
|
||||
$Version = ""
|
||||
}
|
||||
} else {
|
||||
$Version = $Info.Version
|
||||
}
|
||||
if (Test-Path "$Path" -pathType leaf) {
|
||||
$FileSize = (Get-Item "$Path").Length
|
||||
} else {
|
||||
$FileSize = "0"
|
||||
}
|
||||
New-Object PSObject -Property @{ Name=$Cmd; Version=$Version; Path=$Path; FileSize=$FileSize }
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
function ListCmdTools {
|
||||
TryCmd 7z "-version"
|
||||
TryCmd ant "-v"
|
||||
TryCmd apt "--version"
|
||||
TryCmd apt-get "--version"
|
||||
TryCmd amixer "--version"
|
||||
TryCmd aplay "--version"
|
||||
TryCmd ar "--version"
|
||||
TryCmd arch "--version"
|
||||
TryCmd arecord "--version"
|
||||
TryCmd arp ""
|
||||
TryCmd at ""
|
||||
TryCmd attrib ""
|
||||
TryCmd awk "--version"
|
||||
TryCmd b2sum "--version"
|
||||
TryCmd base32 "--version"
|
||||
TryCmd base64 "--version"
|
||||
TryCmd basename "--version"
|
||||
TryCmd basenc "--version"
|
||||
TryCmd bash "--version"
|
||||
TryCmd bc "--version"
|
||||
TryCmd bunzip2 "--version"
|
||||
TryCmd bzcat "--version"
|
||||
TryCmd bzip2 "--version"
|
||||
TryCmd bzip2recover "--version"
|
||||
TryCmd captoinfo "-V"
|
||||
TryCmd cat "-version"
|
||||
TryCmd cc "--version"
|
||||
TryCmd chattr "--version"
|
||||
TryCmd chcon "--version"
|
||||
TryCmd chdsk ""
|
||||
TryCmd chgrp "--version"
|
||||
TryCmd chmod "--version"
|
||||
TryCmd chkntfs ""
|
||||
TryCmd chown "--version"
|
||||
TryCmd chroot "--version"
|
||||
TryCmd choco "--version"
|
||||
TryCmd cipher ""
|
||||
TryCmd cksum "--version"
|
||||
TryCmd clang "--version"
|
||||
TryCmd clear "-V"
|
||||
TryCmd cmake "--version"
|
||||
TryCmd cmd ""
|
||||
TryCmd cmp "--version"
|
||||
TryCmd column "--version"
|
||||
TryCmd comp ""
|
||||
TryCmd compact ""
|
||||
TryCmd cp "--version"
|
||||
TryCmd cpack "--version"
|
||||
TryCmd csplit "--version"
|
||||
TryCmd ctest "--version"
|
||||
TryCmd curl "--version"
|
||||
TryCmd cut "--version"
|
||||
TryCmd cygcheck "--version"
|
||||
TryCmd cygpath "--version"
|
||||
TryCmd d2u "--version"
|
||||
TryCmd dash "--version"
|
||||
TryCmd date ""
|
||||
TryCmd dd "--version"
|
||||
TryCmd df "--version"
|
||||
TryCmd diff "--version"
|
||||
TryCmd diff3 "--version"
|
||||
TryCmd dir "--version"
|
||||
TryCmd dircolors "--version"
|
||||
TryCmd dirname "--version"
|
||||
TryCmd dism ""
|
||||
TryCmd dos2unix "--version"
|
||||
TryCmd driverquery ""
|
||||
TryCmd du "--version"
|
||||
TryCmd echo "--version"
|
||||
TryCmd egrep "--version"
|
||||
TryCmd env "--version"
|
||||
TryCmd ex "--version"
|
||||
TryCmd expand "--version"
|
||||
TryCmd expr "--version"
|
||||
TryCmd factor "--version"
|
||||
TryCmd false "--version"
|
||||
TryCmd fido2-assert "--version"
|
||||
TryCmd fido2-cred "--version"
|
||||
TryCmd fido2-token "--version"
|
||||
TryCmd file "--version"
|
||||
TryCmd find "--version"
|
||||
TryCmd fgrep "--version"
|
||||
TryCmd fmt "--version"
|
||||
TryCmd fold "--version"
|
||||
TryCmd ftp "-?"
|
||||
TryCmd funzip "--version"
|
||||
TryCmd gawk "--version"
|
||||
TryCmd gencat "--version"
|
||||
TryCmd getconf "--version"
|
||||
TryCmd getopt "--version"
|
||||
TryCmd gettext "--version"
|
||||
TryCmd gcc "--version"
|
||||
TryCmd gdb "--version"
|
||||
TryCmd gh "--version"
|
||||
TryCmd git "--version"
|
||||
TryCmd gkill "--version"
|
||||
TryCmd gmondump "--version"
|
||||
TryCmd gpg "--version"
|
||||
TryCmd gpg-agent "--version"
|
||||
TryCmd gpgconf "--version"
|
||||
TryCmd gpg-error "--version"
|
||||
TryCmd gpgsplit "--version"
|
||||
TryCmd gpgtar "--version"
|
||||
TryCmd grep "--version"
|
||||
TryCmd groups "--version"
|
||||
TryCmd gzip "--version"
|
||||
TryCmd head "--version"
|
||||
TryCmd hcsdiag ""
|
||||
TryCmd help "--version"
|
||||
TryCmd hmac256 "--version"
|
||||
TryCmd hostid "--version"
|
||||
TryCmd hostname ""
|
||||
TryCmd htop "--version"
|
||||
TryCmd iconv "--version"
|
||||
TryCmd id "--version"
|
||||
TryCmd ipfs "--version"
|
||||
TryCmd java "--version"
|
||||
TryCmd join "--version"
|
||||
TryCmd kill "--version"
|
||||
TryCmd ldd "--version"
|
||||
TryCmd less "--version"
|
||||
TryCmd link "--version"
|
||||
TryCmd ln "--version"
|
||||
TryCmd locale "--version"
|
||||
TryCmd locate "--version"
|
||||
TryCmd logname "--version"
|
||||
TryCmd ls "--version"
|
||||
TryCmd lsattr "-V"
|
||||
TryCmd lsb_release ""
|
||||
TryCmd lzma "--version"
|
||||
TryCmd mac2unix "--version"
|
||||
TryCmd make "--version"
|
||||
TryCmd md5sum "--version"
|
||||
TryCmd minidumper "--version"
|
||||
TryCmd mkdir "--version"
|
||||
TryCmd mkfifo "--version"
|
||||
TryCmd mkgroup "--version"
|
||||
TryCmd mknod "--version"
|
||||
TryCmd mkpasswd "--version"
|
||||
TryCmd mktemp "--version"
|
||||
TryCmd mount "--version"
|
||||
TryCmd MpCmdRun "-h"
|
||||
TryCmd netsh ""
|
||||
TryCmd netstat ""
|
||||
TryCmd nice "--version"
|
||||
TryCmd nohup "--version"
|
||||
TryCmd nroff "--version"
|
||||
TryCmd nslookup ""
|
||||
TryCmd openssl ""
|
||||
TryCmd passwd "--status"
|
||||
TryCmd paste "--version"
|
||||
TryCmd perl "--version"
|
||||
TryCmd ping "-V"
|
||||
TryCmd ping6 "-V"
|
||||
TryCmd pip "--version"
|
||||
TryCmd pip3 "--version"
|
||||
TryCmd pip3.8 "--version"
|
||||
TryCmd powercfg "/?"
|
||||
TryCmd powershell "--version"
|
||||
TryCmd print ""
|
||||
TryCmd printf "--version"
|
||||
TryCmd python "--version"
|
||||
TryCmd python3 "--version"
|
||||
TryCmd python3.8 "--version"
|
||||
TryCmd rasdial "--version"
|
||||
TryCmd regedit "--version"
|
||||
TryCmd replace "--version"
|
||||
TryCmd robocopy "--version"
|
||||
TryCmd route ""
|
||||
TryCmd rsh ""
|
||||
TryCmd rsync "--version"
|
||||
TryCmd rundll32 "--version"
|
||||
TryCmd scp ""
|
||||
TryCmd sftp ""
|
||||
TryCmd sh "--version"
|
||||
TryCmd sha1sum "--version"
|
||||
TryCmd sha256sum "--version"
|
||||
TryCmd sha512sum "--version"
|
||||
TryCmd ssh "-V"
|
||||
TryCmd ssh-keygen ""
|
||||
TryCmd sort "--version"
|
||||
TryCmd split "--version"
|
||||
TryCmd strace "--version"
|
||||
TryCmd strings "--version"
|
||||
TryCmd strip "--version"
|
||||
TryCmd sudo "--version"
|
||||
TryCmd systeminfo ""
|
||||
TryCmd tail "--version"
|
||||
TryCmd tar "--version"
|
||||
TryCmd taskkill ""
|
||||
TryCmd tasklist ""
|
||||
TryCmd tee "--version"
|
||||
TryCmd time ""
|
||||
TryCmd timeout ""
|
||||
TryCmd top "-v"
|
||||
TryCmd tskill ""
|
||||
TryCmd typeperf ""
|
||||
TryCmd tzsync "--version"
|
||||
TryCmd uniq "--version"
|
||||
TryCmd vi "--version"
|
||||
TryCmd vim "--version"
|
||||
TryCmd vulkaninfo "--version"
|
||||
TryCmd w32tm "/?"
|
||||
TryCmd waitfor "--version"
|
||||
TryCmd wakeonlan ""
|
||||
TryCmd wget "--version"
|
||||
TryCmd where "--version"
|
||||
TryCmd whatis "--version"
|
||||
TryCmd which ""
|
||||
TryCmd winget "--version"
|
||||
TryCmd winsat ""
|
||||
TryCmd whoami "--version"
|
||||
TryCmd wput "--version"
|
||||
TryCmd write ""
|
||||
TryCmd wsl "--version"
|
||||
TryCmd xcopy "--version"
|
||||
TryCmd yes "--version"
|
||||
TryCmd zip "--version"
|
||||
TryCmd zipcloak "--version"
|
||||
TryCmd zipdetails ""
|
||||
TryCmd zipgrep ""
|
||||
TryCmd zipinfo ""
|
||||
TryCmd zipnote ""
|
||||
TryCmd zipsplit ""
|
||||
TryCmd zsh "--version"
|
||||
}
|
||||
|
||||
try {
|
||||
ListCmdTools | Format-Table -property @{e='Name';width=12},@{e='Version';width=15},@{e='Path';width=70},@{e='FileSize';width=10}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-cli-tools.ps1*
|
@ -1,86 +0,0 @@
|
||||
## The *list-dir-tree.ps1* Script
|
||||
|
||||
This PowerShell script lists all files and folders in a directory tree.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-dir-tree.ps1 [[-DirTree] <String>] [<CommonParameters>]
|
||||
|
||||
-DirTree <String>
|
||||
Specifies the path to the directory tree
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value "$PWD"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-dir-tree C:\
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists the directory tree content
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists all files and folders in a directory tree.
|
||||
.PARAMETER DirTree
|
||||
Specifies the path to the directory tree
|
||||
.EXAMPLE
|
||||
PS> ./list-dir-tree C:\
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$DirTree = "$PWD")
|
||||
|
||||
function ListDir { param([string]$Directory, [int]$Depth)
|
||||
$Depth++
|
||||
$Items = Get-ChildItem -path $Directory
|
||||
foreach($Item in $Items) {
|
||||
$Filename = $Item.Name
|
||||
for ($i = 1; $i -lt $Depth; $i++) { Write-Host "│ " -noNewline }
|
||||
if ($Item.Mode -like "d*") {
|
||||
Write-Host "├─" -noNewline
|
||||
Write-Host -foregroundColor green "📂$Filename"
|
||||
ListDir "$Directory\$Filename" $Depth
|
||||
$global:Dirs++
|
||||
} else {
|
||||
Write-Host "├ $Filename ($($Item.Length) bytes)"
|
||||
$global:Files++
|
||||
$global:Bytes += $Item.Length
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
[int]$global:Dirs = 1
|
||||
[int]$global:Files = 0
|
||||
[int]$global:Bytes = 0
|
||||
ListDir $DirTree 0
|
||||
"($($global:Dirs) folders, $($global:Files) files, $($global:Bytes) bytes total)"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-dir-tree.ps1*
|
@ -1,63 +0,0 @@
|
||||
## The *list-earthquakes.ps1* Script
|
||||
|
||||
This PowerShell script lists major earthquakes with magnitude >= 6.0 for the last 30 days.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-earthquakes.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-earthquakes
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists major earthquakes
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists major earthquakes with magnitude >= 6.0 for the last 30 days.
|
||||
.EXAMPLE
|
||||
PS> ./list-earthquakes
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
$Format="csv" # cap, csv, geojson, kml, kmlraw, quakeml, text, xml
|
||||
$MinMagnitude=5.8
|
||||
$OrderBy="magnitude" # time, time-asc, magnitude, magnitude-asc
|
||||
|
||||
function ListEarthquakes {
|
||||
Write-Progress "Loading data from earthquake.usgs.gov..."
|
||||
$Quakes = (Invoke-WebRequest -URI "https://earthquake.usgs.gov/fdsnws/event/1/query?format=$Format&minmagnitude=$MinMagnitude&orderby=$OrderBy" -userAgent "curl" -useBasicParsing).Content | ConvertFrom-CSV
|
||||
foreach ($Quake in $Quakes) {
|
||||
[int]$Depth = $Quake.depth
|
||||
New-Object PSObject -Property @{ Mag=$Quake.mag; Depth="$Depth km"; Location=$Quake.place; Time=$Quake.time }
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
ListEarthquakes | Format-Table -property @{e='Mag';width=5},@{e='Location';width=42},@{e='Depth';width=12},Time
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-earthquakes.ps1*
|
@ -1,70 +0,0 @@
|
||||
## The *list-empty-dirs.ps1* Script
|
||||
|
||||
This PowerShell script scans and lists all empty subfolders within the given directory tree.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-empty-dirs.ps1 [[-DirTree] <String>] [<CommonParameters>]
|
||||
|
||||
-DirTree <String>
|
||||
Specifies the path to the directory tree
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value "$PWD"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-empty-dirs C:\
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists empty subfolders within a directory tree
|
||||
.DESCRIPTION
|
||||
This PowerShell script scans and lists all empty subfolders within the given directory tree.
|
||||
.PARAMETER DirTree
|
||||
Specifies the path to the directory tree
|
||||
.EXAMPLE
|
||||
PS> ./list-empty-dirs C:\
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$DirTree = "$PWD")
|
||||
|
||||
try {
|
||||
$DirTree = resolve-path "$DirTree/"
|
||||
write-progress "Listing empty directories in $DirTree..."
|
||||
[int]$Count = 0
|
||||
Get-ChildItem "$DirTree" -attributes Directory -recurse | Where {$_.GetFileSystemInfos().Count -eq 0} | ForEach-Object {
|
||||
"📂 $($_.FullName)"
|
||||
$Count++
|
||||
}
|
||||
"✔️ directory tree $DirTree has $Count empty directories"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-empty-dirs.ps1*
|
@ -1,72 +0,0 @@
|
||||
## The *list-empty-files.ps1* Script
|
||||
|
||||
This PowerShell script scans and lists all empty files within the given directory tree.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-empty-files.ps1 [[-DirTree] <String>] [<CommonParameters>]
|
||||
|
||||
-DirTree <String>
|
||||
Specifies the path to the directory tree
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-empty-files C:\
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists empty files within a directory tree
|
||||
.DESCRIPTION
|
||||
This PowerShell script scans and lists all empty files within the given directory tree.
|
||||
.PARAMETER DirTree
|
||||
Specifies the path to the directory tree
|
||||
.EXAMPLE
|
||||
PS> ./list-empty-files C:\
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$DirTree = "")
|
||||
|
||||
try {
|
||||
if ($DirTree -eq "" ) { $DirTree = read-host "Enter the path to the directory tree" }
|
||||
|
||||
[int]$Count = 0
|
||||
write-progress "Listing empty files in $DirTree ..."
|
||||
get-childItem $DirTree -attributes !Directory -recurse | where {$_.Length -eq 0} | foreach-object {
|
||||
write-output $_.FullName
|
||||
$Count++
|
||||
}
|
||||
|
||||
"✔️ found $Count empty file(s)"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-empty-files.ps1*
|
@ -1,77 +0,0 @@
|
||||
## The *list-folder.ps1* Script
|
||||
|
||||
This PowerShell script lists the directory content formatted in columns.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-folder.ps1 [[-SearchPattern] <String>] [<CommonParameters>]
|
||||
|
||||
-SearchPattern <String>
|
||||
Specifies the search pattern, "*" by default (means anything)
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value *
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-folder C:\
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists the folder content
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists the directory content formatted in columns.
|
||||
.PARAMETER SearchPattern
|
||||
Specifies the search pattern, "*" by default (means anything)
|
||||
.EXAMPLE
|
||||
PS> ./list-folder C:\
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$SearchPattern = "*")
|
||||
|
||||
function ListFolder { param([string]$SearchPattern)
|
||||
$Items = get-childItem -path "$SearchPattern"
|
||||
foreach ($Item in $Items) {
|
||||
$Name = $Item.Name
|
||||
if ($Name[0] -eq '.') { continue } # hidden file/dir
|
||||
if ($Item.Mode -like "d*") { $Icon = "📂"
|
||||
} elseif ($Name -like "*.iso") { $Icon = "📀"
|
||||
} elseif ($Name -like "*.mp3") { $Icon = "🎵"
|
||||
} elseif ($Name -like "*.epub") { $Icon = "📓"
|
||||
} else { $Icon = "📄" }
|
||||
new-object PSObject -Property @{ Name = "$Icon$Name" }
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
ListFolder $SearchPattern | format-wide -autoSize
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-folder.ps1*
|
@ -1,82 +0,0 @@
|
||||
## The *list-headlines.ps1* Script
|
||||
|
||||
This PowerShell script lists the latest RSS feed news.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-headlines.ps1 [[-RSS_URL] <String>] [[-MaxCount] <Int32>] [<CommonParameters>]
|
||||
|
||||
-RSS_URL <String>
|
||||
Specifies the URL to the RSS feed
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value https://yahoo.com/news/rss/world
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
-MaxCount <Int32>
|
||||
Specifies the number of news to list
|
||||
|
||||
Required? false
|
||||
Position? 2
|
||||
Default value 20
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-headlines
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists the latest headlines
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists the latest RSS feed news.
|
||||
.PARAMETER RSS_URL
|
||||
Specifies the URL to the RSS feed
|
||||
.PARAMETER MaxCount
|
||||
Specifies the number of news to list
|
||||
.EXAMPLE
|
||||
PS> ./list-headlines
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$RSS_URL = "https://yahoo.com/news/rss/world", [int]$MaxCount = 20)
|
||||
|
||||
try {
|
||||
[xml]$Content = (invoke-webRequest -uri $RSS_URL -useBasicParsing).Content
|
||||
"`n🌍 $($Content.rss.channel.title) 🌏"
|
||||
|
||||
[int]$Count = 0
|
||||
foreach ($item in $Content.rss.channel.item) {
|
||||
"→ $($item.title)"
|
||||
$Count++
|
||||
if ($Count -eq $MaxCount) { break }
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-headlines.ps1*
|
@ -1,71 +0,0 @@
|
||||
## The *list-hidden-files.ps1* Script
|
||||
|
||||
This PowerShell script scans and lists all hidden files in a directory tree.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-hidden-files.ps1 [[-DirTree] <String>] [<CommonParameters>]
|
||||
|
||||
-DirTree <String>
|
||||
Specifies the path to the directory tree
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value "$PWD"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-hidden-files C:\
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists hidden files in a directory tree
|
||||
.DESCRIPTION
|
||||
This PowerShell script scans and lists all hidden files in a directory tree.
|
||||
.PARAMETER DirTree
|
||||
Specifies the path to the directory tree
|
||||
.EXAMPLE
|
||||
PS> ./list-hidden-files C:\
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$DirTree = "$PWD")
|
||||
|
||||
try {
|
||||
$DirTree = resolve-path "$DirTree"
|
||||
write-progress "Listing hidden files in $DirTree ..."
|
||||
|
||||
[int]$Count = 0
|
||||
get-childItem "$DirTree" -attributes Hidden -recurse | foreach-object {
|
||||
"📄 $($_.FullName)"
|
||||
$Count++
|
||||
}
|
||||
"✔️ directory tree $DirTree has $Count hidden file(s)"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-hidden-files.ps1*
|
@ -1,76 +0,0 @@
|
||||
## The *list-latest-tag.ps1* Script
|
||||
|
||||
This PowerShell script lists the latest tag on the current branch in a Git repository.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-latest-tag.ps1 [[-RepoDir] <String>] [<CommonParameters>]
|
||||
|
||||
-RepoDir <String>
|
||||
Specifies the path to the repository
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value "$PWD"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-latest-tag C:\MyRepo
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists the latest tag on the current branch in a Git repository
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists the latest tag on the current branch in a Git repository.
|
||||
.PARAMETER RepoDir
|
||||
Specifies the path to the repository
|
||||
.EXAMPLE
|
||||
PS> ./list-latest-tag C:\MyRepo
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$RepoDir = "$PWD")
|
||||
|
||||
try {
|
||||
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
||||
|
||||
$Null = (git --version)
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
# $RepoDirName = (get-item "$RepoDir").Name
|
||||
# "🢃 Fetching updates for 📂$RepoDirName ..."
|
||||
# & git -C "$RepoDir" fetch --tags
|
||||
# if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" }
|
||||
|
||||
$LatestTagCommitID = (git -C "$RepoDir" rev-list --tags --max-count=1)
|
||||
$LatestTag = (git -C "$RepoDir" describe --tags $LatestTagCommitID)
|
||||
"🔖$LatestTag ($LatestTagCommitID)"
|
||||
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-latest-tag.ps1*
|
@ -1,62 +0,0 @@
|
||||
## The *list-modules.ps1* Script
|
||||
|
||||
This PowerShell script lists all installed PowerShell modules.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-modules.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-modules
|
||||
|
||||
|
||||
|
||||
ModuleType Version Name ExportedCommands
|
||||
---------- ------- ---- ----------------
|
||||
Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Computer, Add-Content, Checkpoint-Computer...}
|
||||
Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable...}
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists all PowerShell modules
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists all installed PowerShell modules.
|
||||
.EXAMPLE
|
||||
PS> ./list-modules
|
||||
|
||||
ModuleType Version Name ExportedCommands
|
||||
---------- ------- ---- ----------------
|
||||
Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Computer, Add-Content, Checkpoint-Computer...}
|
||||
Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable...}
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
Get-Module | Format-Table
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-modules.ps1*
|
@ -1,93 +0,0 @@
|
||||
## The *list-news.ps1* Script
|
||||
|
||||
This PowerShell script lists the latest news by using RSS (Really Simple Syndication) feeds.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-news.ps1 [[-RSS_URL] <String>] [[-MaxLines] <Int32>] [[-Speed] <Int32>] [<CommonParameters>]
|
||||
|
||||
-RSS_URL <String>
|
||||
Specifies the URL to the RSS feed (Yahoo News by default)
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value https://yahoo.com/news/rss/world
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
-MaxLines <Int32>
|
||||
Specifies the maximum number of lines to list (24 by default)
|
||||
|
||||
Required? false
|
||||
Position? 2
|
||||
Default value 24
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
-Speed <Int32>
|
||||
Specifies the speed to write the text (10 ms by default)
|
||||
|
||||
Required? false
|
||||
Position? 3
|
||||
Default value 10
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-news
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists the news
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists the latest news by using RSS (Really Simple Syndication) feeds.
|
||||
.PARAMETER RSS_URL
|
||||
Specifies the URL to the RSS feed (Yahoo News by default)
|
||||
.PARAMETER MaxLines
|
||||
Specifies the maximum number of lines to list (24 by default)
|
||||
.PARAMETER Speed
|
||||
Specifies the speed to write the text (10 ms by default)
|
||||
.EXAMPLE
|
||||
PS> ./list-news
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$RSS_URL = "https://yahoo.com/news/rss/world", [int]$MaxLines = 24, [int]$Speed = 10)
|
||||
|
||||
try {
|
||||
[xml]$Content = (Invoke-WebRequest -URI $RSS_URL -useBasicParsing).Content
|
||||
[int]$Count = 1
|
||||
foreach ($Item in $Content.rss.channel.item) {
|
||||
& "$PSScriptRoot/write-typewriter.ps1" "→ $($Item.title)" $Speed
|
||||
if ($Count++ -eq $MaxLines) { break }
|
||||
}
|
||||
$Source = $Content.rss.channel.title
|
||||
$Date = $Content.rss.channel.pubDate
|
||||
" (by *$($Source)* as of $Date)"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-news.ps1*
|
@ -1,99 +0,0 @@
|
||||
## The *list-repos.ps1* Script
|
||||
|
||||
This PowerShell script lists the details of all Git repositories in a folder.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-repos.ps1 [[-ParentDir] <String>] [<CommonParameters>]
|
||||
|
||||
-ParentDir <String>
|
||||
Specifies the path to the parent directory.
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value "$PWD"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-repos C:\MyRepos
|
||||
|
||||
|
||||
|
||||
No Repository Branch LatestTag Status
|
||||
-- ---------- ------ --------- ------
|
||||
1 cmake main v3.23.0 clean
|
||||
2 opencv main 4.5.5 modified
|
||||
...
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists Git repositories
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists the details of all Git repositories in a folder.
|
||||
.PARAMETER ParentDir
|
||||
Specifies the path to the parent directory.
|
||||
.EXAMPLE
|
||||
PS> ./list-repos C:\MyRepos
|
||||
|
||||
No Repository Branch LatestTag Status
|
||||
-- ---------- ------ --------- ------
|
||||
1 cmake main v3.23.0 clean
|
||||
2 opencv main 4.5.5 modified
|
||||
...
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$ParentDir = "$PWD")
|
||||
|
||||
function ListRepos {
|
||||
[int]$No = 1
|
||||
$Folders = (Get-ChildItem "$ParentDir" -attributes Directory)
|
||||
foreach ($Folder in $Folders) {
|
||||
$FolderName = (Get-Item "$Folder").Name
|
||||
$Branch = (git -C "$Folder" branch --show-current)
|
||||
$LatestTagCommitID = (git -C "$Folder" rev-list --tags --max-count=1)
|
||||
$LatestTag = (git -C "$Folder" describe --tags $LatestTagCommitID)
|
||||
$Status = (git -C "$Folder" status --short)
|
||||
if ("$Status" -eq "") { $Status = "clean" }
|
||||
if ("$Status" -like " M *") { $Status = "modified" }
|
||||
|
||||
New-Object PSObject -property @{ 'No'="$No"; 'Repository'="$FolderName"; 'Branch'="$Branch"; 'LatestTag'="$LatestTag"; 'Status'="$Status"; }
|
||||
$No++
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
if (-not(Test-Path "$ParentDir" -pathType container)) { throw "Can't access directory: $ParentDir" }
|
||||
|
||||
$Null = (git --version)
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
ListRepos | Format-Table -property @{e='No';width=3},@{e='Repository';width=25},@{e='Branch';width=20},LatestTag,Status
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-repos.ps1*
|
@ -1,55 +0,0 @@
|
||||
## The *list-scripts.ps1* Script
|
||||
|
||||
list-scripts.ps1
|
||||
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists all PowerShell scripts in this repository
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists all PowerShell scripts in the repository (sorted alphabetically).
|
||||
.EXAMPLE
|
||||
PS> ./list-scripts
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
function ListScripts { param([string]$FilePath)
|
||||
write-progress "Reading $FilePath..."
|
||||
$Table = import-csv "$FilePath"
|
||||
foreach($Row in $Table) {
|
||||
New-Object PSObject -Property @{
|
||||
'PowerShell Script' = "$($Row.Script)"
|
||||
'Description' = "$($Row.Description)"
|
||||
}
|
||||
}
|
||||
$global:NumScripts = $Table.Count
|
||||
write-progress -completed "Reading $FilePath..."
|
||||
}
|
||||
|
||||
try {
|
||||
$PathToRepo = "$PSScriptRoot/.."
|
||||
ListScripts "$PathToRepo/Data/scripts.csv" | format-table -property "PowerShell Script",Description
|
||||
|
||||
"✔️ $($global:NumScripts) PowerShell scripts total"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-scripts.ps1*
|
@ -1,81 +0,0 @@
|
||||
## The *list-special-folders.ps1* Script
|
||||
|
||||
list-special-folders.ps1
|
||||
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists special folders
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists the special folders (sorted alphabetically).
|
||||
.EXAMPLE
|
||||
PS> ./list-special-folders
|
||||
|
||||
Folder Name Folder Path
|
||||
----------- -----------
|
||||
AdminTools 📂C:\Users\Markus\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Administrative Tools
|
||||
...
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
function GetTempDir {
|
||||
if ("$env:TEMP" -ne "") { return "$env:TEMP" }
|
||||
if ("$env:TMP" -ne "") { return "$env:TMP" }
|
||||
if ($IsLinux) { return "/tmp" }
|
||||
return "C:\Temp"
|
||||
}
|
||||
|
||||
function AddLine { param([string]$FolderName, [string]$FolderPath)
|
||||
New-Object PSObject -property @{ 'Folder Name' = "$FolderName"; 'Folder Path' = "📂$FolderPath" }
|
||||
}
|
||||
|
||||
function ListSpecialFolders {
|
||||
if ($IsLinux) {
|
||||
AddLine "Desktop" "$HOME/Desktop"
|
||||
AddLine "Downloads" "$HOME/Downloads"
|
||||
AddLine "Home Folder" "$HOME"
|
||||
AddLine "MyDocuments" "$HOME/Documents"
|
||||
AddLine "MyMusic" "$HOME/Music"
|
||||
AddLine "MyPictures" "$HOME/Pictures"
|
||||
AddLine "MyScreenshots" "$HOME/Pictures/Screenshots"
|
||||
AddLine "MyVideos" "$HOME/Videos"
|
||||
AddLine "Temporary Folder" "$(GetTempDir)"
|
||||
$Path = Resolve-Path "$HOME/.."
|
||||
AddLine "Users" "$Path"
|
||||
} else {
|
||||
$FolderNames = [System.Enum]::GetNames('System.Environment+SpecialFolder')
|
||||
$FolderNames | Sort-Object | ForEach-Object {
|
||||
if ($Path = [System.Environment]::GetFolderPath($_)) {
|
||||
AddLine "$_" "$Path"
|
||||
}
|
||||
}
|
||||
AddLine "TemporaryFolder" "$(GetTempDir)"
|
||||
$Path = Resolve-Path "$HOME/.."
|
||||
AddLine "Users" "$Path"
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
ListSpecialFolders | Format-Table -property @{e='Folder Name';width=22},'Folder Path'
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-special-folders.ps1*
|
@ -1,103 +0,0 @@
|
||||
## The *list-tags.ps1* Script
|
||||
|
||||
This PowerShell script lists all tags in a Git repository.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-tags.ps1 [[-RepoDir] <String>] [[-SearchPattern] <String>] [<CommonParameters>]
|
||||
|
||||
-RepoDir <String>
|
||||
Specifies the path to the Git repository (current working directory by default)
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value "$PWD"
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
-SearchPattern <String>
|
||||
Specifies the search pattern (anything by default)
|
||||
|
||||
Required? false
|
||||
Position? 2
|
||||
Default value *
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-tags C:\MyRepo
|
||||
|
||||
|
||||
|
||||
Tag Description
|
||||
--- -----------
|
||||
v0.1 Update README.md
|
||||
v0.2 Fix typo
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists all tags in a Git repository
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists all tags in a Git repository.
|
||||
.PARAMETER RepoDir
|
||||
Specifies the path to the Git repository (current working directory by default)
|
||||
.PARAMETER SearchPattern
|
||||
Specifies the search pattern (anything by default)
|
||||
.EXAMPLE
|
||||
PS> ./list-tags C:\MyRepo
|
||||
|
||||
Tag Description
|
||||
--- -----------
|
||||
v0.1 Update README.md
|
||||
v0.2 Fix typo
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$RepoDir = "$PWD", [string]$SearchPattern="*")
|
||||
|
||||
try {
|
||||
Write-Progress "⏳ (1/3) Searching for Git executable... "
|
||||
$Null = (git --version)
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||
|
||||
Write-Progress "⏳ (2/3) Checking folder... "
|
||||
if (-not(Test-Path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
||||
|
||||
Write-Progress "⏳ (3/3) Fetching latest tags..."
|
||||
& git -C "$RepoDir" fetch --all --tags --quiet
|
||||
if ($lastExitCode -ne "0") { throw "'git fetch --all --tags' failed" }
|
||||
|
||||
Write-Progress -completed "Fetched"
|
||||
""
|
||||
"Tag Description"
|
||||
"--- -----------"
|
||||
& git -C "$RepoDir" tag --list "$SearchPattern" -n
|
||||
if ($lastExitCode -ne "0") { throw "'git tag --list' failed" }
|
||||
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-tags.ps1*
|
@ -1,79 +0,0 @@
|
||||
## The *list-unused-files.ps1* Script
|
||||
|
||||
This PowerShell script scans and lists files in a folder with last access time older than number of days.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-unused-files.ps1 [[-DirTree] <String>] [[-Days] <Int32>] [<CommonParameters>]
|
||||
|
||||
-DirTree <String>
|
||||
Specifies the path to the directory tree
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
-Days <Int32>
|
||||
Specifies the number of days
|
||||
|
||||
Required? false
|
||||
Position? 2
|
||||
Default value 100
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-unused-files C:\ 100
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists unused files in a directory tree
|
||||
.DESCRIPTION
|
||||
This PowerShell script scans and lists files in a folder with last access time older than number of days.
|
||||
.PARAMETER DirTree
|
||||
Specifies the path to the directory tree
|
||||
.PARAMETER Days
|
||||
Specifies the number of days
|
||||
.EXAMPLE
|
||||
PS> ./list-unused-files C:\ 100
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$DirTree = "", [int]$Days = 100)
|
||||
|
||||
write-host "Listing files in $DirTree with last access time older than $Days days"
|
||||
|
||||
try {
|
||||
$cutOffDate = (Get-Date).AddDays(-$Days)
|
||||
|
||||
Get-ChildItem -path $DirTree -recurse | Where-Object {$_.LastAccessTime -le $cutOffDate} | select fullname
|
||||
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-unused-files.ps1*
|
@ -1,64 +0,0 @@
|
||||
## The *list-user-groups.ps1* Script
|
||||
|
||||
This PowerShell script lists the user groups on the local computer.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-user-groups.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-user-groups
|
||||
|
||||
|
||||
|
||||
Name Description
|
||||
---- -----------
|
||||
HomeUsers HomeUsers Security Group
|
||||
Ssh Users Members of this group can remotely access this computer over SSH protocol.
|
||||
...
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists the user groups on the local computer
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists the user groups on the local computer.
|
||||
.EXAMPLE
|
||||
PS> ./list-user-groups
|
||||
|
||||
Name Description
|
||||
---- -----------
|
||||
HomeUsers HomeUsers Security Group
|
||||
Ssh Users Members of this group can remotely access this computer over SSH protocol.
|
||||
...
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
Get-LocalGroup
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-user-groups.ps1*
|
@ -1,139 +0,0 @@
|
||||
## The *list-weather.ps1* Script
|
||||
|
||||
This PowerShell script lists the hourly weather report in a nice table.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-weather.ps1 [[-Location] <String>] [<CommonParameters>]
|
||||
|
||||
-Location <String>
|
||||
Specifies the location to use (determined automatically per default)
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-weather
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists the weather report
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists the hourly weather report in a nice table.
|
||||
.PARAMETER Location
|
||||
Specifies the location to use (determined automatically per default)
|
||||
.EXAMPLE
|
||||
PS> ./list-weather
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$Location = "") # empty means determine automatically
|
||||
|
||||
function GetDescription { param([string]$Text)
|
||||
switch($Text) {
|
||||
"Blizzard" { return "❄️ blizzard ⚠️" }
|
||||
"Clear" { return "🌙 clear" }
|
||||
"Cloudy" { return "☁️ cloudy" }
|
||||
"Fog" { return "🌫 fog" }
|
||||
"Freezing fog" { return "🌫 freezing fog" }
|
||||
"Heavy snow" { return "❄️ heavy snow ⚠️" }
|
||||
"Light drizzle" { return "💧 light drizzle" }
|
||||
"Light rain" { return "💧 light rain" }
|
||||
"Light rain shower" { return "💧 light rain shower" }
|
||||
"Light sleet" { return "❄️ light sleet" }
|
||||
"Light snow" { return "❄️ light snow" }
|
||||
"Light snow showers" { return "❄️ light snow showers" }
|
||||
"Moderate snow" { return "❄️ moderate snow" }
|
||||
"Mist" { return "🌫 misty" }
|
||||
"Overcast" { return "☁️ overcast" }
|
||||
"Partly cloudy" { return "⛅️partly cloudy" }
|
||||
"Patchy light rain" { return "💧 patchy light rain" }
|
||||
"Patchy rain possible" { return "💧 patchy rain possible" }
|
||||
"Sunny" { return "☀️ sunny" }
|
||||
"Thundery outbreaks possible" { return "⚡️thundery outbreaks possible" }
|
||||
default { return "$Text" }
|
||||
}
|
||||
}
|
||||
|
||||
function GetWindDir { param([string]$Text)
|
||||
switch($Text) {
|
||||
"NW" { return "↘" }
|
||||
"NNW" { return "↓" }
|
||||
"N" { return "↓" }
|
||||
"NNE" { return "↓" }
|
||||
"NE" { return "↙" }
|
||||
"ENE" { return "←" }
|
||||
"E" { return "←" }
|
||||
"ESE" { return "←" }
|
||||
"SE" { return "↖" }
|
||||
"SSE" { return "↑" }
|
||||
"S" { return "↑" }
|
||||
"SSW" { return "↑" }
|
||||
"SW" { return "↗" }
|
||||
"WSW" { return "→" }
|
||||
"W" { return "→" }
|
||||
"WNW" { return "→" }
|
||||
default { return "$Text" }
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$Weather = (Invoke-WebRequest -URI http://wttr.in/${Location}?format=j1 -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json
|
||||
$Area = $Weather.nearest_area.areaName.value
|
||||
$Region = $Weather.nearest_area.region.value
|
||||
$Country = $Weather.nearest_area.country.value
|
||||
[int]$Day = 0
|
||||
foreach($Hourly in $Weather.weather.hourly) {
|
||||
$Hour = $Hourly.time / 100
|
||||
$Temp = $(($Hourly.tempC.toString()).PadLeft(3))
|
||||
$Precip = $Hourly.precipMM
|
||||
$Humidity = $(($Hourly.humidity.toString()).PadLeft(3))
|
||||
$Pressure = $Hourly.pressure
|
||||
$WindSpeed = $(($Hourly.windspeedKmph.toString()).PadLeft(2))
|
||||
$WindDir = GetWindDir $Hourly.winddir16Point
|
||||
$UV = $Hourly.uvIndex
|
||||
$Clouds = $(($Hourly.cloudcover.toString()).PadLeft(3))
|
||||
$Visib = $(($Hourly.visibility.toString()).PadLeft(2))
|
||||
$Desc = GetDescription $Hourly.weatherDesc.value
|
||||
if ($Hour -eq 0) {
|
||||
if ($Day -eq 0) {
|
||||
Write-Host -foregroundColor green "TODAY 🌡°C ☂️mm 💧 💨km/h ☀️UV ☁️ 👁km at $Area ($Region, $Country)"
|
||||
} elseif ($Day -eq 1) {
|
||||
Write-Host -foregroundColor green "TOMORROW"
|
||||
} else {
|
||||
Write-Host -foregroundColor green "Day after tomorrow"
|
||||
}
|
||||
$Day++
|
||||
}
|
||||
"$(($Hour.toString()).PadLeft(2))°° $Temp° $Precip $Humidity% $($WindDir)$WindSpeed $UV $Clouds% $Visib $Desc"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-weather.ps1*
|
@ -1,51 +0,0 @@
|
||||
## The *list-workdir.ps1* Script
|
||||
|
||||
This PowerShell script lists the current working directory (but not the content itself!)
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
list-workdir.ps1 [<CommonParameters>]
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./list-workdir
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists the current working directory
|
||||
.DESCRIPTION
|
||||
This PowerShell script lists the current working directory (but not the content itself!)
|
||||
.EXAMPLE
|
||||
PS> ./list-workdir
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
try {
|
||||
$CWD = Resolve-Path "$PWD"
|
||||
"📂$CWD"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of list-workdir.ps1*
|
@ -1,84 +0,0 @@
|
||||
## The *locate-city.ps1* Script
|
||||
|
||||
This PowerShell script prints the geographic location of the given city.
|
||||
|
||||
## Parameters
|
||||
```powershell
|
||||
locate-city.ps1 [[-City] <String>] [<CommonParameters>]
|
||||
|
||||
-City <String>
|
||||
Specifies the city to look for
|
||||
|
||||
Required? false
|
||||
Position? 1
|
||||
Default value
|
||||
Accept pipeline input? false
|
||||
Accept wildcard characters? false
|
||||
|
||||
[<CommonParameters>]
|
||||
This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction,
|
||||
WarningVariable, OutBuffer, PipelineVariable, and OutVariable.
|
||||
```
|
||||
|
||||
## Example
|
||||
```powershell
|
||||
PS> ./locate-city Paris
|
||||
|
||||
```
|
||||
|
||||
## Notes
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
|
||||
## Related Links
|
||||
https://github.com/fleschutz/PowerShell
|
||||
|
||||
## Source Code
|
||||
```powershell
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Prints the geographic location of a city
|
||||
.DESCRIPTION
|
||||
This PowerShell script prints the geographic location of the given city.
|
||||
.PARAMETER City
|
||||
Specifies the city to look for
|
||||
.EXAMPLE
|
||||
PS> ./locate-city Paris
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$City = "")
|
||||
|
||||
try {
|
||||
if ($City -eq "" ) { $City = read-host "Enter the city name" }
|
||||
|
||||
write-progress "Reading worldcities.csv..."
|
||||
$Table = import-csv "$PSScriptRoot/../Data/worldcities.csv"
|
||||
|
||||
$FoundOne = 0
|
||||
foreach($Row in $Table) {
|
||||
if ($Row.city -eq $City) {
|
||||
$FoundOne = 1
|
||||
$Country = $Row.country
|
||||
$Region = $Row.admin_name
|
||||
$Lat = $Row.lat
|
||||
$Long = $Row.lng
|
||||
$Population = $Row.population
|
||||
write-host "* $City ($Country, $Region, population $Population) is at $Lat°N, $Long°W"
|
||||
}
|
||||
}
|
||||
|
||||
if ($FoundOne) {
|
||||
exit 0 # success
|
||||
}
|
||||
write-error "City $City not found"
|
||||
exit 1
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
exit 1
|
||||
}
|
||||
```
|
||||
|
||||
*Generated by convert-ps2md.ps1 using the comment-based help of locate-city.ps1*
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user