From 439fbf5bfab1a20f8d513c30f7e95e86e11cb9f5 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Sun, 19 May 2024 10:25:56 +0200 Subject: [PATCH] Updated the Markdown manuals --- docs/add-firewall-rules.md | 2 +- docs/add-memo.md | 2 +- docs/alert.md | 2 +- docs/build-repo.md | 42 ++++---- docs/build-repos.md | 2 +- docs/cd-autostart.md | 2 +- docs/cd-crashdumps.md | 2 +- docs/cd-desktop.md | 2 +- docs/cd-docs.md | 2 +- docs/cd-downloads.md | 2 +- docs/cd-dropbox.md | 2 +- docs/cd-etc.md | 2 +- docs/cd-fonts.md | 2 +- docs/cd-home.md | 2 +- docs/cd-logs.md | 2 +- docs/cd-music.md | 2 +- docs/cd-onedrive.md | 2 +- docs/cd-pics.md | 2 +- docs/cd-public.md | 2 +- docs/cd-recycle-bin.md | 14 +-- docs/cd-repo.md | 93 +++++++++++++++++ docs/cd-repos.md | 35 +------ docs/cd-root.md | 2 +- docs/cd-screenshots.md | 2 +- docs/cd-scripts.md | 2 +- docs/cd-ssh.md | 2 +- docs/cd-temp.md | 2 +- docs/cd-templates.md | 2 +- docs/cd-trash.md | 14 +-- docs/cd-up.md | 2 +- docs/cd-up2.md | 2 +- docs/cd-up3.md | 2 +- docs/cd-up4.md | 2 +- docs/cd-users.md | 2 +- docs/cd-videos.md | 2 +- docs/cd-windows.md | 2 +- docs/change-wallpaper.md | 2 +- docs/check-admin.md | 2 +- docs/check-apps.md | 62 ++++++------ docs/check-bios.md | 2 +- docs/check-cpu.md | 2 +- docs/check-credentials.md | 2 +- docs/check-day.md | 2 +- docs/check-dns.md | 2 +- docs/check-drive-space.md | 2 +- docs/check-drives.md | 2 +- docs/check-dusk.md | 2 +- docs/check-easter-sunday.md | 2 +- docs/check-file-system.md | 2 +- docs/check-file.md | 2 +- docs/check-firewall.md | 2 +- docs/check-gpu.md | 2 +- docs/check-hardware.md | 5 +- docs/check-health.md | 2 +- docs/check-independence-day.md | 2 +- docs/check-ipv4-address.md | 2 +- docs/check-ipv6-address.md | 2 +- docs/check-iss-position.md | 2 +- docs/check-mac-address.md | 2 +- docs/check-midnight.md | 2 +- docs/check-month.md | 2 +- docs/check-moon-phase.md | 2 +- docs/check-network.md | 5 +- docs/check-noon.md | 2 +- docs/check-os.md | 2 +- docs/check-outlook.md | 2 +- docs/check-password.md | 2 +- docs/check-pending-reboot.md | 8 +- docs/check-power.md | 2 +- docs/check-powershell.md | 2 +- docs/check-ps1-file.md | 2 +- docs/check-ram.md | 2 +- docs/check-repo.md | 55 +++++----- docs/check-repos.md | 33 +++--- docs/check-santa.md | 2 +- docs/check-smart-devices.md | 103 +++++++++++-------- docs/check-software.md | 5 +- docs/check-subnet-mask.md | 2 +- docs/check-swap-space.md | 4 +- docs/check-symlinks.md | 2 +- docs/check-time-zone.md | 2 +- docs/check-uptime.md | 2 +- docs/check-vpn.md | 8 +- docs/check-weather.md | 2 +- docs/check-week.md | 2 +- docs/check-wind.md | 2 +- docs/check-windows-system-files.md | 2 +- docs/check-xml-file.md | 2 +- docs/check-xml-files.md | 2 +- docs/clean-repo.md | 8 +- docs/clean-repos.md | 2 +- docs/clear-dns-cache.md | 2 +- docs/clear-recycle-bin.md | 2 +- docs/clone-repos.md | 2 +- docs/close-calculator.md | 2 +- docs/close-chrome.md | 2 +- docs/close-cortana.md | 2 +- docs/close-edge.md | 2 +- docs/close-file-explorer.md | 2 +- docs/close-firefox.md | 2 +- docs/close-git-extensions.md | 2 +- docs/close-magnifier.md | 2 +- docs/close-microsoft-paint.md | 2 +- docs/close-microsoft-store.md | 2 +- docs/close-netflix.md | 2 +- docs/close-note-pad.md | 2 +- docs/close-obs-studio.md | 2 +- docs/close-one-calendar.md | 2 +- docs/close-outlook.md | 2 +- docs/close-paint-three-d.md | 2 +- docs/close-program.md | 2 +- docs/close-serenade.md | 2 +- docs/close-snipping-tool.md | 2 +- docs/close-spotify.md | 2 +- docs/close-task-manager.md | 2 +- docs/close-three-d-viewer.md | 2 +- docs/close-thunderbird.md | 2 +- docs/close-visual-studio.md | 2 +- docs/close-vlc.md | 2 +- docs/close-windows-terminal.md | 2 +- docs/configure-git.md | 2 +- docs/connect-vpn.md | 2 +- docs/convert-csv2txt.md | 2 +- docs/convert-docx2md.md | 2 +- docs/convert-frames2mp4.md | 2 +- docs/convert-image2ascii.md | 2 +- docs/convert-image2blurred-frames.md | 2 +- docs/convert-image2pixelated-frames.md | 2 +- docs/convert-md2docx.md | 2 +- docs/convert-md2html.md | 2 +- docs/convert-md2pdf.md | 2 +- docs/convert-mysql2csv.md | 2 +- docs/convert-ps2bat.md | 2 +- docs/convert-ps2md.md | 2 +- docs/convert-sql2csv.md | 2 +- docs/convert-txt2wav.md | 2 +- docs/copy-photos-sorted.md | 2 +- docs/count-characters.md | 74 ++++++++++++++ docs/count-lines.md | 86 ++++++++++++++++ docs/decrypt-file.md | 2 +- docs/disable-ipv6.md | 2 +- docs/disconnect-vpn.md | 2 +- docs/download-dir.md | 2 +- docs/download-file.md | 2 +- docs/edit.md | 2 +- docs/enable-crash-dumps.md | 2 +- docs/enable-god-mode.md | 2 +- docs/enable-ipv6.md | 2 +- docs/encrypt-file.md | 2 +- docs/enter-chat.md | 2 +- docs/export-to-manuals.md | 2 +- docs/fetch-repo.md | 2 +- docs/fetch-repos.md | 2 +- docs/firefox-installer.md | 2 +- docs/get-md5.md | 2 +- docs/get-sha1.md | 2 +- docs/get-sha256.md | 2 +- docs/hibernate.md | 2 +- docs/import-vm.md | 2 +- docs/inspect-exe.md | 2 +- docs/install-audacity.md | 2 +- docs/install-basic-apps.md | 2 +- docs/install-basic-snaps.md | 2 +- docs/install-calibre-server.md | 46 ++++----- docs/install-chocolatey.md | 2 +- docs/install-chrome.md | 2 +- docs/install-crystal-disk-info.md | 2 +- docs/install-crystal-disk-mark.md | 2 +- docs/install-discord.md | 2 +- docs/install-edge.md | 2 +- docs/install-evcc.md | 2 +- docs/install-firefox.md | 2 +- docs/install-git-extensions.md | 2 +- docs/install-git-for-windows.md | 2 +- docs/install-github-cli.md | 2 +- docs/install-irfanview.md | 2 +- docs/install-knot-resolver.md | 2 +- docs/install-microsoft-teams.md | 2 +- docs/install-netflix.md | 2 +- docs/install-nine-zip.md | 2 +- docs/install-obs-studio.md | 2 +- docs/install-octoprint.md | 2 +- docs/install-one-calendar.md | 2 +- docs/install-opera-browser.md | 2 +- docs/install-opera-gx.md | 2 +- docs/install-paint-3d.md | 2 +- docs/install-power-toys.md | 2 +- docs/install-powershell.md | 13 ++- docs/install-rufus.md | 2 +- docs/install-signal-cli.md | 2 +- docs/install-skype.md | 2 +- docs/install-spotify.md | 2 +- docs/install-ssh-client.md | 2 +- docs/install-ssh-server.md | 2 +- docs/install-thunderbird.md | 2 +- docs/install-twitter.md | 2 +- docs/install-unbound-server.md | 2 +- docs/install-updates.md | 29 ++++-- docs/install-visual-studio-code.md | 2 +- docs/install-vivaldi.md | 2 +- docs/install-vlc.md | 2 +- docs/install-windows-terminal.md | 2 +- docs/install-wsl.md | 2 +- docs/install-zoom.md | 2 +- docs/introduce-powershell.md | 11 +- docs/list-aliases.md | 2 +- docs/list-anagrams.md | 2 +- docs/list-apps.md | 2 +- docs/list-ascii-table.md | 2 +- docs/list-automatic-variables.md | 2 +- docs/list-battery-status.md | 2 +- docs/list-bios.md | 2 +- docs/list-bluetooth-devices.md | 2 +- docs/list-branches.md | 2 +- docs/list-calendar.md | 2 +- docs/list-cheat-sheet.md | 2 +- docs/list-city-weather.md | 9 +- docs/list-cli-tools.md | 19 ++-- docs/list-clipboard.md | 5 +- docs/list-cmdlets.md | 2 +- docs/list-coffee-prices.md | 15 ++- docs/list-commit-stats.md | 2 +- docs/list-commits.md | 2 +- docs/list-console-colors.md | 2 +- docs/list-countries.md | 2 +- docs/list-cpu.md | 2 +- docs/list-credits.md | 22 ++-- docs/list-crypto-rates.md | 2 +- docs/list-defender-settings.md | 2 +- docs/list-dir-tree.md | 2 +- docs/list-dns-servers.md | 2 +- docs/list-drives.md | 2 +- docs/list-earthquakes.md | 44 +++++--- docs/list-emojis.md | 2 +- docs/list-empty-dirs.md | 2 +- docs/list-empty-files.md | 2 +- docs/list-encrypted-files.md | 2 +- docs/list-environment-variables.md | 2 +- docs/list-error-types.md | 2 +- docs/list-exchange-rates.md | 2 +- docs/list-executables.md | 2 +- docs/list-fibonacci.md | 2 +- docs/list-files.md | 2 +- docs/list-folder.md | 2 +- docs/list-fritzbox-calls.md | 2 +- docs/list-fritzbox-devices.md | 2 +- docs/list-headlines.md | 2 +- docs/list-hidden-files.md | 2 +- docs/list-installed-languages.md | 2 +- docs/list-installed-scripts.md | 2 +- docs/list-installed-software.md | 2 +- docs/list-ipv6.md | 2 +- docs/list-latest-tag.md | 2 +- docs/list-latest-tags.md | 2 +- docs/list-memos.md | 2 +- docs/list-motherboard.md | 2 +- docs/list-mysql-tables.md | 2 +- docs/list-network-connections.md | 2 +- docs/list-network-neighbors.md | 74 ++++++++++++++ docs/list-network-routes.md | 2 +- docs/list-network-shares.md | 2 +- docs/list-news.md | 16 ++- docs/list-nic.md | 2 +- docs/list-nina-warnings.md | 49 +++++---- docs/list-os-releases.md | 2 +- docs/list-os-updates.md | 2 +- docs/list-os.md | 2 +- docs/list-outlook-inbox.md | 2 +- docs/list-outlook-sent.md | 2 +- docs/list-passwords.md | 2 +- docs/list-pi.md | 2 +- docs/list-pins.md | 2 +- docs/list-power-schemes.md | 2 +- docs/list-powershell-modules.md | 2 +- docs/list-powershell-profiles.md | 2 +- docs/list-powershell-verbs.md | 2 +- docs/list-print-jobs.md | 2 +- docs/list-printers.md | 2 +- docs/list-processes.md | 2 +- docs/list-public-ip.md | 2 +- docs/list-pull-requests.md | 2 +- docs/list-ram.md | 2 +- docs/list-read-only-files.md | 2 +- docs/list-recycle-bin.md | 2 +- docs/list-repos.md | 30 +++--- docs/list-scripts.md | 2 +- docs/list-services.md | 2 +- docs/list-special-folders.md | 2 +- docs/list-sql-tables.md | 2 +- docs/list-submodules.md | 2 +- docs/list-suggestions.md | 2 +- docs/list-system-files.md | 2 +- docs/list-system-info.md | 2 +- docs/list-tags.md | 9 +- docs/list-tasks.md | 2 +- docs/list-timezone.md | 2 +- docs/list-timezones.md | 2 +- docs/list-tiobe-index.md | 2 +- docs/list-unused-files.md | 2 +- docs/list-updates.md | 2 +- docs/list-user-accounts.md | 2 +- docs/list-user-groups.md | 2 +- docs/list-voices.md | 2 +- docs/list-weather.md | 105 ++++++++++--------- docs/list-wifi.md | 2 +- docs/list-window-titles.md | 12 +-- docs/list-workdir.md | 2 +- docs/list-wsl-distros.md | 2 +- docs/locate-city.md | 58 +++++------ docs/locate-ipaddress.md | 2 +- docs/locate-my-phone.md | 2 +- docs/locate-zip-code.md | 2 +- docs/lock-desktop.md | 2 +- docs/log-off.md | 2 +- docs/make-install.md | 2 +- docs/measure-BubbleSort.md | 2 +- docs/measure-BucketSort.md | 2 +- docs/measure-CountingSort.md | 2 +- docs/measure-HeapSort.md | 2 +- docs/measure-InsertionSort.md | 2 +- docs/measure-MergeSort.md | 2 +- docs/measure-QuickSort.md | 2 +- docs/measure-SelectionSort.md | 2 +- docs/measure-sorting-algorithms.md | 2 +- docs/merry-christmas.md | 2 +- docs/minimize-all-windows.md | 2 +- docs/move-mouse-pointer.md | 2 +- docs/move-vm.md | 2 +- docs/my-profile.md | 9 +- docs/new-branch.md | 38 +++---- docs/new-dir.md | 78 ++++++++++++++ docs/new-email.md | 2 +- docs/new-linux-vm.md | 2 +- docs/new-qrcode.md | 2 +- docs/new-script.md | 2 +- docs/new-shortcut.md | 2 +- docs/new-symlink.md | 2 +- docs/new-tag.md | 2 +- docs/new-user.md | 8 +- docs/new-windows-vm.md | 2 +- docs/new-zipfile.md | 2 +- docs/on-desktop-login.md | 9 +- docs/open-apps-folder.md | 2 +- docs/open-auto-start-folder.md | 2 +- docs/open-bing-maps.md | 2 +- docs/open-booking-com.md | 2 +- docs/open-c-drive.md | 2 +- docs/open-calculator.md | 2 +- docs/open-chrome.md | 2 +- docs/open-clock.md | 2 +- docs/open-cortana.md | 2 +- docs/open-d-drive.md | 2 +- docs/open-dashboards.md | 26 ++--- docs/open-deep-l-translator.md | 2 +- docs/open-default-browser.md | 2 +- docs/open-desktop-folder.md | 2 +- docs/open-documents-folder.md | 2 +- docs/open-downloads-folder.md | 2 +- docs/open-dropbox-folder.md | 2 +- docs/open-duck-duck-go.md | 2 +- docs/open-e-drive.md | 2 +- docs/open-edge.md | 2 +- docs/open-egg-timer.md | 2 +- docs/open-email-client.md | 2 +- docs/open-f-drive.md | 2 +- docs/open-file-explorer.md | 2 +- docs/open-fire-place.md | 2 +- docs/open-firefox.md | 2 +- docs/open-flight-radar.md | 2 +- docs/open-g-drive.md | 2 +- docs/open-git-extensions.md | 2 +- docs/open-google-books.md | 2 +- docs/open-google-calendar.md | 2 +- docs/open-google-contacts.md | 2 +- docs/open-google-docs.md | 2 +- docs/open-google-earth.md | 2 +- docs/open-google-mail.md | 2 +- docs/open-google-maps.md | 2 +- docs/open-google-news.md | 2 +- docs/open-google-photos.md | 2 +- docs/open-google-play.md | 2 +- docs/open-google-search.md | 2 +- docs/open-google-stadia.md | 2 +- docs/open-google-translate.md | 2 +- docs/open-home-folder.md | 2 +- docs/open-internet-archive.md | 2 +- docs/open-jitsi-meet.md | 2 +- docs/open-m-drive.md | 2 +- docs/open-magnifier.md | 2 +- docs/open-microsoft-paint.md | 2 +- docs/open-microsoft-solitaire.md | 2 +- docs/open-microsoft-store.md | 2 +- docs/open-microsoft-teams.md | 2 +- docs/open-music-folder.md | 2 +- docs/open-netflix.md | 2 +- docs/open-note-pad.md | 2 +- docs/open-obs-studio.md | 2 +- docs/open-office-365.md | 2 +- docs/open-one-drive-folder.md | 2 +- docs/open-outlook.md | 2 +- docs/open-paint-three-d.md | 2 +- docs/open-pictures-folder.md | 2 +- docs/open-rdp.md | 2 +- docs/open-recycle-bin-folder.md | 2 +- docs/open-remote-desktop.md | 2 +- docs/open-repos-folder.md | 2 +- docs/open-screen-clip.md | 2 +- docs/open-screen-sketch.md | 2 +- docs/open-skype.md | 2 +- docs/open-snipping-tool.md | 2 +- docs/open-speed-test.md | 2 +- docs/open-spotify.md | 2 +- docs/open-stack-overflow.md | 2 +- docs/open-start-page.md | 2 +- docs/open-street-map.md | 2 +- docs/open-task-manager.md | 2 +- docs/open-temporary-folder.md | 2 +- docs/open-three-d-viewer.md | 2 +- docs/open-thunderbird.md | 2 +- docs/open-videos-folders.md | 2 +- docs/open-visual-studio.md | 2 +- docs/open-vpn-settings.md | 2 +- docs/open-windows-defender.md | 2 +- docs/open-windows-terminal.md | 2 +- docs/open-xing.md | 2 +- docs/pick-commit.md | 2 +- docs/ping-host.md | 2 +- docs/ping-local-hosts.md | 41 ++++---- docs/ping-remote-hosts.md | 16 ++- docs/ping-weather.md | 2 +- docs/play-bee-sound.md | 2 +- docs/play-beep-sound.md | 2 +- docs/play-big-ben.md | 53 ++++++++++ docs/play-cat-sound.md | 2 +- docs/play-cow-sound.md | 2 +- docs/play-dog-sound.md | 2 +- docs/play-donkey-sound.md | 2 +- docs/play-elephant-sound.md | 2 +- docs/play-elk-sound.md | 2 +- docs/play-files.md | 2 +- docs/play-frog-sound.md | 2 +- docs/play-goat-sound.md | 2 +- docs/play-gorilla-sound.md | 2 +- docs/play-happy-birthday.md | 2 +- docs/play-horse-sound.md | 2 +- docs/play-imperial-march.md | 2 +- docs/play-jingle-bells.md | 2 +- docs/play-lion-sound.md | 2 +- docs/play-m3u.md | 2 +- docs/play-mission-impossible.md | 2 +- docs/play-mp3.md | 68 +++++++------ docs/play-parrot-sound.md | 2 +- docs/play-pig-sound.md | 2 +- docs/play-pong.md | 2 +- docs/play-rattlesnake-sound.md | 2 +- docs/play-rick.md | 2 +- docs/play-snake.md | 2 +- docs/play-super-mario.md | 2 +- docs/play-system-sounds.md | 58 +++++++++++ docs/play-tetris-melody.md | 2 +- docs/play-vulture-sound.md | 2 +- docs/play-wolf-sound.md | 2 +- docs/poweroff.md | 2 +- docs/print-image.md | 2 +- docs/publish-to-ipfs.md | 2 +- docs/pull-repo.md | 58 +++++------ docs/pull-repos.md | 4 +- docs/query-smart-data.md | 2 +- docs/reboot-fritzbox.md | 2 +- docs/reboot.md | 2 +- docs/remind-me.md | 2 +- docs/remove-dir-tree.md | 2 +- docs/remove-empty-dirs.md | 2 +- docs/remove-old-dirs.md | 2 +- docs/remove-print-jobs.md | 2 +- docs/remove-tag.md | 2 +- docs/remove-user.md | 78 ++++++++++++++ docs/remove-vm.md | 2 +- docs/replace-in-files.md | 2 +- docs/restart-network-adapters.md | 2 +- docs/roll-a-dice.md | 2 +- docs/save-credentials.md | 2 +- docs/save-screenshot.md | 2 +- docs/scan-network.md | 35 +++++++ docs/scan-ports.md | 2 +- docs/search-filename.md | 2 +- docs/search-files.md | 62 +++++++----- docs/send-email.md | 2 +- docs/send-tcp.md | 2 +- docs/send-udp.md | 2 +- docs/set-timer.md | 2 +- docs/set-volume.md | 2 +- docs/set-wallpaper.md | 2 +- docs/show-lightnings.md | 2 +- docs/show-notification.md | 27 +++-- docs/show-traffic.md | 2 +- docs/simulate-presence.md | 2 +- docs/smart-data2csv.md | 2 +- docs/speak-arabic.md | 2 +- docs/speak-checklist.md | 2 +- docs/speak-countdown.md | 2 +- docs/speak-croatian.md | 2 +- docs/speak-danish.md | 2 +- docs/speak-dutch.md | 2 +- docs/speak-english.md | 2 +- docs/speak-epub.md | 2 +- docs/speak-esperanto.md | 2 +- docs/speak-file.md | 2 +- docs/speak-finnish.md | 2 +- docs/speak-french.md | 2 +- docs/speak-german.md | 2 +- docs/speak-greek.md | 2 +- docs/speak-hebrew.md | 2 +- docs/speak-hindi.md | 2 +- docs/speak-italian.md | 2 +- docs/speak-japanese.md | 2 +- docs/speak-korean.md | 2 +- docs/speak-latin.md | 2 +- docs/speak-mandarin.md | 2 +- docs/speak-norwegian.md | 2 +- docs/speak-polish.md | 2 +- docs/speak-portuguese.md | 2 +- docs/speak-russian.md | 2 +- docs/speak-spanish.md | 2 +- docs/speak-swedish.md | 2 +- docs/speak-test.md | 2 +- docs/speak-text.md | 2 +- docs/speak-thai.md | 2 +- docs/speak-turkish.md | 2 +- docs/speak-ukrainian.md | 2 +- docs/spell-word.md | 2 +- docs/start-ipfs-server.md | 2 +- docs/suspend.md | 2 +- docs/switch-branch.md | 38 ++++--- docs/switch-shelly1.md | 2 +- docs/switch-tabs.md | 2 +- docs/sync-folder.md | 2 +- docs/sync-repo.md | 2 +- docs/tell-joke.md | 2 +- docs/tell-new-year.md | 65 ++++++++++++ docs/tell-quote.md | 2 +- docs/toggle-caps-lock.md | 2 +- docs/toggle-num-lock.md | 2 +- docs/toggle-scroll-lock.md | 2 +- docs/translate-file.md | 2 +- docs/translate-files.md | 2 +- docs/translate-text.md | 2 +- docs/turn-volume-down.md | 2 +- docs/turn-volume-fully-up.md | 2 +- docs/turn-volume-off.md | 2 +- docs/turn-volume-on.md | 2 +- docs/turn-volume-up.md | 2 +- docs/uninstall-all-apps.md | 2 +- docs/uninstall-bloatware.md | 2 +- docs/uninstall-chrome.md | 2 +- docs/uninstall-crystal-disk-info.md | 2 +- docs/uninstall-crystal-disk-mark.md | 2 +- docs/uninstall-discord.md | 2 +- docs/uninstall-edge.md | 2 +- docs/uninstall-firefox.md | 2 +- docs/uninstall-git-extensions.md | 2 +- docs/uninstall-github-cli.md | 2 +- docs/uninstall-irfanview.md | 2 +- docs/uninstall-microsoft-teams.md | 2 +- docs/uninstall-netflix.md | 2 +- docs/uninstall-nine-zip.md | 2 +- docs/uninstall-one-calendar.md | 2 +- docs/uninstall-opera-browser.md | 2 +- docs/uninstall-opera-gx.md | 2 +- docs/uninstall-paint-3d.md | 2 +- docs/uninstall-rufus.md | 2 +- docs/uninstall-skype.md | 2 +- docs/uninstall-spotify.md | 2 +- docs/uninstall-twitter.md | 2 +- docs/uninstall-visual-studio-code.md | 2 +- docs/uninstall-vlc.md | 2 +- docs/uninstall-windows-terminal.md | 2 +- docs/update-powershell-profile.md | 83 +++++++++++++++ docs/upgrade-ubuntu.md | 2 +- docs/upload-file.md | 2 +- docs/upload-to-dropbox.md | 2 +- docs/wake-up.md | 10 +- docs/watch-commits.md | 118 +++++++++++++++++++++ docs/watch-file.md | 2 +- docs/watch-news.md | 93 +++++++++++++++++ docs/weather-report.md | 2 +- docs/weather.md | 2 +- docs/what-is.md | 2 +- docs/windefender.md | 2 +- docs/write-animated.md | 135 ++++++------------------- docs/write-ascii-image.md | 2 +- docs/write-big.md | 2 +- docs/write-blue.md | 2 +- docs/write-braille.md | 2 +- docs/write-centered.md | 79 +++++++++++++++ docs/write-changelog.md | 2 +- docs/write-chart.md | 2 +- docs/write-clock.md | 2 +- docs/write-code.md | 2 +- docs/write-date.md | 2 +- docs/write-fractal.md | 2 +- docs/write-green.md | 2 +- docs/write-headline.md | 83 +++++++++++++++ docs/write-in-emojis.md | 2 +- docs/write-joke.md | 2 +- docs/write-lowercase.md | 2 +- docs/write-marquee.md | 2 +- docs/write-matrix.md | 2 +- docs/write-moon.md | 2 +- docs/write-morse-code.md | 2 +- docs/write-motd.md | 2 +- docs/write-qr-code.md | 2 +- docs/write-quote.md | 15 +-- docs/write-red.md | 2 +- docs/write-rot13.md | 2 +- docs/write-shit.md | 2 +- docs/write-sine-curves.md | 2 +- docs/write-time.md | 2 +- docs/write-typewriter.md | 2 +- docs/write-uppercase.md | 2 +- docs/write-vertical.md | 2 +- 621 files changed, 2432 insertions(+), 1291 deletions(-) create mode 100644 docs/cd-repo.md create mode 100644 docs/count-characters.md create mode 100644 docs/count-lines.md create mode 100644 docs/list-network-neighbors.md create mode 100644 docs/new-dir.md create mode 100644 docs/play-big-ben.md create mode 100644 docs/play-system-sounds.md create mode 100644 docs/remove-user.md create mode 100644 docs/scan-network.md create mode 100644 docs/tell-new-year.md create mode 100644 docs/update-powershell-profile.md create mode 100644 docs/watch-commits.md create mode 100644 docs/watch-news.md create mode 100644 docs/write-centered.md create mode 100644 docs/write-headline.md diff --git a/docs/add-firewall-rules.md b/docs/add-firewall-rules.md index b95b53474..ca9c652cc 100644 --- a/docs/add-firewall-rules.md +++ b/docs/add-firewall-rules.md @@ -113,4 +113,4 @@ try { ``` -*(generated by convert-ps2md.ps1 using the comment-based help of add-firewall-rules.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of add-firewall-rules.ps1 as of 05/19/2024 10:25:16)* diff --git a/docs/add-memo.md b/docs/add-memo.md index 0dd3af409..161924575 100644 --- a/docs/add-memo.md +++ b/docs/add-memo.md @@ -79,4 +79,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of add-memo.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of add-memo.ps1 as of 05/19/2024 10:25:16)* diff --git a/docs/alert.md b/docs/alert.md index 5e9d46e33..b0d226044 100644 --- a/docs/alert.md +++ b/docs/alert.md @@ -71,4 +71,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of alert.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of alert.ps1 as of 05/19/2024 10:25:16)* diff --git a/docs/build-repo.md b/docs/build-repo.md index 3e3692c14..2078a3172 100644 --- a/docs/build-repo.md +++ b/docs/build-repo.md @@ -74,54 +74,58 @@ function BuildInDir([string]$path) { "⏳ (2/4) Executing 'cmake' to generate the Makefile..." & cmake .. - if ($lastExitCode -ne "0") { throw "Executing 'cmake ..' has failed" } + if ($lastExitCode -ne "0") { throw "Executing 'cmake ..' exited with error code $lastExitCode" } "⏳ (3/4) Executing 'make -j4' to compile and link..." & make -j4 - if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } + if ($lastExitCode -ne "0") { throw "Executing 'make -j4' exited with error code $lastExitCode" } "⏳ (4/4) Executing 'ctest -V' to perform tests (optional)..." & ctest -V - if ($lastExitCode -ne "0") { throw "Executing 'make test' has failed" } + if ($lastExitCode -ne "0") { throw "Executing 'ctest -V' exited with error code $lastExitCode" } - } elseif (Test-Path "$path/configure" -pathType leaf) { - "⏳ Building πŸ“‚$dirName by using 'configure'..." + } elseif (Test-Path "$path/autogen.sh" -pathType leaf) { + "⏳ Building πŸ“‚$dirName by using 'autogen.sh'..." Set-Location "$path/" + & ./autogen.sh --force + if ($lastExitCode -ne "0") { throw "Executing './autogen.sh --force' exited with error code $lastExitCode" } + & ./configure - #if ($lastExitCode -ne "0") { throw "Script 'configure' exited with error code $lastExitCode" } + if ($lastExitCode -ne "0") { throw "Executing './configure' exited with error code $lastExitCode" } & make -j4 - if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } + if ($lastExitCode -ne "0") { throw "Executing 'make -j4' exited with error code $lastExitCode" } - & make test - if ($lastExitCode -ne "0") { throw "Executing 'make test' has failed" } - } elseif (Test-Path "$path/autogen.sh" -pathType leaf) { - "⏳ Building πŸ“‚$dirName by using 'autogen.sh'..." + } elseif (Test-Path "$path/configure" -pathType leaf) { + "⏳ Building πŸ“‚$dirName by using 'configure'..." Set-Location "$path/" - & ./autogen.sh - if ($lastExitCode -ne "0") { throw "Script 'autogen.sh' exited with error code $lastExitCode" } + & ./configure + #if ($lastExitCode -ne "0") { throw "Executing './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/build.gradle" -pathType leaf) { "⏳ Building πŸ“‚$dirName by using Gradle..." Set-Location "$path" & gradle build - if ($lastExitCode -ne "0") { throw "'gradle build' has failed" } + if ($lastExitCode -ne "0") { throw "Executing 'gradle build' exited with error code $lastExitCode" } & gradle test - if ($lastExitCode -ne "0") { throw "'gradle test' has failed" } + if ($lastExitCode -ne "0") { throw "Executing 'gradle test' exited with error code $lastExitCode" } } elseif (Test-Path "$path/meson.build" -pathType leaf) { "⏳ Building πŸ“‚$dirName by using Meson..." Set-Location "$path" & meson . build --prefix=/usr/local - if ($lastExitCode -ne "0") { throw "'meson . build' has failed" } + if ($lastExitCode -ne "0") { throw "Executing 'meson . build' exited with error code $lastExitCode" } } elseif (Test-Path "$path/Imakefile" -pathType leaf) { "⏳ Building πŸ“‚$dirName by using Imakefile..." @@ -152,7 +156,7 @@ function BuildInDir([string]$path) { Set-Location "$path/" & ./compile.sh - if ($lastExitCode -ne "0") { throw "Script 'compile.sh' exited with error code $lastExitCode" } + if ($lastExitCode -ne "0") { throw "Executing './compile.sh' exited with error code $lastExitCode" } & make -j4 if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } @@ -162,7 +166,7 @@ function BuildInDir([string]$path) { 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" } + if ($lastExitCode -ne "0") { throw "Executing 'build.bat build-all-release' exited with error code $lastExitCode" } } elseif (Test-Path "$path/$dirName" -pathType container) { "⏳ No make rule found, trying subfolder πŸ“‚$($dirName)..." @@ -192,4 +196,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of build-repo.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of build-repo.ps1 as of 05/19/2024 10:25:16)* diff --git a/docs/build-repos.md b/docs/build-repos.md index 13dc78dd0..7b43d7a50 100644 --- a/docs/build-repos.md +++ b/docs/build-repos.md @@ -82,4 +82,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of build-repos.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of build-repos.ps1 as of 05/19/2024 10:25:16)* diff --git a/docs/cd-autostart.md b/docs/cd-autostart.md index 3e871a0dd..6273d810b 100644 --- a/docs/cd-autostart.md +++ b/docs/cd-autostart.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-autostart.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-autostart.ps1 as of 05/19/2024 10:25:16)* diff --git a/docs/cd-crashdumps.md b/docs/cd-crashdumps.md index 22ca46d93..e5f41f0bd 100644 --- a/docs/cd-crashdumps.md +++ b/docs/cd-crashdumps.md @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-crashdumps.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-crashdumps.ps1 as of 05/19/2024 10:25:16)* diff --git a/docs/cd-desktop.md b/docs/cd-desktop.md index 10e5626ae..3f08438a9 100644 --- a/docs/cd-desktop.md +++ b/docs/cd-desktop.md @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-desktop.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-desktop.ps1 as of 05/19/2024 10:25:16)* diff --git a/docs/cd-docs.md b/docs/cd-docs.md index 53b665629..8f25f6c2a 100644 --- a/docs/cd-docs.md +++ b/docs/cd-docs.md @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-docs.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-docs.ps1 as of 05/19/2024 10:25:16)* diff --git a/docs/cd-downloads.md b/docs/cd-downloads.md index f43449e59..3c9617d4b 100644 --- a/docs/cd-downloads.md +++ b/docs/cd-downloads.md @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-downloads.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-downloads.ps1 as of 05/19/2024 10:25:16)* diff --git a/docs/cd-dropbox.md b/docs/cd-dropbox.md index 97276d756..23c3c4857 100644 --- a/docs/cd-dropbox.md +++ b/docs/cd-dropbox.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-dropbox.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-dropbox.ps1 as of 05/19/2024 10:25:16)* diff --git a/docs/cd-etc.md b/docs/cd-etc.md index 786b8ec5c..4e681104e 100644 --- a/docs/cd-etc.md +++ b/docs/cd-etc.md @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-etc.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-etc.ps1 as of 05/19/2024 10:25:16)* diff --git a/docs/cd-fonts.md b/docs/cd-fonts.md index 578860d85..9c97c91e3 100644 --- a/docs/cd-fonts.md +++ b/docs/cd-fonts.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-fonts.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-fonts.ps1 as of 05/19/2024 10:25:16)* diff --git a/docs/cd-home.md b/docs/cd-home.md index 73ba2a840..f7b8e3890 100644 --- a/docs/cd-home.md +++ b/docs/cd-home.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-home.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-home.ps1 as of 05/19/2024 10:25:16)* diff --git a/docs/cd-logs.md b/docs/cd-logs.md index 0c3296d9d..d78a82d3b 100644 --- a/docs/cd-logs.md +++ b/docs/cd-logs.md @@ -48,4 +48,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-logs.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-logs.ps1 as of 05/19/2024 10:25:16)* diff --git a/docs/cd-music.md b/docs/cd-music.md index 1f7b62794..6e5a44868 100644 --- a/docs/cd-music.md +++ b/docs/cd-music.md @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-music.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-music.ps1 as of 05/19/2024 10:25:16)* diff --git a/docs/cd-onedrive.md b/docs/cd-onedrive.md index 2d0b1b9f2..0e47c70a7 100644 --- a/docs/cd-onedrive.md +++ b/docs/cd-onedrive.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-onedrive.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-onedrive.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-pics.md b/docs/cd-pics.md index 954e12b29..82306ed7e 100644 --- a/docs/cd-pics.md +++ b/docs/cd-pics.md @@ -62,4 +62,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-pics.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-pics.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-public.md b/docs/cd-public.md index 91c361be2..d2550c529 100644 --- a/docs/cd-public.md +++ b/docs/cd-public.md @@ -62,4 +62,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-public.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-public.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-recycle-bin.md b/docs/cd-recycle-bin.md index ae91c10be..d1da47921 100644 --- a/docs/cd-recycle-bin.md +++ b/docs/cd-recycle-bin.md @@ -19,7 +19,7 @@ Script Content ```powershell <# .SYNOPSIS - Sets the working directory to the user's recycle bin folder + Sets the working directory to the recycle bin folder .DESCRIPTION This PowerShell script changes the working directory to the user's recycle bin folder. .EXAMPLE @@ -39,13 +39,13 @@ function GetCurrentUserSID { [CmdletBinding()] param() try { if ($IsLinux) { - $Path = "$HOME/.local/share/Trash/" + $path = "$HOME/.local/share/Trash/" } else { - $Path = "C:\$Recycle.Bin\" + "$(GetCurrentUserSID)" + $path = "C:\`$Recycle.Bin\$(GetCurrentUserSID)" } - if (-not(Test-Path "$Path" -pathType container)) { throw "Recycle bin folder at πŸ“‚$Path doesn't exist (yet)" } - Set-Location "$Path" - "πŸ“‚$Path" + if (-not(Test-Path "$path" -pathType container)) { throw "Recycle bin folder at πŸ“‚$path doesn't exist (yet)" } + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-recycle-bin.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-recycle-bin.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-repo.md b/docs/cd-repo.md new file mode 100644 index 000000000..c62b82bfc --- /dev/null +++ b/docs/cd-repo.md @@ -0,0 +1,93 @@ +Script: *cd-repo.ps1* +======================== + +This PowerShell script changes the working directory to a Git repository. + +Parameters +---------- +```powershell +PS> ./cd-repo.ps1 [[-folderName] ] [] + +-folderName + Specifies the folder name + + Required? false + Position? 1 + Default value + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./cd-repo.ps1 rust +πŸ“‚C:\Repos\rust β€’ on Git branch: ## main ... origin/main + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Sets the working directory to a repository +.DESCRIPTION + This PowerShell script changes the working directory to a Git repository. +.PARAMETER folderName + Specifies the folder name +.EXAMPLE + PS> ./cd-repo.ps1 rust + πŸ“‚C:\Repos\rust β€’ on Git branch: ## main ... origin/main +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([string]$folderName = "") + +try { + if ("$folderName" -eq "") { $folderName = Read-Host "Enter the folder name" } + + if (Test-Path "$HOME/Repos/" -pathType Container) { # try short name + $path = "$HOME/Repos/" + } elseif (Test-Path "$HOME/repos/" -pathType Container) { + $path = "$HOME/repos/" + } elseif (Test-Path "$HOME/Repositories/" -pathType Container) { # try long name + $path = "$HOME/Repositories/" + } elseif (Test-Path "$HOME/source/repos/" -pathType Container) { # try Visual Studio default + $path = "$HOME/source/repos/" + } elseif (Test-Path "/Repos/" -pathType Container) { + $path = "/Repos/" + } else { + throw "The folder for Git repositories doesn't exist (yet)" + } + $path += $folderName + + if (-not(Test-Path "$path" -pathType Container)) { throw "The path to πŸ“‚$path doesn't exist (yet)" } + $path = Resolve-Path "$path" + Set-Location "$path" + Write-Host "πŸ“‚$path β€’ on Git branch: " -noNewline + + & git status --short --branch --show-stash + exit 0 # success +} catch { + "⚠️ Error: $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of cd-repo.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-repos.md b/docs/cd-repos.md index 3201d2d78..fdbf72162 100644 --- a/docs/cd-repos.md +++ b/docs/cd-repos.md @@ -6,16 +6,7 @@ This PowerShell script changes the working directory to the user's Git repositor Parameters ---------- ```powershell -PS> ./cd-repos.ps1 [[-subpath] ] [] - --subpath - Specifies an additional relative subpath (optional) - - Required? false - Position? 1 - Default value - Accept pipeline input? false - Accept wildcard characters? false +PS> ./cd-repos.ps1 [] [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -25,15 +16,9 @@ PS> ./cd-repos.ps1 [[-subpath] ] [] Example ------- ```powershell -PS> ./cd-repos +PS> ./cd-repos.ps1 πŸ“‚C:\Users\Markus\Repos - - -PS> ./cd-repos rust -πŸ“‚C:\Users\Markus\Repos\rust - on branch: ## main ... origin/main - ``` Notes @@ -55,20 +40,14 @@ Script Content .PARAMETER subpath Specifies an additional relative subpath (optional) .EXAMPLE - PS> ./cd-repos + PS> ./cd-repos.ps1 πŸ“‚C:\Users\Markus\Repos - - PS> ./cd-repos rust - πŸ“‚C:\Users\Markus\Repos\rust - on branch: ## main ... origin/main .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/" @@ -83,16 +62,10 @@ try { } else { throw "The folder for Git repositories doesn't exist (yet)" } - if ("$subpath" -ne "") { $path += $subpath } if (-not(Test-Path "$path" -pathType Container)) { throw "The path to πŸ“‚$path doesn't exist (yet)" } $path = Resolve-Path "$path" Set-Location "$path" "πŸ“‚$path" - - if ("$subpath" -ne "") { - Write-Host -noNewline " on branch: " - & git status --short --branch --show-stash - } exit 0 # success } catch { "⚠️ Error: $($Error[0])" @@ -100,4 +73,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-repos.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-repos.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-root.md b/docs/cd-root.md index fed7e7d04..6cfae5224 100644 --- a/docs/cd-root.md +++ b/docs/cd-root.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-root.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-root.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-screenshots.md b/docs/cd-screenshots.md index 3baaf7237..1375d77f3 100644 --- a/docs/cd-screenshots.md +++ b/docs/cd-screenshots.md @@ -55,4 +55,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-screenshots.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-screenshots.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-scripts.md b/docs/cd-scripts.md index 2bbc6dbed..e147b6d39 100644 --- a/docs/cd-scripts.md +++ b/docs/cd-scripts.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-scripts.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-scripts.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-ssh.md b/docs/cd-ssh.md index 679e16da1..168319bf1 100644 --- a/docs/cd-ssh.md +++ b/docs/cd-ssh.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-ssh.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-ssh.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-temp.md b/docs/cd-temp.md index e5a296850..e4ea53953 100644 --- a/docs/cd-temp.md +++ b/docs/cd-temp.md @@ -50,4 +50,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-temp.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-temp.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-templates.md b/docs/cd-templates.md index 763a5ec8a..a6dc31e45 100644 --- a/docs/cd-templates.md +++ b/docs/cd-templates.md @@ -62,4 +62,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-templates.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-templates.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-trash.md b/docs/cd-trash.md index 0d4d02e2d..bb98547a9 100644 --- a/docs/cd-trash.md +++ b/docs/cd-trash.md @@ -19,7 +19,7 @@ Script Content ```powershell <# .SYNOPSIS - Sets the working directory to the user's trash folder + Sets the working directory to the trash folder .DESCRIPTION This PowerShell script changes the working directory to the user's trash folder. .EXAMPLE @@ -39,13 +39,13 @@ function GetCurrentUserSID { [CmdletBinding()] param() try { if ($IsLinux) { - $Path = "$HOME/.local/share/Trash/" + $path = "$HOME/.local/share/Trash/" } else { - $Path = "C:\$Recycle.Bin\" + "$(GetCurrentUserSID)" + $path = "C:\`$Recycle.Bin\$(GetCurrentUserSID)" } - if (-not(Test-Path "$Path" -pathType container)) { throw "Trash folder at πŸ“‚$Path doesn't exist (yet)" } - Set-Location "$Path" - "πŸ“‚$Path" + if (-not(Test-Path "$path" -pathType container)) { throw "Trash folder at πŸ“‚$path doesn't exist (yet)" } + Set-Location "$path" + "πŸ“‚$path" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-trash.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-trash.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-up.md b/docs/cd-up.md index 1e8d81c27..57e5408d6 100644 --- a/docs/cd-up.md +++ b/docs/cd-up.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-up.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-up.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-up2.md b/docs/cd-up2.md index ffb34a8b7..8e567601e 100644 --- a/docs/cd-up2.md +++ b/docs/cd-up2.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-up2.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-up2.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-up3.md b/docs/cd-up3.md index 235907639..54480fe41 100644 --- a/docs/cd-up3.md +++ b/docs/cd-up3.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-up3.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-up3.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-up4.md b/docs/cd-up4.md index fa16fd417..6360928bf 100644 --- a/docs/cd-up4.md +++ b/docs/cd-up4.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-up4.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-up4.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-users.md b/docs/cd-users.md index a3d2210a6..75bc4b522 100644 --- a/docs/cd-users.md +++ b/docs/cd-users.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-users.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-users.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-videos.md b/docs/cd-videos.md index 85b2d03bc..043669fbd 100644 --- a/docs/cd-videos.md +++ b/docs/cd-videos.md @@ -62,4 +62,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-videos.ps1 as of 03/27/2024 17:36:23)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-videos.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/cd-windows.md b/docs/cd-windows.md index 8293f8977..fea645413 100644 --- a/docs/cd-windows.md +++ b/docs/cd-windows.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of cd-windows.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of cd-windows.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/change-wallpaper.md b/docs/change-wallpaper.md index 143626610..a6df013be 100644 --- a/docs/change-wallpaper.md +++ b/docs/change-wallpaper.md @@ -79,4 +79,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of change-wallpaper.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of change-wallpaper.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-admin.md b/docs/check-admin.md index 34787d9fe..863884961 100644 --- a/docs/check-admin.md +++ b/docs/check-admin.md @@ -67,4 +67,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-admin.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-admin.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-apps.md b/docs/check-apps.md index 9ff3e90d6..82b93d018 100644 --- a/docs/check-apps.md +++ b/docs/check-apps.md @@ -1,34 +1,19 @@ Script: *check-apps.ps1* ======================== -This PowerShell script queries the installed applications and prints it. +check-apps.ps1 + Parameters ---------- ```powershell -PS> ./check-apps.ps1 [] + [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` -Example -------- -```powershell -PS> ./check-apps.ps1 -βœ… 119 Windows apps installed, 11 upgrades available - -``` - -Notes ------ -Author: Markus Fleschutz | License: CC0 - -Related Links -------------- -https://github.com/fleschutz/PowerShell - Script Content -------------- ```powershell @@ -46,28 +31,43 @@ Script Content Author: Markus Fleschutz | License: CC0 #> +function GetCrashDumps { + [string]$path = Resolve-Path -Path "~\AppData\Local\CrashDumps" + $count = 0 + $files = (Get-ChildItem -path "$path\*.dmp" -attributes !Directory) + foreach($file in $files) { $count++ } + return $count +} + try { + $statusIcon = "βœ…" + $statusMsg = "" if ($IsLinux) { Write-Progress "Querying installed applications..." $numPkgs = (apt list --installed 2>/dev/null).Count $numSnaps = (snap list).Count - 1 - Write-Progress -Completed "." - Write-Host "βœ… $numPkgs Debian packages, $numSnaps snaps installed" + Write-Progress -completed "Done." + $statusMsg += "$numPkgs Debian packages, $numSnaps snaps installed" } else { - Write-Progress "Querying installed applications..." + Write-Progress "Querying installed apps..." $Apps = Get-AppxPackage - Write-Progress -Completed "." - Write-Host "βœ… $($Apps.Count) Windows apps installed, " -noNewline + Write-Progress -completed "Done." + $statusMsg = "$($Apps.Count) Win apps installed" + + [int]$numNonOk = 0 + foreach($App in $Apps) { if ($App.Status -ne "Ok") { $numNonOk++ } } + if ($numNonOk -gt 0) { $statusIcon = "⚠️"; $statusMsg += ", $numNonOk non-ok" } + + [int]$numErrors = (Get-AppxLastError) + if ($numErrors -gt 0) { $statusIcon = "⚠️"; $statusMsg += ", $numErrors errors" } - [int]$NumNonOk = 0 - foreach($App in $Apps) { if ($App.Status -ne "Ok") { $NumNonOk++ } } - if ($NumNonOk -gt 0) { $Status += ", $NumNonOk non-ok" } - [int]$NumErrors = (Get-AppxLastError) - if ($NumErrors -gt 0) { $Status += ", $NumErrors errors" } + $numUpdates = (winget upgrade --include-unknown).Count - 5 + $statusMsg += ", $numUpdates upgrades available" - $NumUpdates = (winget upgrade --include-unknown).Count - 5 - Write-Host "$NumUpdates upgrades available" + $crashDumps = GetCrashDumps + if ($crashDumps -ne 0) { $statusIcon = "⚠️"; $statusMsg += ", $crashDumps crash dumps found" } } + Write-Host "$statusIcon $statusMsg" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-apps.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-apps.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-bios.md b/docs/check-bios.md index 7d920b75a..28cde924e 100644 --- a/docs/check-bios.md +++ b/docs/check-bios.md @@ -76,4 +76,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-bios.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-bios.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-cpu.md b/docs/check-cpu.md index fbb8ebe45..d657ae147 100644 --- a/docs/check-cpu.md +++ b/docs/check-cpu.md @@ -101,4 +101,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-cpu.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-cpu.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-credentials.md b/docs/check-credentials.md index d3ce3e639..72ad9a6f5 100644 --- a/docs/check-credentials.md +++ b/docs/check-credentials.md @@ -82,4 +82,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-credentials.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-credentials.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-day.md b/docs/check-day.md index d6bfb9097..03daa1072 100644 --- a/docs/check-day.md +++ b/docs/check-day.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-day.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-day.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-dns.md b/docs/check-dns.md index 1a9d92de0..5d4330200 100644 --- a/docs/check-dns.md +++ b/docs/check-dns.md @@ -73,4 +73,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-dns.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-dns.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-drive-space.md b/docs/check-drive-space.md index d02b894cf..7103614bb 100644 --- a/docs/check-drive-space.md +++ b/docs/check-drive-space.md @@ -110,4 +110,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-drive-space.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-drive-space.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-drives.md b/docs/check-drives.md index 2351be170..abfb9c10a 100644 --- a/docs/check-drives.md +++ b/docs/check-drives.md @@ -100,4 +100,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-drives.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-drives.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-dusk.md b/docs/check-dusk.md index f9c3449e0..d57eb6399 100644 --- a/docs/check-dusk.md +++ b/docs/check-dusk.md @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-dusk.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-dusk.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-easter-sunday.md b/docs/check-easter-sunday.md index bb5e4683e..3c1839a27 100644 --- a/docs/check-easter-sunday.md +++ b/docs/check-easter-sunday.md @@ -61,4 +61,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-easter-sunday.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-easter-sunday.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-file-system.md b/docs/check-file-system.md index a7d416235..6259b2b42 100644 --- a/docs/check-file-system.md +++ b/docs/check-file-system.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-file-system.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-file-system.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-file.md b/docs/check-file.md index 99ccab63e..162b782af 100644 --- a/docs/check-file.md +++ b/docs/check-file.md @@ -170,4 +170,4 @@ function Check-Header { param( $path ) Check-Header $Path ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-file.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-file.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-firewall.md b/docs/check-firewall.md index 5b300d12b..8c1fe62b5 100644 --- a/docs/check-firewall.md +++ b/docs/check-firewall.md @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-firewall.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-firewall.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-gpu.md b/docs/check-gpu.md index 69d84897a..fc47810e9 100644 --- a/docs/check-gpu.md +++ b/docs/check-gpu.md @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-gpu.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-gpu.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-hardware.md b/docs/check-hardware.md index d4a98b8a7..797330b2b 100644 --- a/docs/check-hardware.md +++ b/docs/check-hardware.md @@ -52,8 +52,7 @@ Script Content Author: Markus Fleschutz | License: CC0 #> -" " -& "$PSScriptRoot/write-green.ps1" " H A R D W A R E" +Write-Host "`n H A R D W A R E" -foregroundColor green & "$PSScriptRoot/check-cpu.ps1" & "$PSScriptRoot/check-ram.ps1" & "$PSScriptRoot/check-gpu.ps1" @@ -64,4 +63,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-hardware.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-hardware.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-health.md b/docs/check-health.md index 90ca2dc42..7578aae50 100644 --- a/docs/check-health.md +++ b/docs/check-health.md @@ -58,4 +58,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-health.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-health.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-independence-day.md b/docs/check-independence-day.md index 2f802f66c..818b1a8cc 100644 --- a/docs/check-independence-day.md +++ b/docs/check-independence-day.md @@ -61,4 +61,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-independence-day.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-independence-day.ps1 as of 05/19/2024 10:25:17)* diff --git a/docs/check-ipv4-address.md b/docs/check-ipv4-address.md index d6d38e9d7..0c2d472ff 100644 --- a/docs/check-ipv4-address.md +++ b/docs/check-ipv4-address.md @@ -84,4 +84,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-ipv4-address.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-ipv4-address.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-ipv6-address.md b/docs/check-ipv6-address.md index 1aa8047f1..8af7df4e2 100644 --- a/docs/check-ipv6-address.md +++ b/docs/check-ipv6-address.md @@ -98,4 +98,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-ipv6-address.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-ipv6-address.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-iss-position.md b/docs/check-iss-position.md index 5dcf07bce..0444df1e8 100644 --- a/docs/check-iss-position.md +++ b/docs/check-iss-position.md @@ -55,4 +55,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-iss-position.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-iss-position.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-mac-address.md b/docs/check-mac-address.md index 3832b95a4..f70f049b5 100644 --- a/docs/check-mac-address.md +++ b/docs/check-mac-address.md @@ -87,4 +87,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-mac-address.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-mac-address.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-midnight.md b/docs/check-midnight.md index e34607de3..5ae38f31b 100644 --- a/docs/check-midnight.md +++ b/docs/check-midnight.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-midnight.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-midnight.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-month.md b/docs/check-month.md index 03cc621e1..9c5163985 100644 --- a/docs/check-month.md +++ b/docs/check-month.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-month.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-month.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-moon-phase.md b/docs/check-moon-phase.md index 039471c9d..e5273d144 100644 --- a/docs/check-moon-phase.md +++ b/docs/check-moon-phase.md @@ -76,4 +76,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-moon-phase.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-moon-phase.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-network.md b/docs/check-network.md index 843eeea61..cfb6c7264 100644 --- a/docs/check-network.md +++ b/docs/check-network.md @@ -54,8 +54,7 @@ Script Content Author: Markus Fleschutz | License: CC0 #> -" " -& "$PSScriptRoot/write-green.ps1" " N E T W O R K" +Write-Host "`n N E T W O R K" -foregroundColor green & "$PSScriptRoot/ping-remote-hosts.ps1" & "$PSScriptRoot/check-firewall" & "$PSScriptRoot/check-dns.ps1" @@ -65,4 +64,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-network.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-network.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-noon.md b/docs/check-noon.md index 858b893df..c27c8977c 100644 --- a/docs/check-noon.md +++ b/docs/check-noon.md @@ -59,4 +59,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-noon.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-noon.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-os.md b/docs/check-os.md index ddfc4bdb8..8d0bdfcde 100644 --- a/docs/check-os.md +++ b/docs/check-os.md @@ -73,4 +73,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-os.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-os.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-outlook.md b/docs/check-outlook.md index 6acb990c2..ec33a59f5 100644 --- a/docs/check-outlook.md +++ b/docs/check-outlook.md @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-outlook.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-outlook.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-password.md b/docs/check-password.md index 3aed80bca..25ddbc3de 100644 --- a/docs/check-password.md +++ b/docs/check-password.md @@ -94,4 +94,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-password.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-password.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-pending-reboot.md b/docs/check-pending-reboot.md index 10bd61533..a341134b7 100644 --- a/docs/check-pending-reboot.md +++ b/docs/check-pending-reboot.md @@ -24,7 +24,7 @@ Script Content This PowerShell script queries pending operating system reboots and prints it. .EXAMPLE ./check-pending-reboot.ps1 - βœ… No pending system reboot + βœ… No pending reboot .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -79,11 +79,11 @@ try { $Reason += ", '...\CurrentControlSet\Services\Netlogon' with 'AvoidSpnSet'" } if ($Reason -ne "") { - Write-Host "⚠️ Pending reboot (registry contains $($Reason.substring(2)))" + Write-Host "⚠️ Pending reboot (registry got $($Reason.substring(2)))" } } if ($Reason -eq "") { - Write-Host "βœ… No pending system reboot" + Write-Host "βœ… No pending reboot" } exit 0 # success } catch { @@ -92,4 +92,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-pending-reboot.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-pending-reboot.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-power.md b/docs/check-power.md index 94f3005f1..0d182dac9 100644 --- a/docs/check-power.md +++ b/docs/check-power.md @@ -92,4 +92,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-power.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-power.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-powershell.md b/docs/check-powershell.md index bba3cc095..ad28ba580 100644 --- a/docs/check-powershell.md +++ b/docs/check-powershell.md @@ -59,4 +59,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-powershell.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-powershell.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-ps1-file.md b/docs/check-ps1-file.md index bf2a6a7f0..ffedb6820 100644 --- a/docs/check-ps1-file.md +++ b/docs/check-ps1-file.md @@ -76,4 +76,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-ps1-file.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-ps1-file.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-ram.md b/docs/check-ram.md index 4b4426580..40c0e37cc 100644 --- a/docs/check-ram.md +++ b/docs/check-ram.md @@ -98,4 +98,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-ram.ps1 as of 03/27/2024 17:36:24)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-ram.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-repo.md b/docs/check-repo.md index 2f90de46a..b2dca9266 100644 --- a/docs/check-repo.md +++ b/docs/check-repo.md @@ -1,15 +1,15 @@ Script: *check-repo.ps1* ======================== -This PowerShell script verifies the integrity of a local Git repository. +This PowerShell script verifies the integrity of a local Git repository and performs maintenance tasks. Parameters ---------- ```powershell -PS> ./check-repo.ps1 [[-RepoDir] ] [] +PS> ./check-repo.ps1 [[-pathToRepo] ] [] --RepoDir - Specifies the path to the Git repository (current working directory by default) +-pathToRepo + Specifies the file path to the local Git repository (current working directory by default) Required? false Position? 1 @@ -27,11 +27,11 @@ Example ```powershell PS> ./check-repo.ps1 C:\MyRepo ⏳ (1/10) Searching for Git executable... git version 2.41.0.windows.3 -⏳ (2/10) Checking local folder... πŸ“‚C:\MyRepo +⏳ (2/10) Checking local repository... πŸ“‚C:\MyRepo ⏳ (3/10) Querying remote URL... git@github.com:fleschutz/PowerShell.git ⏳ (4/10) Querying current branch... main -⏳ (5/10) Fetching remote updates... -⏳ (6/10) Querying latest tag... v0.8 (commit 02171a401d83b01a0cda0af426840b605e617f08) +⏳ (5/10) Fetching remote updates... OK +⏳ (6/10) Querying latest tag... v0.8 (at commit 02171a401d83b01a0cda0af426840b605e617f08) ⏳ (7/10) Verifying data integrity... ... @@ -50,19 +50,19 @@ Script Content ```powershell <# .SYNOPSIS - Checks a repo + 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 directory by default) + This PowerShell script verifies the integrity of a local Git repository and performs maintenance tasks. +.PARAMETER pathToRepo + Specifies the file path to the local Git repository (current working directory by default) .EXAMPLE PS> ./check-repo.ps1 C:\MyRepo ⏳ (1/10) Searching for Git executable... git version 2.41.0.windows.3 - ⏳ (2/10) Checking local folder... πŸ“‚C:\MyRepo + ⏳ (2/10) Checking local repository... πŸ“‚C:\MyRepo ⏳ (3/10) Querying remote URL... git@github.com:fleschutz/PowerShell.git ⏳ (4/10) Querying current branch... main - ⏳ (5/10) Fetching remote updates... - ⏳ (6/10) Querying latest tag... v0.8 (commit 02171a401d83b01a0cda0af426840b605e617f08) + ⏳ (5/10) Fetching remote updates... OK + ⏳ (6/10) Querying latest tag... v0.8 (at commit 02171a401d83b01a0cda0af426840b605e617f08) ⏳ (7/10) Verifying data integrity... ... .LINK @@ -71,17 +71,17 @@ Script Content Author: Markus Fleschutz | License: CC0 #> -param([string]$RepoDir = "$PWD") +param([string]$pathToRepo = "$PWD") try { - $StopWatch = [system.diagnostics.stopwatch]::startNew() + $stopWatch = [system.diagnostics.stopwatch]::startNew() Write-Host "⏳ (1/10) 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/10) Checking local folder... " -noNewline - $FullPath = Resolve-Path "$RepoDir" + Write-Host "⏳ (2/10) Checking local repository... " -noNewline + $FullPath = Resolve-Path "$pathToRepo" if (!(Test-Path "$FullPath" -pathType Container)) { throw "Can't access folder: $FullPath" } "πŸ“‚$FullPath" @@ -93,14 +93,15 @@ try { & git -C "$FullPath" branch --show-current if ($lastExitCode -ne "0") { throw "'git branch --show-current' failed with exit code $lastExitCode" } - Write-Host "⏳ (5/10) Fetching remote updates..." - & git -C "$FullPath" fetch + Write-Host "⏳ (5/10) Fetching remote updates... " -noNewline + & git -C "$FullPath" fetch --all --recurse-submodules --tags --force --quiet if ($lastExitCode -ne "0") { throw "'git fetch' failed with exit code $lastExitCode" } + Write-Host "OK" Write-Host "⏳ (6/10) Querying 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)" + $latestTagCommitID = (git -C "$FullPath" rev-list --tags --max-count=1) + $latestTagName = (git -C "$FullPath" describe --tags $latestTagCommitID) + Write-Host "$latestTagName (at commit $latestTagCommitID)" Write-Host "⏳ (7/10) Verifying data integrity..." & git -C "$FullPath" fsck @@ -118,9 +119,9 @@ try { & git -C "$FullPath" status if ($lastExitCode -ne "0") { throw "'git status --short' failed with exit code $lastExitCode" } - $RepoDirName = (Get-Item "$FullPath").Name - [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ Checked repo πŸ“‚$RepoDirName in $Elapsed sec" + $repoDirName = (Get-Item "$FullPath").Name + [int]$elapsed = $stopWatch.Elapsed.TotalSeconds + "βœ”οΈ Checked repo πŸ“‚$repoDirName in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -128,4 +129,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-repo.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-repo.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-repos.md b/docs/check-repos.md index 8bb446159..ec1eb3c70 100644 --- a/docs/check-repos.md +++ b/docs/check-repos.md @@ -1,7 +1,7 @@ Script: *check-repos.ps1* ======================== -This PowerShell script checks all Git repositories in a folder. +This PowerShell script verifies the data integrity of all Git repositories in a folder. Parameters ---------- @@ -9,7 +9,7 @@ Parameters PS> ./check-repos.ps1 [[-parentDir] ] [] -parentDir - Specifies the path to the parent folder + Specifies the file path to the parent folder Required? false Position? 1 @@ -25,7 +25,11 @@ PS> ./check-repos.ps1 [[-parentDir] ] [] Example ------- ```powershell -PS> ./check-repos.ps1 C:\MyRepos +PS> ./check-repos.ps1 C:\Repos +⏳ Checking parent folder πŸ“‚C:\Repos... 16 subfolders +⏳ Checking πŸ“‚rust repository (1/16)... +... +βœ”οΈ Checked all 16 Git repos in πŸ“‚C:\Repos in 356s. ``` @@ -44,11 +48,15 @@ Script Content .SYNOPSIS Checks Git repositories .DESCRIPTION - This PowerShell script checks all Git repositories in a folder. + This PowerShell script verifies the data integrity of all Git repositories in a folder. .PARAMETER parentDir - Specifies the path to the parent folder + Specifies the file path to the parent folder .EXAMPLE - PS> ./check-repos.ps1 C:\MyRepos + PS> ./check-repos.ps1 C:\Repos + ⏳ Checking parent folder πŸ“‚C:\Repos... 16 subfolders + ⏳ Checking πŸ“‚rust repository (1/16)... + ... + βœ”οΈ Checked all 16 Git repos in πŸ“‚C:\Repos in 356s. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -61,20 +69,21 @@ try { $stopWatch = [system.diagnostics.stopwatch]::startNew() $parentDirName = (Get-Item "$parentDir").Name - "⏳ Step 1 - Checking parent folder πŸ“‚$parentDirName..." + Write-Host "⏳ Checking parent folder πŸ“‚$parentDir... " -noNewline if (-not(Test-Path "$parentDir" -pathType container)) { throw "Can't access folder: $parentDir" } $folders = (Get-ChildItem "$parentDir" -attributes Directory) $numFolders = $folders.Count - "Found $numFolders subfolders." + "$numFolders subfolders" - [int]$Step = 1 + [int]$step = 1 foreach ($folder in $folders) { + "`n⏳ Checking πŸ“‚$folder repository ($step/$numFolders)..." & "$PSScriptRoot/check-repo.ps1" "$folder" - $Step++ + $step++ } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Checked $numFolders Git repos at πŸ“‚$parentDirName in $elapsed sec" + "βœ”οΈ Checked all $numFolders Git repos in πŸ“‚$parentDir in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -82,4 +91,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-repos.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-repos.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-santa.md b/docs/check-santa.md index aa6e615ca..66e16395d 100644 --- a/docs/check-santa.md +++ b/docs/check-santa.md @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-santa.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-santa.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-smart-devices.md b/docs/check-smart-devices.md index e235787d5..dfb10a6bc 100644 --- a/docs/check-smart-devices.md +++ b/docs/check-smart-devices.md @@ -24,70 +24,91 @@ Script Content This PowerShell script queries the status of the SSD/HDD devices (supporting S.M.A.R.T.) and prints it. .EXAMPLE PS> ./check-smart-devices.ps1 - βœ… 1TB Samsung SSD 970 EVO via NVMe (2388 hours, 289x on, v2B2QEXE7, 37Β°C, selftest passed) + βœ… 1TB Samsung SSD 970 EVO via NVMe (37Β°C, 2388 hours, 289x on/off, 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" } +function Bytes2String([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 "(1/3) Searching for smartmontools..." - $Result = (smartctl --version) + $result = (smartctl --version) if ($lastExitCode -ne "0") { throw "Can't execute 'smartctl' - make sure smartmontools are installed" } Write-Progress "(2/3) Scanning S.M.A.R.T devices..." if ($IsLinux) { - $Devices = $(sudo smartctl --scan-open) + $devices = $(sudo smartctl --scan-open) } else { - $Devices = $(smartctl --scan-open) + $devices = $(smartctl --scan-open) } - foreach($Device in $Devices) { - Write-Progress "(3/3) Querying S.M.A.R.T devices..." - $Array = $Device.split(" ") - $Device = $Array[0] - if ("$Device" -eq "#") { + Write-Progress "(3/3) Querying S.M.A.R.T devices..." + foreach($device in $devices) { + $array = $device.split(" ") + $dev = $array[0] + if ("$dev" -eq "#") { continue } elseif ($IsLinux) { - $Details = (sudo smartctl --all --json $Device) | ConvertFrom-Json - $null = (sudo smartctl --test=short $Device) + $details = (sudo smartctl --all --json $dev) | ConvertFrom-Json + $null = (sudo smartctl --test=conveyance $dev) } else { - $Details = (smartctl --all --json $Device) | ConvertFrom-Json - $null = (smartctl --test=short $Device) + $details = (smartctl --all --json $dev) | ConvertFrom-Json + $null = (smartctl --test=conveyance $dev) } - $ModelName = $Details.model_name - $Protocol = $Details.device.protocol - [int64]$GBytes = $Details.user_capacity.bytes - if ($GBytes -gt 0) { - $Capacity = "$(Bytes2String $GBytes) " + $status = "βœ…" + $modelName = $details.model_name + $protocol = $details.device.protocol + [int64]$bytes = $details.user_capacity.bytes + if ($bytes -gt 0) { + $capacity = "$(Bytes2String $bytes) " } else { - $Capacity = "" + $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" } - Write-Progress -completed " " - Write-Host "βœ… $($Capacity)$ModelName via $Protocol ($Hours hours, $($PowerOn)x on, v$($Firmware), $($Temp)Β°C, selftest $Status)" + if ($details.temperature.current -gt 50) { + $temp = "$($details.temperature.current)Β°C (!)" + $status = "⚠️" + } else { + $temp = "$($details.temperature.current)Β°C" + } + if ($details.power_on_time.hours -gt 87600) { # 10 years + $hours = "$($details.power_on_time.hours) hours (!)" + $status = "⚠️" + } else { + $hours = "$($details.power_on_time.hours) hours" + } + if ($details.power_cycle_count -gt 100000) { + $powerOn = "$($details.power_cycle_count)x on/off (!)" + $status = "⚠️" + } else { + $powerOn = "$($details.power_cycle_count)x on/off" + } + if ($details.smart_status.passed) { + $selftest = "selftest passed" + } else { + $selftest = "selftest FAILED" + $status = "⚠️" + } + $firmwareVersion = $details.firmware_version + Write-Host "$status $capacity$modelName via $protocol ($temp, $hours, $powerOn, $selftest, v$firmwareVersion)" } + Write-Progress -completed " " exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -95,4 +116,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-smart-devices.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-smart-devices.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-software.md b/docs/check-software.md index 9a9beab63..41680c034 100644 --- a/docs/check-software.md +++ b/docs/check-software.md @@ -54,8 +54,7 @@ Script Content Author: Markus Fleschutz | License: CC0 #> -" " -& "$PSScriptRoot/write-green.ps1" " S O F T W A R E" +Write-Host "`n S O F T W A R E" -foregroundColor green & "$PSScriptRoot/check-os.ps1" & "$PSScriptRoot/check-uptime.ps1" & "$PSScriptRoot/check-apps.ps1" @@ -66,4 +65,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-software.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-software.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-subnet-mask.md b/docs/check-subnet-mask.md index 78f977f9f..d06b4464e 100644 --- a/docs/check-subnet-mask.md +++ b/docs/check-subnet-mask.md @@ -84,4 +84,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-subnet-mask.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-subnet-mask.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-swap-space.md b/docs/check-swap-space.md index 9175f2679..b1468b52d 100644 --- a/docs/check-swap-space.md +++ b/docs/check-swap-space.md @@ -95,7 +95,7 @@ try { } elseif ($free -lt $minLevel) { Write-Output "⚠️ Swap space has only $(MB2String $free) of $(MB2String $total) free" } elseif ($used -lt 5) { - Write-Output "βœ… Swap space has the full $(MB2String $free) free" + Write-Output "βœ… Swap space has all $(MB2String $free) free" } else { [int64]$percent = ($used * 100) / $total Write-Output "βœ… Swap space has $(MB2String $free) free ($percent% of $(MB2String $total) used)" @@ -107,4 +107,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-swap-space.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-swap-space.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-symlinks.md b/docs/check-symlinks.md index b5e240959..f79ab220b 100644 --- a/docs/check-symlinks.md +++ b/docs/check-symlinks.md @@ -100,4 +100,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-symlinks.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-symlinks.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-time-zone.md b/docs/check-time-zone.md index e64a403dd..12cea36a6 100644 --- a/docs/check-time-zone.md +++ b/docs/check-time-zone.md @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-time-zone.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-time-zone.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-uptime.md b/docs/check-uptime.md index 3c9b453bc..df672fab1 100644 --- a/docs/check-uptime.md +++ b/docs/check-uptime.md @@ -61,4 +61,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-uptime.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-uptime.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-vpn.md b/docs/check-vpn.md index aa29d6656..646ec37b6 100644 --- a/docs/check-vpn.md +++ b/docs/check-vpn.md @@ -51,9 +51,9 @@ try { if ($IsLinux) { # TODO } else { - $Connections = Get-VPNConnection - foreach($Connection in $Connections) { - Write-Host "βœ… VPN to $($Connection.Name) is $($Connection.ConnectionStatus.ToLower())" + $connections = Get-VPNConnection + foreach($connection in $connections) { + Write-Host "βœ… VPN to $($connection.Name) is $($connection.ConnectionStatus.ToLower())" $noVPN = $false } } @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-vpn.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-vpn.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-weather.md b/docs/check-weather.md index f0dd2c0ca..4e213a6a0 100644 --- a/docs/check-weather.md +++ b/docs/check-weather.md @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-weather.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-weather.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-week.md b/docs/check-week.md index 0ebf56e61..b4c67a9e4 100644 --- a/docs/check-week.md +++ b/docs/check-week.md @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-week.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-week.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-wind.md b/docs/check-wind.md index 727e2e715..839ea8f9c 100644 --- a/docs/check-wind.md +++ b/docs/check-wind.md @@ -72,4 +72,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-wind.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-wind.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-windows-system-files.md b/docs/check-windows-system-files.md index 2487505cf..24294fadd 100644 --- a/docs/check-windows-system-files.md +++ b/docs/check-windows-system-files.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-windows-system-files.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-windows-system-files.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-xml-file.md b/docs/check-xml-file.md index d91fb7931..dd40bfae5 100644 --- a/docs/check-xml-file.md +++ b/docs/check-xml-file.md @@ -85,4 +85,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-xml-file.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-xml-file.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/check-xml-files.md b/docs/check-xml-files.md index 6a66a3347..6d7246fa3 100644 --- a/docs/check-xml-files.md +++ b/docs/check-xml-files.md @@ -83,4 +83,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of check-xml-files.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of check-xml-files.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/clean-repo.md b/docs/clean-repo.md index d6c6be771..21d76fdbd 100644 --- a/docs/clean-repo.md +++ b/docs/clean-repo.md @@ -31,7 +31,7 @@ PS> ./clean-repo.ps1 C:\rust ⏳ (2/4) Checking local repository... πŸ“‚C:\rust ⏳ (3/4) Removing untracked files in repository... ⏳ (4/4) Removing untracked files in submodules... -βœ”οΈ Cleaned up πŸ“‚rust repository in 1 sec. +βœ”οΈ Repo πŸ“‚rust is clean now (took 1s). ``` @@ -60,7 +60,7 @@ Script Content ⏳ (2/4) Checking local repository... πŸ“‚C:\rust ⏳ (3/4) Removing untracked files in repository... ⏳ (4/4) Removing untracked files in submodules... - βœ”οΈ Cleaned up πŸ“‚rust repository in 1 sec. + βœ”οΈ Repo πŸ“‚rust is clean now (took 1s). .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -93,7 +93,7 @@ try { if ($lastExitCode -ne "0") { throw "'git clean' in the submodules failed with exit code $lastExitCode" } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Cleaned up πŸ“‚$repoName repository in $elapsed sec." + "βœ”οΈ Repo πŸ“‚$repoName is clean now (took $($elapsed)s)." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -101,4 +101,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of clean-repo.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of clean-repo.ps1 as of 05/19/2024 10:25:18)* diff --git a/docs/clean-repos.md b/docs/clean-repos.md index 45e142844..40d70c569 100644 --- a/docs/clean-repos.md +++ b/docs/clean-repos.md @@ -100,4 +100,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of clean-repos.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of clean-repos.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/clear-dns-cache.md b/docs/clear-dns-cache.md index 4f64d5518..d9ad01d08 100644 --- a/docs/clear-dns-cache.md +++ b/docs/clear-dns-cache.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of clear-dns-cache.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of clear-dns-cache.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/clear-recycle-bin.md b/docs/clear-recycle-bin.md index c482b49bf..bf6e73b84 100644 --- a/docs/clear-recycle-bin.md +++ b/docs/clear-recycle-bin.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of clear-recycle-bin.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of clear-recycle-bin.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/clone-repos.md b/docs/clone-repos.md index 6e50a632c..c278736eb 100644 --- a/docs/clone-repos.md +++ b/docs/clone-repos.md @@ -112,4 +112,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of clone-repos.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of clone-repos.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-calculator.md b/docs/close-calculator.md index 166993e0d..c87ab72da 100644 --- a/docs/close-calculator.md +++ b/docs/close-calculator.md @@ -48,4 +48,4 @@ Stop-Process -name "CalculatorApp" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-calculator.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-calculator.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-chrome.md b/docs/close-chrome.md index 42f5f8b69..aed900ef4 100644 --- a/docs/close-chrome.md +++ b/docs/close-chrome.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-chrome.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-chrome.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-cortana.md b/docs/close-cortana.md index 96b569497..2b61f3a92 100644 --- a/docs/close-cortana.md +++ b/docs/close-cortana.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-cortana.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-cortana.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-edge.md b/docs/close-edge.md index d44971232..28471c638 100644 --- a/docs/close-edge.md +++ b/docs/close-edge.md @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-edge.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-edge.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-file-explorer.md b/docs/close-file-explorer.md index f7b3e0f3c..58ef4a9cd 100644 --- a/docs/close-file-explorer.md +++ b/docs/close-file-explorer.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-file-explorer.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-file-explorer.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-firefox.md b/docs/close-firefox.md index 149bd7319..224a26187 100644 --- a/docs/close-firefox.md +++ b/docs/close-firefox.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-firefox.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-firefox.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-git-extensions.md b/docs/close-git-extensions.md index e5dba4b12..9916c5c97 100644 --- a/docs/close-git-extensions.md +++ b/docs/close-git-extensions.md @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-git-extensions.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-git-extensions.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-magnifier.md b/docs/close-magnifier.md index cef6ae262..e6dc34135 100644 --- a/docs/close-magnifier.md +++ b/docs/close-magnifier.md @@ -48,4 +48,4 @@ tskill magnify exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-magnifier.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-magnifier.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-microsoft-paint.md b/docs/close-microsoft-paint.md index 7e9f32a53..c35e8f719 100644 --- a/docs/close-microsoft-paint.md +++ b/docs/close-microsoft-paint.md @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-microsoft-paint.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-microsoft-paint.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-microsoft-store.md b/docs/close-microsoft-store.md index b4510f842..ce53dfc4a 100644 --- a/docs/close-microsoft-store.md +++ b/docs/close-microsoft-store.md @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-microsoft-store.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-microsoft-store.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-netflix.md b/docs/close-netflix.md index 7fef51612..2df67f280 100644 --- a/docs/close-netflix.md +++ b/docs/close-netflix.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-netflix.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-netflix.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-note-pad.md b/docs/close-note-pad.md index 6b4b2373e..5cef4775f 100644 --- a/docs/close-note-pad.md +++ b/docs/close-note-pad.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-note-pad.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-note-pad.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-obs-studio.md b/docs/close-obs-studio.md index 61efb2088..69904747c 100644 --- a/docs/close-obs-studio.md +++ b/docs/close-obs-studio.md @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-obs-studio.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-obs-studio.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-one-calendar.md b/docs/close-one-calendar.md index 906ed67af..ea5a69de3 100644 --- a/docs/close-one-calendar.md +++ b/docs/close-one-calendar.md @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-one-calendar.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-one-calendar.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-outlook.md b/docs/close-outlook.md index 014bbf3b6..631925f1a 100644 --- a/docs/close-outlook.md +++ b/docs/close-outlook.md @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-outlook.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-outlook.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-paint-three-d.md b/docs/close-paint-three-d.md index c5870cb35..9724f820c 100644 --- a/docs/close-paint-three-d.md +++ b/docs/close-paint-three-d.md @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-paint-three-d.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-paint-three-d.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-program.md b/docs/close-program.md index 117c80795..0dd7cbf90 100644 --- a/docs/close-program.md +++ b/docs/close-program.md @@ -118,4 +118,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-program.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-program.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-serenade.md b/docs/close-serenade.md index ff53f5ef8..42a03eb74 100644 --- a/docs/close-serenade.md +++ b/docs/close-serenade.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-serenade.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-serenade.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-snipping-tool.md b/docs/close-snipping-tool.md index 5edb33538..f2e50753d 100644 --- a/docs/close-snipping-tool.md +++ b/docs/close-snipping-tool.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-snipping-tool.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-snipping-tool.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-spotify.md b/docs/close-spotify.md index 0a215976e..10038566e 100644 --- a/docs/close-spotify.md +++ b/docs/close-spotify.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-spotify.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-spotify.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-task-manager.md b/docs/close-task-manager.md index aecf73edb..cb09f6c6e 100644 --- a/docs/close-task-manager.md +++ b/docs/close-task-manager.md @@ -48,4 +48,4 @@ tskill taskmgr exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-task-manager.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-task-manager.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-three-d-viewer.md b/docs/close-three-d-viewer.md index 12609dd5c..c39ec2332 100644 --- a/docs/close-three-d-viewer.md +++ b/docs/close-three-d-viewer.md @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-three-d-viewer.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-three-d-viewer.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-thunderbird.md b/docs/close-thunderbird.md index 5114d52ba..e8eaaeb7a 100644 --- a/docs/close-thunderbird.md +++ b/docs/close-thunderbird.md @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-thunderbird.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-thunderbird.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-visual-studio.md b/docs/close-visual-studio.md index 15bb792f0..9f0e061ad 100644 --- a/docs/close-visual-studio.md +++ b/docs/close-visual-studio.md @@ -52,4 +52,4 @@ if ($lastExitCode -ne "0") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-visual-studio.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-visual-studio.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-vlc.md b/docs/close-vlc.md index cfad5a823..b5bf2b394 100644 --- a/docs/close-vlc.md +++ b/docs/close-vlc.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-vlc.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-vlc.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/close-windows-terminal.md b/docs/close-windows-terminal.md index 8247c044c..3edcea510 100644 --- a/docs/close-windows-terminal.md +++ b/docs/close-windows-terminal.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of close-windows-terminal.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of close-windows-terminal.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/configure-git.md b/docs/configure-git.md index 366e36d79..7cf76c3ee 100644 --- a/docs/configure-git.md +++ b/docs/configure-git.md @@ -144,4 +144,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of configure-git.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of configure-git.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/connect-vpn.md b/docs/connect-vpn.md index 1a2780ce3..0af9198ca 100644 --- a/docs/connect-vpn.md +++ b/docs/connect-vpn.md @@ -62,4 +62,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of connect-vpn.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of connect-vpn.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/convert-csv2txt.md b/docs/convert-csv2txt.md index d6b79a1c9..a2e53e6e9 100644 --- a/docs/convert-csv2txt.md +++ b/docs/convert-csv2txt.md @@ -72,4 +72,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-csv2txt.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-csv2txt.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/convert-docx2md.md b/docs/convert-docx2md.md index ce4775432..71b50a681 100644 --- a/docs/convert-docx2md.md +++ b/docs/convert-docx2md.md @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-docx2md.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-docx2md.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/convert-frames2mp4.md b/docs/convert-frames2mp4.md index ae0e3852d..bc90cd5c4 100644 --- a/docs/convert-frames2mp4.md +++ b/docs/convert-frames2mp4.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-frames2mp4.ps1 as of 03/27/2024 17:36:25)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-frames2mp4.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/convert-image2ascii.md b/docs/convert-image2ascii.md index 9d563e79b..b8f1892f5 100644 --- a/docs/convert-image2ascii.md +++ b/docs/convert-image2ascii.md @@ -114,4 +114,4 @@ Script Content } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-image2ascii.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-image2ascii.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/convert-image2blurred-frames.md b/docs/convert-image2blurred-frames.md index ef12c9964..9eb240ebd 100644 --- a/docs/convert-image2blurred-frames.md +++ b/docs/convert-image2blurred-frames.md @@ -70,4 +70,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-image2blurred-frames.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-image2blurred-frames.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/convert-image2pixelated-frames.md b/docs/convert-image2pixelated-frames.md index e97c2f514..0da17dcb9 100644 --- a/docs/convert-image2pixelated-frames.md +++ b/docs/convert-image2pixelated-frames.md @@ -70,4 +70,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-image2pixelated-frames.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-image2pixelated-frames.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/convert-md2docx.md b/docs/convert-md2docx.md index edc54adf1..7fb92c95b 100644 --- a/docs/convert-md2docx.md +++ b/docs/convert-md2docx.md @@ -22,4 +22,4 @@ Script Content gci -r -i *.md |foreach{$docx=$_.directoryname+"\"+$_.basename+".docx";pandoc -f markdown -s --citeproc $_.name -o $docx} ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-md2docx.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-md2docx.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/convert-md2html.md b/docs/convert-md2html.md index df3453481..84e5f4d2a 100644 --- a/docs/convert-md2html.md +++ b/docs/convert-md2html.md @@ -80,4 +80,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-md2html.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-md2html.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/convert-md2pdf.md b/docs/convert-md2pdf.md index f2e29c2ad..27c7da224 100644 --- a/docs/convert-md2pdf.md +++ b/docs/convert-md2pdf.md @@ -20,4 +20,4 @@ Script Content gci -r -i *.md |foreach{$pdf=$_.directoryname+"\"+$_.basename+".pdf";pandoc -f markdown -s --citeproc $_.name -o $pdf} ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-md2pdf.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-md2pdf.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/convert-mysql2csv.md b/docs/convert-mysql2csv.md index 7ce119d67..293a23280 100644 --- a/docs/convert-mysql2csv.md +++ b/docs/convert-mysql2csv.md @@ -119,4 +119,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-mysql2csv.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-mysql2csv.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/convert-ps2bat.md b/docs/convert-ps2bat.md index c7cf22c54..1b8b503e1 100644 --- a/docs/convert-ps2bat.md +++ b/docs/convert-ps2bat.md @@ -89,4 +89,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-ps2bat.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-ps2bat.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/convert-ps2md.md b/docs/convert-ps2md.md index a7634235e..1382f3f18 100644 --- a/docs/convert-ps2md.md +++ b/docs/convert-ps2md.md @@ -185,4 +185,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-ps2md.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-ps2md.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/convert-sql2csv.md b/docs/convert-sql2csv.md index db8a4bc05..5da397c01 100644 --- a/docs/convert-sql2csv.md +++ b/docs/convert-sql2csv.md @@ -120,4 +120,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-sql2csv.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-sql2csv.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/convert-txt2wav.md b/docs/convert-txt2wav.md index 22ed10ab6..53f789421 100644 --- a/docs/convert-txt2wav.md +++ b/docs/convert-txt2wav.md @@ -84,4 +84,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of convert-txt2wav.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of convert-txt2wav.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/copy-photos-sorted.md b/docs/copy-photos-sorted.md index 9ce3985da..875d136ad 100644 --- a/docs/copy-photos-sorted.md +++ b/docs/copy-photos-sorted.md @@ -111,4 +111,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of copy-photos-sorted.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of copy-photos-sorted.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/count-characters.md b/docs/count-characters.md new file mode 100644 index 000000000..d73ec9247 --- /dev/null +++ b/docs/count-characters.md @@ -0,0 +1,74 @@ +Script: *count-characters.ps1* +======================== + +This PowerShell script counts the number of characters in the given string. + +Parameters +---------- +```powershell +PS> ./count-characters.ps1 [[-givenString] ] [] + +-givenString + Specifies the given string. + + Required? false + Position? 1 + Default value + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./count-characters.ps1 "Hello World" +βœ”οΈ 11 characters counted in 'Hello World'. + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Counts the number of characters +.DESCRIPTION + This PowerShell script counts the number of characters in the given string. +.PARAMETER GivenString + Specifies the given string. +.EXAMPLE + PS> ./count-characters.ps1 "Hello World" + βœ”οΈ 11 characters counted in 'Hello World'. +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([string]$givenString = "") + +try { + if ($givenString -eq "" ) { $givenString = Read-Host "Enter the string" } + + [int64]$numChars = $givenString.Length + "βœ”οΈ $numChars characters counted in '$givenString'." + 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-characters.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/count-lines.md b/docs/count-lines.md new file mode 100644 index 000000000..220d790ef --- /dev/null +++ b/docs/count-lines.md @@ -0,0 +1,86 @@ +Script: *count-lines.ps1* +======================== + +This PowerShell script counts the number of lines in text files (.txt/.md/.c/.h/.cpp/.hpp/.java/.py/.ps1/.bat) within a directory tree. + +Parameters +---------- +```powershell +PS> ./count-lines.ps1 [[-pathToDirTree] ] [] + +-pathToDirTree + Specifies the path to the directory tree. + + Required? false + Position? 1 + Default value + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./count-lines.ps1 C:\Repos\cmake +βœ”οΈ Found 639921 lines in 11411 text files within πŸ“‚cmake in 34 sec. + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Counts the number of lines +.DESCRIPTION + This PowerShell script counts the number of lines in text files (.txt/.md/.c/.h/.cpp/.hpp/.java/.py/.ps1/.bat) within a directory tree. +.PARAMETER pathToDirTree + Specifies the path to the directory tree. +.EXAMPLE + PS> ./count-lines.ps1 C:\Repos\cmake + βœ”οΈ Found 639921 lines in 11411 text files within πŸ“‚cmake in 34 sec. +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([string]$pathToDirTree = "") + +try { + if ($pathToDirTree -eq "" ) { $pathToDirTree = Read-Host "Enter the path to the directory tree" } + + $stopWatch = [system.diagnostics.stopwatch]::startNew() + $pathToDirTree = Resolve-Path "$pathToDirTree" + Write-Progress "Counting lines within $pathToDirTree ..." + + [int64]$numFiles = [int64]$numLines = 0 + Get-ChildItem -Path $pathToDirTree -Include *.txt,*.md,*.c,*.h,*.cpp,*.hpp,*.java,*.py,*.ps1,*.bat -Recurse | ForEach-Object { + $numLines += (Get-Content $_.FullName | Measure-Object -line).Lines + $numFiles++ + } + + $folderName = (Get-Item "$pathToDirTree").Name + Write-Progress -completed " " + [int]$Elapsed = $stopWatch.Elapsed.TotalSeconds + "βœ”οΈ Found $numLines lines in $numFiles text files within πŸ“‚$folderName 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 count-lines.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/decrypt-file.md b/docs/decrypt-file.md index 0e90033df..3a980d9a5 100644 --- a/docs/decrypt-file.md +++ b/docs/decrypt-file.md @@ -197,4 +197,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of decrypt-file.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of decrypt-file.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/disable-ipv6.md b/docs/disable-ipv6.md index b8fcfa286..854482996 100644 --- a/docs/disable-ipv6.md +++ b/docs/disable-ipv6.md @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of disable-ipv6.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of disable-ipv6.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/disconnect-vpn.md b/docs/disconnect-vpn.md index b11e886c7..45bfc2b02 100644 --- a/docs/disconnect-vpn.md +++ b/docs/disconnect-vpn.md @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of disconnect-vpn.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of disconnect-vpn.ps1 as of 05/19/2024 10:25:19)* diff --git a/docs/download-dir.md b/docs/download-dir.md index 43921a95b..e502a9e0a 100644 --- a/docs/download-dir.md +++ b/docs/download-dir.md @@ -77,4 +77,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of download-dir.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of download-dir.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/download-file.md b/docs/download-file.md index 223ff9189..fb57c4d99 100644 --- a/docs/download-file.md +++ b/docs/download-file.md @@ -77,4 +77,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of download-file.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of download-file.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/edit.md b/docs/edit.md index 5cd2fdab9..8abef8f39 100644 --- a/docs/edit.md +++ b/docs/edit.md @@ -92,4 +92,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of edit.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of edit.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/enable-crash-dumps.md b/docs/enable-crash-dumps.md index b2f3776c6..2f3920fa9 100644 --- a/docs/enable-crash-dumps.md +++ b/docs/enable-crash-dumps.md @@ -330,4 +330,4 @@ Else exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of enable-crash-dumps.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of enable-crash-dumps.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/enable-god-mode.md b/docs/enable-god-mode.md index f22e5fb8c..1968e7936 100644 --- a/docs/enable-god-mode.md +++ b/docs/enable-god-mode.md @@ -61,4 +61,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of enable-god-mode.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of enable-god-mode.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/enable-ipv6.md b/docs/enable-ipv6.md index 4245e6f02..5fcfb0687 100644 --- a/docs/enable-ipv6.md +++ b/docs/enable-ipv6.md @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of enable-ipv6.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of enable-ipv6.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/encrypt-file.md b/docs/encrypt-file.md index 3da437415..243059055 100644 --- a/docs/encrypt-file.md +++ b/docs/encrypt-file.md @@ -182,4 +182,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of encrypt-file.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of encrypt-file.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/enter-chat.md b/docs/enter-chat.md index 4fd6f6925..923cab5b7 100644 --- a/docs/enter-chat.md +++ b/docs/enter-chat.md @@ -125,4 +125,4 @@ function Get-ChatChannel } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of enter-chat.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of enter-chat.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/export-to-manuals.md b/docs/export-to-manuals.md index 4109759e7..ced28305d 100644 --- a/docs/export-to-manuals.md +++ b/docs/export-to-manuals.md @@ -90,4 +90,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of export-to-manuals.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of export-to-manuals.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/fetch-repo.md b/docs/fetch-repo.md index b3ed1642a..fa6d4a2e1 100644 --- a/docs/fetch-repo.md +++ b/docs/fetch-repo.md @@ -89,4 +89,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of fetch-repo.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of fetch-repo.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/fetch-repos.md b/docs/fetch-repos.md index 04fd97471..e5e796e3c 100644 --- a/docs/fetch-repos.md +++ b/docs/fetch-repos.md @@ -98,4 +98,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of fetch-repos.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of fetch-repos.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/firefox-installer.md b/docs/firefox-installer.md index e345a01b1..a0f582f45 100644 --- a/docs/firefox-installer.md +++ b/docs/firefox-installer.md @@ -64,4 +64,4 @@ try { ``` -*(generated by convert-ps2md.ps1 using the comment-based help of firefox-installer.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of firefox-installer.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/get-md5.md b/docs/get-md5.md index e23697a5d..c22650188 100644 --- a/docs/get-md5.md +++ b/docs/get-md5.md @@ -72,4 +72,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of get-md5.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of get-md5.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/get-sha1.md b/docs/get-sha1.md index 7d420f8fa..200cfe47c 100644 --- a/docs/get-sha1.md +++ b/docs/get-sha1.md @@ -72,4 +72,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of get-sha1.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of get-sha1.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/get-sha256.md b/docs/get-sha256.md index 97263c14a..c10802f3e 100644 --- a/docs/get-sha256.md +++ b/docs/get-sha256.md @@ -72,4 +72,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of get-sha256.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of get-sha256.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/hibernate.md b/docs/hibernate.md index 7f112eb82..e2bdb6b12 100644 --- a/docs/hibernate.md +++ b/docs/hibernate.md @@ -59,4 +59,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of hibernate.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of hibernate.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/import-vm.md b/docs/import-vm.md index 0245a4a23..0d081b20f 100644 --- a/docs/import-vm.md +++ b/docs/import-vm.md @@ -23,4 +23,4 @@ Start-VM $VMName exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of import-vm.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of import-vm.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/inspect-exe.md b/docs/inspect-exe.md index 57ccf632c..0dff64b91 100644 --- a/docs/inspect-exe.md +++ b/docs/inspect-exe.md @@ -68,4 +68,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of inspect-exe.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of inspect-exe.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-audacity.md b/docs/install-audacity.md index dd38ce378..9839d821e 100644 --- a/docs/install-audacity.md +++ b/docs/install-audacity.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-audacity.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-audacity.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-basic-apps.md b/docs/install-basic-apps.md index e29c93089..d48c18682 100644 --- a/docs/install-basic-apps.md +++ b/docs/install-basic-apps.md @@ -93,4 +93,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-basic-apps.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-basic-apps.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-basic-snaps.md b/docs/install-basic-snaps.md index bcc49fc6d..b09bc5408 100644 --- a/docs/install-basic-snaps.md +++ b/docs/install-basic-snaps.md @@ -78,4 +78,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-basic-snaps.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-basic-snaps.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-calibre-server.md b/docs/install-calibre-server.md index a25a90cc7..5b626097f 100644 --- a/docs/install-calibre-server.md +++ b/docs/install-calibre-server.md @@ -88,37 +88,35 @@ Script Content param([int]$port = 8099, [string]$mediaFolder = "$HOME/Calibre Library", [string]$userDB = "$HOME/CalibreUsers.sqlite", [string]$logfile = "$HOME/CalibreServer.log") try { - if ($IsLinux) { - $stopWatch = [system.diagnostics.stopwatch]::startNew() + if (-not $IsLinux) { throw "Sorry, currently only supported on Linux" } - "⏳ (1/5) Updating package infos..." - & sudo apt update -y - if ($lastExitCode -ne "0") { throw "'apt update' failed" } + $stopWatch = [system.diagnostics.stopwatch]::startNew() - "⏳ (2/5) Installing Calibre..." - & sudo apt install calibre -y - if ($lastExitCode -ne "0") { throw "'apt install calibre' failed" } + "⏳ (1/5) Updating package infos..." + & sudo apt update -y + if ($lastExitCode -ne "0") { throw "'apt update' failed" } - "⏳ (3/5) Searching for Calibre server executable..." - & calibre-server --version - if ($lastExitCode -ne "0") { throw "Can't execute 'calibre-server' - make sure Calibre server is installed and available" } + "⏳ (2/5) Installing Calibre package..." + & sudo apt install calibre -y + if ($lastExitCode -ne "0") { throw "'apt install calibre' failed" } - "⏳ (4/5) Creating media folder at: $mediaFolder ... (if non-existent)" - mkdir $mediaFolder + Write-Host "⏳ (3/5) Searching for Calibre server executable... " -noNewline + & calibre-server --version + if ($lastExitCode -ne "0") { throw "Can't execute 'calibre-server' - make sure Calibre server is installed and available" } - "⏳ (5/5) Starting Calibre server as background process..." - & calibre-server --port $port --num-per-page 100 --userdb $userDB --log $logfile --daemonize $HOME/'Calibre Library' + "⏳ (4/5) Creating media folder at: $mediaFolder ... (if non-existent)" + mkdir $mediaFolder - [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Installed Calibre server on Web port $port in $elapsed sec (media folder: $mediaFolder, user database: $userDB, log file: $logfile)" - exit 0 # success - } else { - throw "Currently only supported on Linux" - } + "⏳ (5/5) Starting Calibre server as background process..." + & calibre-server --port $port --num-per-page 100 --userdb $userDB --log $logfile --daemonize $HOME/'Calibre Library' + + [int]$elapsed = $stopWatch.Elapsed.TotalSeconds + "βœ”οΈ Installed Calibre server on port $port in $($elapsed)s (media at: $mediaFolder, user DB: $userDB, log to: $logfile)" + exit 0 # success } catch { - "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" - exit 1 +"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" +exit 1 } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-calibre-server.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-calibre-server.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-chocolatey.md b/docs/install-chocolatey.md index b63e89a43..42cf3ee74 100644 --- a/docs/install-chocolatey.md +++ b/docs/install-chocolatey.md @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-chocolatey.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-chocolatey.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-chrome.md b/docs/install-chrome.md index febfcf387..6434bc89f 100644 --- a/docs/install-chrome.md +++ b/docs/install-chrome.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-chrome.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-chrome.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-crystal-disk-info.md b/docs/install-crystal-disk-info.md index 5ebc1de8f..00b1661fd 100644 --- a/docs/install-crystal-disk-info.md +++ b/docs/install-crystal-disk-info.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-crystal-disk-info.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-crystal-disk-info.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-crystal-disk-mark.md b/docs/install-crystal-disk-mark.md index 64594724a..875849042 100644 --- a/docs/install-crystal-disk-mark.md +++ b/docs/install-crystal-disk-mark.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-crystal-disk-mark.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-crystal-disk-mark.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-discord.md b/docs/install-discord.md index d73fb736f..56bb15c96 100644 --- a/docs/install-discord.md +++ b/docs/install-discord.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-discord.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-discord.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-edge.md b/docs/install-edge.md index 893acff93..977444905 100644 --- a/docs/install-edge.md +++ b/docs/install-edge.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-edge.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-edge.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-evcc.md b/docs/install-evcc.md index 4063a0667..a237c227f 100644 --- a/docs/install-evcc.md +++ b/docs/install-evcc.md @@ -77,4 +77,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-evcc.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-evcc.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-firefox.md b/docs/install-firefox.md index ca20af408..cb945e9ec 100644 --- a/docs/install-firefox.md +++ b/docs/install-firefox.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-firefox.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-firefox.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-git-extensions.md b/docs/install-git-extensions.md index 72fe77d28..d4677c174 100644 --- a/docs/install-git-extensions.md +++ b/docs/install-git-extensions.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-git-extensions.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-git-extensions.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-git-for-windows.md b/docs/install-git-for-windows.md index af8372fa9..18cee1ca5 100644 --- a/docs/install-git-for-windows.md +++ b/docs/install-git-for-windows.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-git-for-windows.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-git-for-windows.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-github-cli.md b/docs/install-github-cli.md index 62774bc26..8dfcd22ca 100644 --- a/docs/install-github-cli.md +++ b/docs/install-github-cli.md @@ -68,4 +68,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-github-cli.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-github-cli.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-irfanview.md b/docs/install-irfanview.md index 77b17d67f..446724d2a 100644 --- a/docs/install-irfanview.md +++ b/docs/install-irfanview.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-irfanview.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-irfanview.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-knot-resolver.md b/docs/install-knot-resolver.md index 43c381a06..bb1dfbfa8 100644 --- a/docs/install-knot-resolver.md +++ b/docs/install-knot-resolver.md @@ -70,4 +70,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-knot-resolver.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-knot-resolver.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-microsoft-teams.md b/docs/install-microsoft-teams.md index ea306fc9f..e86930940 100644 --- a/docs/install-microsoft-teams.md +++ b/docs/install-microsoft-teams.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-microsoft-teams.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-microsoft-teams.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-netflix.md b/docs/install-netflix.md index ab6ae72af..4bb16f78f 100644 --- a/docs/install-netflix.md +++ b/docs/install-netflix.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-netflix.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-netflix.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-nine-zip.md b/docs/install-nine-zip.md index f4fbf105c..77c061b1d 100644 --- a/docs/install-nine-zip.md +++ b/docs/install-nine-zip.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-nine-zip.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-nine-zip.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-obs-studio.md b/docs/install-obs-studio.md index b61e3e539..fc6b1b332 100644 --- a/docs/install-obs-studio.md +++ b/docs/install-obs-studio.md @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-obs-studio.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-obs-studio.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-octoprint.md b/docs/install-octoprint.md index 7e10476b5..3ef1fb8a3 100644 --- a/docs/install-octoprint.md +++ b/docs/install-octoprint.md @@ -32,4 +32,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-octoprint.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-octoprint.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-one-calendar.md b/docs/install-one-calendar.md index 2b17c10be..d7f19d228 100644 --- a/docs/install-one-calendar.md +++ b/docs/install-one-calendar.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-one-calendar.ps1 as of 03/27/2024 17:36:26)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-one-calendar.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-opera-browser.md b/docs/install-opera-browser.md index bb8d1bcb1..3fe45b2ec 100644 --- a/docs/install-opera-browser.md +++ b/docs/install-opera-browser.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-opera-browser.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-opera-browser.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-opera-gx.md b/docs/install-opera-gx.md index 4079188b1..be9659608 100644 --- a/docs/install-opera-gx.md +++ b/docs/install-opera-gx.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-opera-gx.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-opera-gx.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-paint-3d.md b/docs/install-paint-3d.md index e8005ff14..94bf0d112 100644 --- a/docs/install-paint-3d.md +++ b/docs/install-paint-3d.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-paint-3d.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-paint-3d.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-power-toys.md b/docs/install-power-toys.md index af5ba6e04..9f8633791 100644 --- a/docs/install-power-toys.md +++ b/docs/install-power-toys.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-power-toys.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-power-toys.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-powershell.md b/docs/install-powershell.md index fd0278bb1..6cb4fc938 100644 --- a/docs/install-powershell.md +++ b/docs/install-powershell.md @@ -233,7 +233,7 @@ function Remove-Destination([string] $Destination) { if ($DoNotOverwrite) { throw "Destination folder '$Destination' already exist. Use a different path or omit '-DoNotOverwrite' to overwrite." } - Write-Host "⏳ (5/5) Removing old installation at: $Destination" + Write-Host "⏳ (4/4) Removing old installation at $Destination" if (Test-Path -Path "$Destination.old") { Remove-Item "$Destination.old" -Recurse -Force } @@ -466,14 +466,13 @@ try { tar zxf $packagePath -C $contentPath } } else { - Write-Host "⏳ (1/5) Loading metadata from https://raw.githubusercontent.com ..." + Write-Host "⏳ (1/4) Loading metadata from https://raw.githubusercontent.com ..." $metadata = Invoke-RestMethod https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/metadata.json if ($Preview) { $release = $metadata.PreviewReleaseTag -replace '^v' } else { $release = $metadata.ReleaseTag -replace '^v' } - Write-Host "⏳ (2/5) Found latest release $release for $architecture..." if ($IsWinEnv) { if ($UseMSI) { @@ -490,10 +489,10 @@ try { } elseif ($IsMacOSEnv) { $packageName = "powershell-${release}-osx-${architecture}.tar.gz" } - Write-Host "⏳ (3/5) Package name to download is $packageName..." + Write-Host "⏳ (2/4) Latest release is $release for $architecture, package name is $packageName ..." $downloadURL = "https://github.com/PowerShell/PowerShell/releases/download/v${release}/${packageName}" - Write-Host "⏳ (4/5) Loading $downloadURL" + Write-Host "⏳ (3/4) Loading $downloadURL" $packagePath = Join-Path -Path $tempDir -ChildPath $packageName if (!$PSVersionTable.ContainsKey('PSEdition') -or $PSVersionTable.PSEdition -eq "Desktop") { @@ -620,7 +619,7 @@ try { } if (-not $UseMSI) { - Write-Host "βœ… PowerShell has been installed at: $Destination" -noNewline + Write-Host "βœ… Installed PowerShell $release at $Destination" -noNewline if ($Destination -eq $PSHOME) { Write-Host " - Please restart pwsh now." } else { @@ -636,4 +635,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-powershell.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-powershell.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-rufus.md b/docs/install-rufus.md index 84a742d77..38266c15a 100644 --- a/docs/install-rufus.md +++ b/docs/install-rufus.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-rufus.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-rufus.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-signal-cli.md b/docs/install-signal-cli.md index 3dbbdaf13..59c35ad07 100644 --- a/docs/install-signal-cli.md +++ b/docs/install-signal-cli.md @@ -90,4 +90,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-signal-cli.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-signal-cli.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-skype.md b/docs/install-skype.md index 6ddc044f7..a9903fb6a 100644 --- a/docs/install-skype.md +++ b/docs/install-skype.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-skype.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-skype.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-spotify.md b/docs/install-spotify.md index 5620b20ea..302fdbb99 100644 --- a/docs/install-spotify.md +++ b/docs/install-spotify.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-spotify.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-spotify.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-ssh-client.md b/docs/install-ssh-client.md index db7b9bc77..240ee2798 100644 --- a/docs/install-ssh-client.md +++ b/docs/install-ssh-client.md @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-ssh-client.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-ssh-client.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-ssh-server.md b/docs/install-ssh-server.md index 85b0af4b8..a0b49ed21 100644 --- a/docs/install-ssh-server.md +++ b/docs/install-ssh-server.md @@ -78,4 +78,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-ssh-server.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-ssh-server.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-thunderbird.md b/docs/install-thunderbird.md index e63824f79..3dcd0dc1e 100644 --- a/docs/install-thunderbird.md +++ b/docs/install-thunderbird.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-thunderbird.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-thunderbird.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-twitter.md b/docs/install-twitter.md index d1005a94f..ba0af9577 100644 --- a/docs/install-twitter.md +++ b/docs/install-twitter.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-twitter.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-twitter.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-unbound-server.md b/docs/install-unbound-server.md index 8c530f92b..037d73f24 100644 --- a/docs/install-unbound-server.md +++ b/docs/install-unbound-server.md @@ -99,4 +99,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-unbound-server.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-unbound-server.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-updates.md b/docs/install-updates.md index 804a83946..817f0797d 100644 --- a/docs/install-updates.md +++ b/docs/install-updates.md @@ -18,9 +18,10 @@ Example ------- ```powershell PS> ./install-updates.ps1 -⏳ (1/2) Checking drive and swap space... -βœ… Drive C: uses 56% of 1TB Β· 441GB free -βœ… Swap space uses 2% of 1GB Β· 1GB free +⏳ (1/2) Checking requirements... +βœ… Drive C: has 441 GB free (56% of 1TB used) +βœ… Swap space has 1GB free (2% of 1GB used) +βœ… No pending system reboot @@ -48,9 +49,10 @@ Script Content NOTE: Use the script 'list-updates.ps1' to list the latest software updates before. .EXAMPLE PS> ./install-updates.ps1 - ⏳ (1/2) Checking drive and swap space... - βœ… Drive C: uses 56% of 1TB Β· 441GB free - βœ… Swap space uses 2% of 1GB Β· 1GB free + ⏳ (1/2) Checking requirements... + βœ… Drive C: has 441 GB free (56% of 1TB used) + βœ… Swap space has 1GB free (2% of 1GB used) + βœ… No pending system reboot ⏳ (2/2) Installing updates from winget and Microsoft Store... ... @@ -64,9 +66,12 @@ try { $stopWatch = [system.diagnostics.stopwatch]::startNew() if ($IsLinux) { - "⏳ (1/5) Checking drive and swap space..." + "⏳ (1/5) Checking requirements..." + & "$PSScriptRoot/check-smart-devices.ps1" & "$PSScriptRoot/check-drive-space.ps1" / & "$PSScriptRoot/check-swap-space.ps1" + & "$PSScriptRoot/check-pending-reboot.ps1" + Start-Sleep -seconds 3 "" "⏳ (2/5) Querying latest package information..." & sudo apt update @@ -84,16 +89,20 @@ try { & sudo softwareupdate -i -a Write-Progress -completed " " } else { - "⏳ (1/2) Checking drive and swap space..." + # Windows: + "⏳ (1/2) Checking requirements..." + & "$PSScriptRoot/check-smart-devices.ps1" & "$PSScriptRoot/check-drive-space.ps1" C & "$PSScriptRoot/check-swap-space.ps1" + & "$PSScriptRoot/check-pending-reboot.ps1" + Start-Sleep -seconds 3 "" "⏳ (2/2) Installing updates from winget and Microsoft Store..." "" & winget upgrade --all --include-unknown } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ… Installed updates in $elapsed sec" + "βœ… Updates installed in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -101,4 +110,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-updates.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-updates.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-visual-studio-code.md b/docs/install-visual-studio-code.md index 160bc6228..1e2f9715e 100644 --- a/docs/install-visual-studio-code.md +++ b/docs/install-visual-studio-code.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-visual-studio-code.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-visual-studio-code.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-vivaldi.md b/docs/install-vivaldi.md index f9ac83ccb..3057f218c 100644 --- a/docs/install-vivaldi.md +++ b/docs/install-vivaldi.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-vivaldi.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-vivaldi.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-vlc.md b/docs/install-vlc.md index 5690b1da1..c83716c1f 100644 --- a/docs/install-vlc.md +++ b/docs/install-vlc.md @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-vlc.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-vlc.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-windows-terminal.md b/docs/install-windows-terminal.md index f6f55fb53..22d9888cb 100644 --- a/docs/install-windows-terminal.md +++ b/docs/install-windows-terminal.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-windows-terminal.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-windows-terminal.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-wsl.md b/docs/install-wsl.md index e040cc19e..274132c3f 100644 --- a/docs/install-wsl.md +++ b/docs/install-wsl.md @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-wsl.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-wsl.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/install-zoom.md b/docs/install-zoom.md index b21977581..27342a89b 100644 --- a/docs/install-zoom.md +++ b/docs/install-zoom.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of install-zoom.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of install-zoom.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/introduce-powershell.md b/docs/introduce-powershell.md index 8a25fdbe9..ddcd4bac2 100644 --- a/docs/introduce-powershell.md +++ b/docs/introduce-powershell.md @@ -47,7 +47,7 @@ Script Content try { Clear-Host "" - & "$PSScriptRoot/write-typewriter.ps1" " There's one shell to rule them all. It's called:" 200 + & "$PSScriptRoot/write-typewriter.ps1" " Hi $USERNAME, move into the fast lane by using . . ." 200 "" Write-Host " _____ _____ _ _ _ " -foregroundColor blue Write-Host " | __ \ / ____| | | | |" -foregroundColor blue @@ -66,13 +66,14 @@ try { & "$PSScriptRoot/write-typewriter.ps1" "PowerShell is open-source and free! It's available for Linux, Mac OS and Windows" 25 "" Write-Host " πŸ”· " -noNewline - & "$PSScriptRoot/write-typewriter.ps1" "Want to learn PowerShell? See the tutorial at: https://www.guru99.com/powershell-tutorial.html" 25 + & "$PSScriptRoot/write-typewriter.ps1" "Enhance PowerShell by 500+ PowerShell scripts! Get them from: https://github.com/fleschutz/PowerShell" 25 "" + Write-Host " πŸ”· " -noNewline - & "$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 learn PowerShell? See the tutorial at: https://www.guru99.com/powershell-tutorial.html" 25 "" Write-Host " πŸ”· " -noNewline - & "$PSScriptRoot/write-typewriter.ps1" "Want sample scripts? See the Mega Collection of PowerShell scripts at: https://github.com/fleschutz/PowerShell" 25 + & "$PSScriptRoot/write-typewriter.ps1" "Need docs? See the official documentation at: https://docs.microsoft.com/en-us/powershell" 25 "" Write-Host " πŸ”· " -noNewline & "$PSScriptRoot/write-typewriter.ps1" "Want a cheat sheet? See: https://github.com/fleschutz/PowerShell/blob/master/docs/cheat-sheet.md" 25 @@ -91,4 +92,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of introduce-powershell.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of introduce-powershell.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/list-aliases.md b/docs/list-aliases.md index 6161b2446..a42dd5e26 100644 --- a/docs/list-aliases.md +++ b/docs/list-aliases.md @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-aliases.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-aliases.ps1 as of 05/19/2024 10:25:20)* diff --git a/docs/list-anagrams.md b/docs/list-anagrams.md index a34318538..932514e38 100644 --- a/docs/list-anagrams.md +++ b/docs/list-anagrams.md @@ -120,4 +120,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-anagrams.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-anagrams.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-apps.md b/docs/list-apps.md index 7263d487b..55ddfe97f 100644 --- a/docs/list-apps.md +++ b/docs/list-apps.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-apps.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-apps.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-ascii-table.md b/docs/list-ascii-table.md index 7f6f16d3d..60a5388ed 100644 --- a/docs/list-ascii-table.md +++ b/docs/list-ascii-table.md @@ -120,4 +120,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-ascii-table.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-ascii-table.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-automatic-variables.md b/docs/list-automatic-variables.md index 626fc67d1..2f359bab9 100644 --- a/docs/list-automatic-variables.md +++ b/docs/list-automatic-variables.md @@ -100,4 +100,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-automatic-variables.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-automatic-variables.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-battery-status.md b/docs/list-battery-status.md index 317612b3f..ac4021949 100644 --- a/docs/list-battery-status.md +++ b/docs/list-battery-status.md @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-battery-status.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-battery-status.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-bios.md b/docs/list-bios.md index 78b8bc32c..c3f16e4e7 100644 --- a/docs/list-bios.md +++ b/docs/list-bios.md @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-bios.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-bios.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-bluetooth-devices.md b/docs/list-bluetooth-devices.md index c4b485861..fe62ecfaa 100644 --- a/docs/list-bluetooth-devices.md +++ b/docs/list-bluetooth-devices.md @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-bluetooth-devices.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-bluetooth-devices.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-branches.md b/docs/list-branches.md index 1ca3dfe23..23c7a097f 100644 --- a/docs/list-branches.md +++ b/docs/list-branches.md @@ -107,4 +107,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-branches.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-branches.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-calendar.md b/docs/list-calendar.md index 5bfe1cc00..f385e5d2a 100644 --- a/docs/list-calendar.md +++ b/docs/list-calendar.md @@ -244,4 +244,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-calendar.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-calendar.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-cheat-sheet.md b/docs/list-cheat-sheet.md index edcbf7aa4..f06359c79 100644 --- a/docs/list-cheat-sheet.md +++ b/docs/list-cheat-sheet.md @@ -75,4 +75,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-cheat-sheet.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-cheat-sheet.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-city-weather.md b/docs/list-city-weather.md index 982db34d0..689b977e6 100644 --- a/docs/list-city-weather.md +++ b/docs/list-city-weather.md @@ -32,17 +32,18 @@ Script Content function ListCityWeather { $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" + foreach($City in $Cities) { $Temp = (Invoke-WebRequest http://wttr.in/${City}?format="%t %c " -UserAgent "curl" -useBasicParsing).Content - $Clouds = (Invoke-WebRequest http://wttr.in/${City}?format="%h %p" -UserAgent "curl" -useBasicParsing).Content + $Rain = (Invoke-WebRequest http://wttr.in/${City}?format="%p %h" -UserAgent "curl" -useBasicParsing).Content $Wind = (Invoke-WebRequest http://wttr.in/${City}?format="%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"; Temperature="$Temp"; Clouds="$Clouds"; Wind="$Wind"; Sun="$Sun" } + New-Object PSObject -Property @{ City="$City"; Temp="$Temp"; Rain="$Rain"; Wind="$Wind"; Sun="$Sun" } } } try { - ListCityWeather | Format-Table -property @{e='City';width=17},@{e='Temperature';width=15},@{e='Clouds';width=15},@{e='Wind';width=12},@{e='Sun';width=20} + ListCityWeather | Format-Table -property @{e='City';width=17},@{e='Temp';width=13},@{e='Rain';width=15},@{e='Wind';width=12},@{e='Sun';width=20} exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -50,4 +51,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-city-weather.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-city-weather.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-cli-tools.md b/docs/list-cli-tools.md index 49739b767..0ed9ce7ca 100644 --- a/docs/list-cli-tools.md +++ b/docs/list-cli-tools.md @@ -25,9 +25,9 @@ Script Content .EXAMPLE PS> ./list-cli-tools.ps1 - CLI-Tool Version Location - -------- ------- -------- - at 10.0.19041.1 C:\WINDOWS\system32\at.exe (31K) + Tool Name Version Installation Path + --------- ------- ----------------- + 7z 23.01 /usr/bin/7z (38 bytes) ... .LINK https://github.com/fleschutz/PowerShell @@ -72,13 +72,13 @@ function ListTool([string]$Name, [string]$VersionArg) { } else { $Size = 0 } - New-Object PSObject -Property @{ 'CLI-Tool'=$Name; Version=$Version; Location="$Path ($(Bytes2String $Size))" } + New-Object PSObject -Property @{ 'Tool Name'=$Name; 'Version'=$Version; 'Installation Path'="$Path ($(Bytes2String $Size))" } } catch { return } } -function ListTools { +function ListTools { ListTool 7z "-version" ListTool ant "-v" ListTool apt "--version" @@ -89,7 +89,7 @@ function ListTools { ListTool ar "--version" ListTool arch "--version" ListTool arecord "--version" - ListTool arp "" + ListTool arp "--version" ListTool at "" ListTool attrib "" ListTool auditpol "" @@ -220,6 +220,7 @@ function ListTools { ListTool icacls "--version" ListTool iconv "--version" ListTool id "--version" + ListTool ip "help" ListTool ipfs "--version" ListTool java "--version" ListTool jcli "version" @@ -254,6 +255,7 @@ function ListTools { ListTool netsh "" ListTool netstat "" ListTool nice "--version" + ListTool nmap "--version" ListTool nohup "--version" ListTool nroff "--version" ListTool nslookup "" @@ -285,6 +287,7 @@ function ListTools { ListTool rsh "" ListTool rsync "--version" ListTool rundll32 "--version" + ListTool sc.exe "/?" ListTool scp "" ListTool setx "" ListTool sftp "" @@ -347,7 +350,7 @@ function ListTools { } try { - ListTools | Format-Table -property @{e='CLI-Tool';width=14},@{e='Version';width=17},@{e='Location';width=90} + ListTools | Format-Table -property @{e='Tool Name';width=15},@{e='Version';width=15},@{e='Installation Path';width=90} exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -355,4 +358,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-cli-tools.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-cli-tools.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-clipboard.md b/docs/list-clipboard.md index 398748f94..55ac3ad07 100644 --- a/docs/list-clipboard.md +++ b/docs/list-clipboard.md @@ -47,7 +47,8 @@ Script Content #> try { - "πŸ“‹ $(get-clipboard)" + [string]$text = (Get-Clipboard) + Write-Output "πŸ“‹ `β€œ $text `β€ž" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -55,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-clipboard.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-clipboard.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-cmdlets.md b/docs/list-cmdlets.md index b013b2c7d..ca0a0cacd 100644 --- a/docs/list-cmdlets.md +++ b/docs/list-cmdlets.md @@ -67,4 +67,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-cmdlets.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-cmdlets.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-coffee-prices.md b/docs/list-coffee-prices.md index eae88390c..4c3a3c6ce 100644 --- a/docs/list-coffee-prices.md +++ b/docs/list-coffee-prices.md @@ -24,6 +24,10 @@ Script Content This PowerShell script queries alphavantage.co and lists the global price of coffee (monthly, in cents per points). .EXAMPLE PS> ./list-coffee-prices.ps1 + + Monthly Global Price of Coffee (by alphavantage.co, in cents per pound) + ----------------------------------------------------------------------- + 2024-04-01 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ 240 .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -48,22 +52,23 @@ function WriteHorizontalBar { param([float]$Value, [float]$Max) } elseif ($Num -ge 0.125) { Write-Host "▏" -noNewline } - Write-Host " $Value" + Write-Host " $Value" -noNewline } try { Write-Progress "Loading data from www.alphavantage.co..." $prices = (Invoke-WebRequest -URI "https://www.alphavantage.co/query?function=COFFEE&interval=monthly&apikey=demo" -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json - Write-Progress -completed " " + Write-Progress -completed "Done." "" - "$($prices.name) (by alphavantage.co, in $($prices.unit))" - "---------------------------------------------------------------" + "Monthly $($prices.name) (by alphavantage.co, in $($prices.unit))" + "-----------------------------------------------------------------------" foreach($item in $prices.data) { if ($Item.value -eq ".") { continue } Write-Host "$($item.date) " -noNewline [int]$value = $Item.value WriteHorizontalBar $value 350.0 + Write-Host "ct" } exit 0 # success } catch { @@ -72,4 +77,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-coffee-prices.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-coffee-prices.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-commit-stats.md b/docs/list-commit-stats.md index fe7b34926..b55aa9a92 100644 --- a/docs/list-commit-stats.md +++ b/docs/list-commit-stats.md @@ -93,4 +93,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-commit-stats.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-commit-stats.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-commits.md b/docs/list-commits.md index f999d34cb..15b94804f 100644 --- a/docs/list-commits.md +++ b/docs/list-commits.md @@ -121,4 +121,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-commits.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-commits.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-console-colors.md b/docs/list-console-colors.md index 9d7324e79..58af88910 100644 --- a/docs/list-console-colors.md +++ b/docs/list-console-colors.md @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-console-colors.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-console-colors.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-countries.md b/docs/list-countries.md index 395c19b1f..a7e53ca5f 100644 --- a/docs/list-countries.md +++ b/docs/list-countries.md @@ -52,4 +52,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-countries.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-countries.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-cpu.md b/docs/list-cpu.md index caae34394..77a78d6b2 100644 --- a/docs/list-cpu.md +++ b/docs/list-cpu.md @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-cpu.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-cpu.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-credits.md b/docs/list-credits.md index d18792de2..73935704a 100644 --- a/docs/list-credits.md +++ b/docs/list-credits.md @@ -45,33 +45,29 @@ Script Content #> try { - clear-host - "" + Clear-Host " ______ ______ ______ _____ __ ______ ______ " " /\ ___\ /\ == \ /\ ___\ /\ __-. /\ \ /\__ _\ /\ ___\ " " \ \ \____ \ \ __< \ \ __\ \ \ \/\ \ \ \ \ \/_/\ \/ \ \___ \ " " \ \_____\ \ \_\ \_\ \ \_____\ \ \____- \ \_\ \ \_\ \/\_____\ " " \/_____/ \/_/ /_/ \/_____/ \/____/ \/_/ \/_/ \/_____/ " - "" - + "" & "$PSScriptRoot/write-animated.ps1" "Typos: Markus Fleschutz" & "$PSScriptRoot/write-animated.ps1" "Keyboard: Rapoo 12335 E9270P WL Ultra-Slim Touch" - & "$PSScriptRoot/write-animated.ps1" "Operating Systems: Windows 10 20H2 & Ubuntu Server 20.04 LTS" - & "$PSScriptRoot/write-animated.ps1" "Console: Windows Terminal 1.7.1033.0" - & "$PSScriptRoot/write-animated.ps1" "Background Image: Asteroid Field by starwars.com" - & "$PSScriptRoot/write-animated.ps1" "Shell: PowerShell 5.1 & PowerShell 7.1.3" - & "$PSScriptRoot/write-animated.ps1" "Scripts: PowerShell Scripts 0.2" + & "$PSScriptRoot/write-animated.ps1" "Operating Systems: Windows 11 23H3 & Ubuntu Server 24.04 LTS" + & "$PSScriptRoot/write-animated.ps1" "Console: Windows Terminal 1.20.11271.0" + & "$PSScriptRoot/write-animated.ps1" "Shell: PowerShell 5.1.22621.2506 & PowerShell 7.4.2" + & "$PSScriptRoot/write-animated.ps1" "Scripts: PowerShell Scripts 1.1" & "$PSScriptRoot/write-animated.ps1" "GitHub: github.com/fleschutz/PowerShell" - & "$PSScriptRoot/write-animated.ps1" "Git: version 2.30" + & "$PSScriptRoot/write-animated.ps1" "Git: version 2.45.0" & "$PSScriptRoot/write-animated.ps1" "SSH: OpenSSH version 7.7p1" & "$PSScriptRoot/write-animated.ps1" "Unicode: version 13.0" & "$PSScriptRoot/write-animated.ps1" "Song #1: Epic Song by BoxCat Games from Free Music Archive" & "$PSScriptRoot/write-animated.ps1" "Song #2: Siesta by Jahzzar from Free Music Archive" & "$PSScriptRoot/write-animated.ps1" "Executive Producer: Markus Fleschutz" & "$PSScriptRoot/write-animated.ps1" "Special Thanks: Andrea Fleschutz" - & "$PSScriptRoot/write-animated.ps1" "Copyright: (c) 2021. All Rights Reserved" + & "$PSScriptRoot/write-animated.ps1" "Copyright: (c) 2024. All Rights Reserved" & "$PSScriptRoot/write-animated.ps1" "No Animals Were Harmed in the Making of This Film" - & "$PSScriptRoot/write-big.ps1" " Thanx 4 watching" exit 0 # success } catch { @@ -80,4 +76,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-credits.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-credits.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-crypto-rates.md b/docs/list-crypto-rates.md index 82c43b68f..fe9edb00d 100644 --- a/docs/list-crypto-rates.md +++ b/docs/list-crypto-rates.md @@ -76,4 +76,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-crypto-rates.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-crypto-rates.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-defender-settings.md b/docs/list-defender-settings.md index 668af6655..6550db8b6 100644 --- a/docs/list-defender-settings.md +++ b/docs/list-defender-settings.md @@ -69,4 +69,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-defender-settings.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-defender-settings.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-dir-tree.md b/docs/list-dir-tree.md index 0217244a3..ab54774d7 100644 --- a/docs/list-dir-tree.md +++ b/docs/list-dir-tree.md @@ -122,4 +122,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-dir-tree.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-dir-tree.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-dns-servers.md b/docs/list-dns-servers.md index 9d42c5599..222288e63 100644 --- a/docs/list-dns-servers.md +++ b/docs/list-dns-servers.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-dns-servers.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-dns-servers.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-drives.md b/docs/list-drives.md index a8c3bb05c..dd2702d68 100644 --- a/docs/list-drives.md +++ b/docs/list-drives.md @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-drives.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-drives.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-earthquakes.md b/docs/list-earthquakes.md index 6ad364c54..b5b6b8527 100644 --- a/docs/list-earthquakes.md +++ b/docs/list-earthquakes.md @@ -1,12 +1,21 @@ Script: *list-earthquakes.ps1* ======================== -This PowerShell script lists major earthquakes with magnitude >= 6.0 for the last 30 days. +This PowerShell script lists major earthquakes for the last 30 days. Parameters ---------- ```powershell -PS> ./list-earthquakes.ps1 [] +PS> ./list-earthquakes.ps1 [[-minMagnitude] ] [] + +-minMagnitude + Specifies the minimum magnitude to list (5.5 by default) + + Required? false + Position? 1 + Default value 5.5 + Accept pipeline input? false + Accept wildcard characters? false [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -20,8 +29,8 @@ PS> ./list-earthquakes.ps1 -Mag Location Depth Time ---- -------- ----- ---- +Mag Location Depth Time UTC +--- -------- ----- -------- 7.2 98 km S of Sand Point, Alaska 33 km 2023-07-16T06:48:22.606Z ... @@ -42,12 +51,14 @@ Script Content .SYNOPSIS Lists major earthquakes .DESCRIPTION - This PowerShell script lists major earthquakes with magnitude >= 6.0 for the last 30 days. + This PowerShell script lists major earthquakes for the last 30 days. +.PARAMETER minMagnitude + Specifies the minimum magnitude to list (5.5 by default) .EXAMPLE PS> ./list-earthquakes.ps1 - Mag Location Depth Time - --- -------- ----- ---- + Mag Location Depth Time UTC + --- -------- ----- -------- 7.2 98 km S of Sand Point, Alaska 33 km 2023-07-16T06:48:22.606Z ... .LINK @@ -56,22 +67,25 @@ Script Content Author: Markus Fleschutz | License: CC0 #> +param([float]$minMagnitude=5.5) + $Format="csv" # cap, csv, geojson, kml, kmlraw, quakeml, text, xml -$MinMagnitude=5.7 $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 } + $quakes = (Invoke-WebRequest -URI "https://earthquake.usgs.gov/fdsnws/event/1/query?format=$Format&minmagnitude=$minMagnitude&orderby=$OrderBy" -userAgent "curl" -useBasicParsing).Content | ConvertFrom-CSV + Write-Progress -completed "done." + + foreach($quake in $quakes) { + [int]$depth = $quake.depth + New-Object PSObject -Property @{ Mag=$quake.mag; Depth="$depth km"; Location=$quake.place; 'Time UTC'=$quake.time } } - Write-Progress -completed "Loading finished." + } try { - ListEarthquakes | Format-Table -property @{e='Mag';width=5},@{e='Location';width=42},@{e='Depth';width=12},Time + ListEarthquakes | Format-Table -property @{e='Mag';width=5},@{e='Location';width=42},@{e='Depth';width=12},'Time UTC' exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -79,4 +93,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-earthquakes.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-earthquakes.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-emojis.md b/docs/list-emojis.md index 63a59908f..280caa74a 100644 --- a/docs/list-emojis.md +++ b/docs/list-emojis.md @@ -72,4 +72,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-emojis.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-emojis.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-empty-dirs.md b/docs/list-empty-dirs.md index 6888a4240..b7c310017 100644 --- a/docs/list-empty-dirs.md +++ b/docs/list-empty-dirs.md @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-empty-dirs.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-empty-dirs.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-empty-files.md b/docs/list-empty-files.md index b5ef65b47..b37fc8b5a 100644 --- a/docs/list-empty-files.md +++ b/docs/list-empty-files.md @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-empty-files.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-empty-files.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-encrypted-files.md b/docs/list-encrypted-files.md index 27fd2e1da..91ca589f8 100644 --- a/docs/list-encrypted-files.md +++ b/docs/list-encrypted-files.md @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-encrypted-files.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-encrypted-files.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-environment-variables.md b/docs/list-environment-variables.md index fbb037f66..29ff16433 100644 --- a/docs/list-environment-variables.md +++ b/docs/list-environment-variables.md @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-environment-variables.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-environment-variables.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-error-types.md b/docs/list-error-types.md index 33bbe80da..2d98f7a25 100644 --- a/docs/list-error-types.md +++ b/docs/list-error-types.md @@ -26,4 +26,4 @@ Script Content } | Select BaseType,Name,FullName ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-error-types.ps1 as of 03/27/2024 17:36:27)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-error-types.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-exchange-rates.md b/docs/list-exchange-rates.md index 8494220ab..650eec76f 100644 --- a/docs/list-exchange-rates.md +++ b/docs/list-exchange-rates.md @@ -95,4 +95,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-exchange-rates.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-exchange-rates.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-executables.md b/docs/list-executables.md index 725e4f2bb..6dc3c0264 100644 --- a/docs/list-executables.md +++ b/docs/list-executables.md @@ -83,4 +83,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-executables.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-executables.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-fibonacci.md b/docs/list-fibonacci.md index d3ebe458c..8d4fe4c02 100644 --- a/docs/list-fibonacci.md +++ b/docs/list-fibonacci.md @@ -43,4 +43,4 @@ foreach ($i in 0..100) { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-fibonacci.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-fibonacci.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-files.md b/docs/list-files.md index 4588c56a8..f6fee035a 100644 --- a/docs/list-files.md +++ b/docs/list-files.md @@ -68,4 +68,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-files.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-files.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-folder.md b/docs/list-folder.md index 5ab6aaaf8..a7b0bc728 100644 --- a/docs/list-folder.md +++ b/docs/list-folder.md @@ -91,4 +91,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-folder.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-folder.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-fritzbox-calls.md b/docs/list-fritzbox-calls.md index a88645cf9..3adb5ea2c 100644 --- a/docs/list-fritzbox-calls.md +++ b/docs/list-fritzbox-calls.md @@ -153,4 +153,4 @@ echo $Result exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-fritzbox-calls.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-fritzbox-calls.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-fritzbox-devices.md b/docs/list-fritzbox-devices.md index 3a1eb32f4..4660d7b50 100644 --- a/docs/list-fritzbox-devices.md +++ b/docs/list-fritzbox-devices.md @@ -105,4 +105,4 @@ $HostTable | format-table -property Active,IPAddress,MACAddress,HostName,Interfa exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-fritzbox-devices.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-fritzbox-devices.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-headlines.md b/docs/list-headlines.md index 6e630558b..e0265ac25 100644 --- a/docs/list-headlines.md +++ b/docs/list-headlines.md @@ -89,4 +89,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-headlines.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-headlines.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-hidden-files.md b/docs/list-hidden-files.md index 8a1460061..5d685e085 100644 --- a/docs/list-hidden-files.md +++ b/docs/list-hidden-files.md @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-hidden-files.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-hidden-files.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-installed-languages.md b/docs/list-installed-languages.md index c5a520c7e..39d5331bc 100644 --- a/docs/list-installed-languages.md +++ b/docs/list-installed-languages.md @@ -50,4 +50,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-installed-languages.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-installed-languages.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-installed-scripts.md b/docs/list-installed-scripts.md index daefab06e..a1560914c 100644 --- a/docs/list-installed-scripts.md +++ b/docs/list-installed-scripts.md @@ -48,4 +48,4 @@ Get-InstalledScript exit # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-installed-scripts.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-installed-scripts.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-installed-software.md b/docs/list-installed-software.md index 74db06d2e..db2bd1d63 100644 --- a/docs/list-installed-software.md +++ b/docs/list-installed-software.md @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-installed-software.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-installed-software.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-ipv6.md b/docs/list-ipv6.md index a16d0c54c..b2e997e12 100644 --- a/docs/list-ipv6.md +++ b/docs/list-ipv6.md @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-ipv6.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-ipv6.ps1 as of 05/19/2024 10:25:21)* diff --git a/docs/list-latest-tag.md b/docs/list-latest-tag.md index 282d0dc87..230b98e18 100644 --- a/docs/list-latest-tag.md +++ b/docs/list-latest-tag.md @@ -77,4 +77,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-latest-tag.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-latest-tag.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-latest-tags.md b/docs/list-latest-tags.md index 10859d6d6..b512e267c 100644 --- a/docs/list-latest-tags.md +++ b/docs/list-latest-tags.md @@ -85,4 +85,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-latest-tags.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-latest-tags.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-memos.md b/docs/list-memos.md index a0e05a0aa..5c7c36d2d 100644 --- a/docs/list-memos.md +++ b/docs/list-memos.md @@ -71,4 +71,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-memos.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-memos.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-motherboard.md b/docs/list-motherboard.md index ed7ea99df..7569e593d 100644 --- a/docs/list-motherboard.md +++ b/docs/list-motherboard.md @@ -61,4 +61,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-motherboard.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-motherboard.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-mysql-tables.md b/docs/list-mysql-tables.md index c318b1e86..14f078cc8 100644 --- a/docs/list-mysql-tables.md +++ b/docs/list-mysql-tables.md @@ -90,4 +90,4 @@ $result = Invoke-MySqlQuery -ConnectionString "server=$server; database=$databa $result | Export-Csv $csvfilepath -NoTypeInformation ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-mysql-tables.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-mysql-tables.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-network-connections.md b/docs/list-network-connections.md index dfc22b4f1..073621055 100644 --- a/docs/list-network-connections.md +++ b/docs/list-network-connections.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-network-connections.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-network-connections.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-network-neighbors.md b/docs/list-network-neighbors.md new file mode 100644 index 000000000..ce95829dc --- /dev/null +++ b/docs/list-network-neighbors.md @@ -0,0 +1,74 @@ +Script: *list-network-neighbors.ps1* +======================== + +This PowerShell script lists all network neighbors of the local computer (using the ARP cache). + +Parameters +---------- +```powershell +PS> ./list-network-neighbors.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./list-network-neighbors.ps1 + + + +IPAddress InterfaceAlias LinkLayerAddress State +--------- -------------- ---------------- ----- +192.168.178.43 Ethernet 2C-F0-5D-E7-8E-EE Reachable +... + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Lists the (cached) network neighbors +.DESCRIPTION + This PowerShell script lists all network neighbors of the local computer (using the ARP cache). +.EXAMPLE + PS> ./list-network-neighbors.ps1 + + IPAddress InterfaceAlias LinkLayerAddress State + --------- -------------- ---------------- ----- + 192.168.178.43 Ethernet 2C-F0-5D-E7-8E-EE Reachable + ... +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + if ($IsLinux) { + & ip neigh | grep REACHABLE + } elseif ($IsMacOS) { + & ip neigh | grep REACHABLE + } else { + Get-NetNeighbor -includeAllCompartments -state Permanent,Reachable | Format-Table -property @{e='IPAddress';width=38},@{e='InterfaceAlias';width=14},@{e='LinkLayerAddress';width=19},@{e='State';width=12} + } + 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-network-neighbors.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-network-routes.md b/docs/list-network-routes.md index 44357ebcb..fbaaa9124 100644 --- a/docs/list-network-routes.md +++ b/docs/list-network-routes.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-network-routes.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-network-routes.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-network-shares.md b/docs/list-network-shares.md index 84c2aba8c..3fe77c0c8 100644 --- a/docs/list-network-shares.md +++ b/docs/list-network-shares.md @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-network-shares.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-network-shares.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-news.md b/docs/list-news.md index b99cb72e8..7d5c669a9 100644 --- a/docs/list-news.md +++ b/docs/list-news.md @@ -44,7 +44,9 @@ Example ------- ```powershell PS> ./list-news.ps1 - + + UTC Yahoo News - Latest News & Headlines - https://www.yahoo.com/news/world + --- ----------------------------------------------------------------------- ❇️ 09:15 Deadly Mediterranean wildfires kill more than 40 ... @@ -74,7 +76,9 @@ Script Content Specifies the speed to write the text (10 ms by default) .EXAMPLE PS> ./list-news.ps1 - + + UTC Yahoo News - Latest News & Headlines - https://www.yahoo.com/news/world + --- ----------------------------------------------------------------------- ❇️ 09:15 Deadly Mediterranean wildfires kill more than 40 ... .LINK @@ -88,9 +92,11 @@ param([string]$RSS_URL = "https://news.yahoo.com/rss/world", [int]$maxLines = 24 try { [xml]$content = (Invoke-WebRequest -URI $RSS_URL -useBasicParsing).Content + $title = $content.rss.channel.title $URL = $content.rss.channel.link - "" - " [UTC] [SOURCE: $URL]" + " " + " UTC $title - $URL" + " --- -----------------------------------------------------------------------" [int]$count = 1 foreach ($item in $content.rss.channel.item) { @@ -106,4 +112,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-news.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-news.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-nic.md b/docs/list-nic.md index 35a0f4320..d954044f0 100644 --- a/docs/list-nic.md +++ b/docs/list-nic.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-nic.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-nic.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-nina-warnings.md b/docs/list-nina-warnings.md index 0bfe3a5d0..94cc1b19a 100644 --- a/docs/list-nina-warnings.md +++ b/docs/list-nina-warnings.md @@ -1,41 +1,27 @@ Script: *list-nina-warnings.ps1* ======================== -This PowerShell script queries the current NINA warnings and prints it. +list-nina-warnings.ps1 + Parameters ---------- ```powershell -PS> ./list-nina-warnings.ps1 [] + [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. ``` -Example -------- -```powershell -PS> ./list-nina-warnings.ps1 - -``` - -Notes ------ -Author: Markus Fleschutz | License: CC0 - -Related Links -------------- -https://github.com/fleschutz/PowerShell - Script Content -------------- ```powershell <# .SYNOPSIS - Lists the current NINA warnings + Lists the current weather warnings by NINA .DESCRIPTION - This PowerShell script queries the current NINA warnings and prints it. + This PowerShell script queries the current NINA weather warnings and lists it. .EXAMPLE PS> ./list-nina-warnings.ps1 .LINK @@ -44,21 +30,32 @@ Script Content Author: Markus Fleschutz | License: CC0 #> -try { +function ListWarningsOf([string]$category, [string]$source) +{ Write-Progress "Loading NINA warnings..." - $warnings = (Invoke-WebRequest -URI https://warnung.bund.de/api31/dwd/mapData.json -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json + $warnings = (Invoke-WebRequest -URI https://warnung.bund.de/api31/$category/mapData.json -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json Write-Progress -completed "Done." - Write-Output "Weather Warnings by DWD" - Write-Output "-----------------------" + foreach($warning in $warnings) { + $message = $warning.i18nTitle.en $startDate = $warning.startDate $expiresDate = $warning.expiresDate $severity = $warning.severity $urgency = $warning.urgency $type = $warning.type - $message = $warning.i18nTitle.en - Write-Output "* $type from $startDate to $($expiresDate): $message ($severity, $urgency)" + Write-Output "* $message" + Write-Output " from $startDate to $expiresDate ($source $type, $severity, $urgency)" + Write-Output "" } +} + +try { + Write-Output "" + ListWarningsOf "katwarn" "Katwarn" + ListWarningsOf "dwd" "DWD" + ListWarningsOf "police" "Police" + ListWarningsOf "lhp" "LHP" + ListWarningsOf "biwapp" "Biwapp" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -66,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-nina-warnings.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-nina-warnings.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-os-releases.md b/docs/list-os-releases.md index b7d5e163b..4ceb624e7 100644 --- a/docs/list-os-releases.md +++ b/docs/list-os-releases.md @@ -66,4 +66,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-os-releases.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-os-releases.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-os-updates.md b/docs/list-os-updates.md index 95ab0961d..43700aa1d 100644 --- a/docs/list-os-updates.md +++ b/docs/list-os-updates.md @@ -89,4 +89,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-os-updates.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-os-updates.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-os.md b/docs/list-os.md index d885d5b73..b25b7c5a6 100644 --- a/docs/list-os.md +++ b/docs/list-os.md @@ -61,4 +61,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-os.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-os.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-outlook-inbox.md b/docs/list-outlook-inbox.md index 75ce310c2..b2cdb75bb 100644 --- a/docs/list-outlook-inbox.md +++ b/docs/list-outlook-inbox.md @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-outlook-inbox.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-outlook-inbox.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-outlook-sent.md b/docs/list-outlook-sent.md index 09df4ff00..a28c8295a 100644 --- a/docs/list-outlook-sent.md +++ b/docs/list-outlook-sent.md @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-outlook-sent.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-outlook-sent.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-passwords.md b/docs/list-passwords.md index 57c96aaf6..55c7f61c6 100644 --- a/docs/list-passwords.md +++ b/docs/list-passwords.md @@ -111,4 +111,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-passwords.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-passwords.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-pi.md b/docs/list-pi.md index 3b3a16ea3..603d16307 100644 --- a/docs/list-pi.md +++ b/docs/list-pi.md @@ -117,4 +117,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-pi.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-pi.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-pins.md b/docs/list-pins.md index ce4f31c59..319bd820d 100644 --- a/docs/list-pins.md +++ b/docs/list-pins.md @@ -100,4 +100,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-pins.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-pins.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-power-schemes.md b/docs/list-power-schemes.md index 9deb42241..131b14414 100644 --- a/docs/list-power-schemes.md +++ b/docs/list-power-schemes.md @@ -21,4 +21,4 @@ powercfg /list exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-power-schemes.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-power-schemes.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-powershell-modules.md b/docs/list-powershell-modules.md index 8498b0793..17a8d421e 100644 --- a/docs/list-powershell-modules.md +++ b/docs/list-powershell-modules.md @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-powershell-modules.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-powershell-modules.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-powershell-profiles.md b/docs/list-powershell-profiles.md index a63b64e6b..e6c12128e 100644 --- a/docs/list-powershell-profiles.md +++ b/docs/list-powershell-profiles.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-powershell-profiles.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-powershell-profiles.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-powershell-verbs.md b/docs/list-powershell-verbs.md index 7663c82d5..778bff747 100644 --- a/docs/list-powershell-verbs.md +++ b/docs/list-powershell-verbs.md @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-powershell-verbs.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-powershell-verbs.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-print-jobs.md b/docs/list-print-jobs.md index f9ddaa2fd..223ded498 100644 --- a/docs/list-print-jobs.md +++ b/docs/list-print-jobs.md @@ -87,4 +87,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-print-jobs.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-print-jobs.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-printers.md b/docs/list-printers.md index 5286b296b..296df0e3c 100644 --- a/docs/list-printers.md +++ b/docs/list-printers.md @@ -59,4 +59,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-printers.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-printers.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-processes.md b/docs/list-processes.md index 75cf0d8b7..3462d64e0 100644 --- a/docs/list-processes.md +++ b/docs/list-processes.md @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-processes.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-processes.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-public-ip.md b/docs/list-public-ip.md index 4f30d8c56..43d708a60 100644 --- a/docs/list-public-ip.md +++ b/docs/list-public-ip.md @@ -70,4 +70,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-public-ip.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-public-ip.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-pull-requests.md b/docs/list-pull-requests.md index 67e2a75cf..ea3d8b04a 100644 --- a/docs/list-pull-requests.md +++ b/docs/list-pull-requests.md @@ -83,4 +83,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-pull-requests.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-pull-requests.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-ram.md b/docs/list-ram.md index 8b8d4eb86..db7f4ef67 100644 --- a/docs/list-ram.md +++ b/docs/list-ram.md @@ -63,4 +63,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-ram.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-ram.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-read-only-files.md b/docs/list-read-only-files.md index 7e84b591c..25358fe83 100644 --- a/docs/list-read-only-files.md +++ b/docs/list-read-only-files.md @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-read-only-files.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-read-only-files.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-recycle-bin.md b/docs/list-recycle-bin.md index e503f4edc..a5b8f7e6c 100644 --- a/docs/list-recycle-bin.md +++ b/docs/list-recycle-bin.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-recycle-bin.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-recycle-bin.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-repos.md b/docs/list-repos.md index 913f1e545..2133f82bc 100644 --- a/docs/list-repos.md +++ b/docs/list-repos.md @@ -1,7 +1,7 @@ Script: *list-repos.ps1* ======================== -This PowerShell script lists details of all Git repositories in a folder. +This PowerShell script lists all Git repositories in a folder with details such as latest tag/branch/status/URL. Parameters ---------- @@ -25,13 +25,13 @@ PS> ./list-repos.ps1 [[-parentDir] ] [] Example ------- ```powershell -PS> ./list-repos C:\MyRepos +PS> ./list-repos.ps1 C:\Repos -Repository Latest Tag Branch Status Remote URL ----------- ---------- ------ ------ ---------- -πŸ“‚cmake v3.23.0 main βœ”οΈclean git@github.com:Kitware/CMake ↓0 +Local Repo Latest Tag Branch Status Remote Repo +---------- ---------- ------ ------ ----------- +πŸ“‚cmake v3.23.0 main βœ”οΈclean ↓0 git@github.com:Kitware/CMake ... ``` @@ -49,17 +49,17 @@ Script Content ```powershell <# .SYNOPSIS - Lists Git repos + Lists Git repositories .DESCRIPTION - This PowerShell script lists details of all Git repositories in a folder. + This PowerShell script lists all Git repositories in a folder with details such as latest tag/branch/status/URL. .PARAMETER parentDir Specifies the path to the parent directory (current working directory by default) .EXAMPLE - PS> ./list-repos C:\MyRepos + PS> ./list-repos.ps1 C:\Repos - Repository Latest Tag Branch Status Remote URL - ---------- ---------- ------ ------ ---------- - πŸ“‚cmake v3.23.0 main βœ”οΈclean git@github.com:Kitware/CMake ↓0 + Local Repo Latest Tag Branch Status Remote Repo + ---------- ---------- ------ ------ ----------- + πŸ“‚cmake v3.23.0 main βœ”οΈclean ↓0 git@github.com:Kitware/CMake ... .LINK https://github.com/fleschutz/PowerShell @@ -84,8 +84,8 @@ function ListRepos { $numCommits = (git -C "$folder" rev-list HEAD...origin/$branch --count) $status = (git -C "$folder" status --short) if ("$status" -eq "") { $status = "βœ”οΈclean" } - elseif ("$status" -like " M *") { $status = "⚠️modified" } - New-Object PSObject -property @{'Repository'="πŸ“‚$folderName";'Latest Tag'="$latestTag";'Branch'="$branch";'Status'="$status";'Remote URL'="$remoteURL ↓$numCommits";} + elseif ("$status" -like " M *") { $status = "⚠️changed" } + New-Object PSObject -property @{'Local Repo'="πŸ“‚$folderName";'Latest Tag'="$latestTag";'Branch'="$branch";'Status'="$status";'Remote Repo'="↓$numCommits $remoteURL"} } } @@ -95,7 +95,7 @@ try { $null = (git --version) if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } - ListRepos | Format-Table -property @{e='Repository';width=19},@{e='Latest Tag';width=18},@{e='Branch';width=20},@{e='Status';width=10},'Remote URL' + ListRepos | Format-Table -property @{e='Local Repo';width=19},@{e='Latest Tag';width=16},@{e='Branch';width=19},@{e='Status';width=10},'Remote Repo' exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -103,4 +103,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-repos.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-repos.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-scripts.md b/docs/list-scripts.md index 9167091ec..c7aebd605 100644 --- a/docs/list-scripts.md +++ b/docs/list-scripts.md @@ -70,4 +70,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-scripts.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-scripts.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-services.md b/docs/list-services.md index e149df129..295451ff1 100644 --- a/docs/list-services.md +++ b/docs/list-services.md @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-services.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-services.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-special-folders.md b/docs/list-special-folders.md index 844972cb9..8ef9e35b4 100644 --- a/docs/list-special-folders.md +++ b/docs/list-special-folders.md @@ -105,4 +105,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-special-folders.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-special-folders.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-sql-tables.md b/docs/list-sql-tables.md index 0969f899c..0ad2e419e 100644 --- a/docs/list-sql-tables.md +++ b/docs/list-sql-tables.md @@ -93,4 +93,4 @@ $result = Invoke-SqlServerQuery -Credential $creds -ConnectionTimeout 10000 -Dat $result | Export-Csv $csvfilepath -NoTypeInformation ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-sql-tables.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-sql-tables.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-submodules.md b/docs/list-submodules.md index 7d37adbb2..bbab25e78 100644 --- a/docs/list-submodules.md +++ b/docs/list-submodules.md @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-submodules.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-submodules.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-suggestions.md b/docs/list-suggestions.md index 669f3e4d4..51a98b6e9 100644 --- a/docs/list-suggestions.md +++ b/docs/list-suggestions.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-suggestions.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-suggestions.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-system-files.md b/docs/list-system-files.md index 853145168..6664a2e1c 100644 --- a/docs/list-system-files.md +++ b/docs/list-system-files.md @@ -81,4 +81,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-system-files.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-system-files.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-system-info.md b/docs/list-system-info.md index d46db9cd4..626725880 100644 --- a/docs/list-system-info.md +++ b/docs/list-system-info.md @@ -141,4 +141,4 @@ $info exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-system-info.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-system-info.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-tags.md b/docs/list-tags.md index da4dce931..f3c3216cf 100644 --- a/docs/list-tags.md +++ b/docs/list-tags.md @@ -81,17 +81,18 @@ Script Content param([string]$repoDir = "$PWD", [string]$searchPattern="*") try { - Write-Progress "(1/3) Searching for Git executable... " + Write-Progress "(1/4) 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 local repository... " + Write-Progress "(2/4) Checking local repository... " if (-not(Test-Path "$repoDir" -pathType container)) { throw "Can't access directory: $repoDir" } - Write-Progress "(3/3) Updating Git tags from remote..." + Write-Progress "(3/4) Fetching newer Git tags..." & git -C "$repoDir" fetch --tags if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" } + Write-Progress "(4/4) Fetching out-dated Git tags..." & git -C "$repoDir" fetch --prune-tags if ($lastExitCode -ne "0") { throw "'git fetch --prune-tags' failed" } @@ -109,4 +110,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-tags.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-tags.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-tasks.md b/docs/list-tasks.md index aae5f9d10..f4c949aba 100644 --- a/docs/list-tasks.md +++ b/docs/list-tasks.md @@ -44,4 +44,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-tasks.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-tasks.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-timezone.md b/docs/list-timezone.md index 6ccebe753..601807c19 100644 --- a/docs/list-timezone.md +++ b/docs/list-timezone.md @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-timezone.ps1 as of 03/27/2024 17:36:28)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-timezone.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-timezones.md b/docs/list-timezones.md index 01e082674..76b219209 100644 --- a/docs/list-timezones.md +++ b/docs/list-timezones.md @@ -67,4 +67,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-timezones.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-timezones.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-tiobe-index.md b/docs/list-tiobe-index.md index 0b8f29422..c07ebebd6 100644 --- a/docs/list-tiobe-index.md +++ b/docs/list-tiobe-index.md @@ -78,4 +78,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-tiobe-index.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-tiobe-index.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-unused-files.md b/docs/list-unused-files.md index 1f0d7d6a0..36becfbde 100644 --- a/docs/list-unused-files.md +++ b/docs/list-unused-files.md @@ -95,4 +95,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-unused-files.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-unused-files.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-updates.md b/docs/list-updates.md index 980969872..165be62b9 100644 --- a/docs/list-updates.md +++ b/docs/list-updates.md @@ -84,4 +84,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-updates.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-updates.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-user-accounts.md b/docs/list-user-accounts.md index fbe117a60..cdd644aff 100644 --- a/docs/list-user-accounts.md +++ b/docs/list-user-accounts.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-user-accounts.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-user-accounts.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-user-groups.md b/docs/list-user-groups.md index ef730e7bf..68dbd1a99 100644 --- a/docs/list-user-groups.md +++ b/docs/list-user-groups.md @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-user-groups.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-user-groups.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-voices.md b/docs/list-voices.md index 2f202fb81..0bda2dcd5 100644 --- a/docs/list-voices.md +++ b/docs/list-voices.md @@ -71,4 +71,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-voices.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-voices.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-weather.md b/docs/list-weather.md index ffb1c035c..d4e708c5c 100644 --- a/docs/list-weather.md +++ b/docs/list-weather.md @@ -1,15 +1,15 @@ Script: *list-weather.ps1* ======================== -This PowerShell script lists the hourly weather report in a nice table. +This PowerShell script queries the 48h weather report from wttr.in and lists it in a nice table. Parameters ---------- ```powershell -PS> ./list-weather.ps1 [[-Location] ] [] +PS> ./list-weather.ps1 [[-location] ] [] --Location - Specifies the location to use (determined automatically per default) +-location + Specifies the location to use (determined automatically by default) Required? false Position? 1 @@ -26,8 +26,8 @@ Example ------- ```powershell PS> ./list-weather.ps1 -TODAY 🌑°C β˜‚οΈmm πŸ’§ πŸ’¨km/h β˜€οΈUV ☁️ πŸ‘km at Munich (Bayern, Germany) - 0°° -2Β° 0.0 93% β†— 6 1 21% 10 πŸŒ™ clear +TODAY 🌑°C β˜‚οΈmm πŸ’§ πŸ’¨km/h β˜€οΈUV ☁️ πŸ‘km at Munich (Bayern, Germany) + 0h 11Β° 0.0 88% β†– 7 1 8% 10 πŸŒ™ clear ... ``` @@ -47,13 +47,13 @@ Script Content .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) + This PowerShell script queries the 48h weather report from wttr.in and lists it in a nice table. +.PARAMETER location + Specifies the location to use (determined automatically by default) .EXAMPLE PS> ./list-weather.ps1 - TODAY 🌑°C β˜‚οΈmm πŸ’§ πŸ’¨km/h β˜€οΈUV ☁️ πŸ‘km at Munich (Bayern, Germany) - 0°° -2Β° 0.0 93% β†— 6 1 21% 10 πŸŒ™ clear + TODAY 🌑°C β˜‚οΈmm πŸ’§ πŸ’¨km/h β˜€οΈUV ☁️ πŸ‘km at Munich (Bayern, Germany) + 0h 11Β° 0.0 88% β†– 7 1 8% 10 πŸŒ™ clear ... .LINK https://github.com/fleschutz/PowerShell @@ -61,16 +61,17 @@ Script Content Author: Markus Fleschutz | License: CC0 #> -param([string]$Location = "") # empty means determine automatically +param([string]$location = "") # empty means determine automatically -function GetDescription { param([string]$text) - switch ($text.trim()) { +function GetDescription([string]$text) { + switch ($text) { "Blizzard" { return "❄️ blizzard ⚠️" } "Blowing snow" { return "❄️ blowing snow ⚠️" } "Clear" { return "πŸŒ™ clear" } "Cloudy" { return "☁️ cloudy" } "Fog" { return "🌫 fog" } "Freezing fog" { return "🌫 freezing fog" } + "Heavy rain" { return "πŸ’§ heavy rain ⚠️" } "Heavy snow" { return "❄️ heavy snow ⚠️" } "Light drizzle" { return "πŸ’§ light drizzle" } "Light freezing rain" { return "πŸ’§ light freezing rain ⚠️" } @@ -83,8 +84,9 @@ function GetDescription { param([string]$text) "Moderate or heavy freezing rain"{return "πŸ’§ moderate or heavy freezing rain ⚠️" } "Moderate or heavy sleet" { return "❄️ moderate or heavy sleet ⚠️" } "Moderate or heavy rain shower" { return "πŸ’§ moderate or heavy rain shower ⚠️" } + "Moderate or heavy rain in area with thunder" { return "πŸ’§ moderate or heavy rain in area with thunder ⚠️" } "Moderate or heavy snow showers"{ return "❄️ moderate or heavy snow showers ⚠️" } - "Moderate or heavy snow in area with thunder" { return "❄️ moderate or heavy snow with thunder ⚠️" } + "Moderate or heavy snow in area with thunder" { return "❄️ moderate or heavy snow in area with thunder ⚠️" } "Moderate rain" { return "πŸ’§ moderate rain" } "Moderate rain at times" { return "πŸ’§ moderate rain at times" } "Moderate snow" { return "❄️ moderate snow" } @@ -94,6 +96,7 @@ function GetDescription { param([string]$text) "Patchy heavy snow" { return "❄️ patchy heavy snow ⚠️" } "Patchy light drizzle" { return "πŸ’§ patchy light drizzle" } "Patchy light rain" { return "πŸ’§ patchy light rain" } + "Patchy light rain in area with thunder" { return "πŸ’§ patchy light rain in area with thunder" } "Patchy light rain with thunder" { return "πŸ’§ patchy light rain with thunder" } "Patchy light snow" { return "❄️ patchy light snow" } "Patchy moderate snow" { return "❄️ patchy moderate snow" } @@ -103,12 +106,13 @@ function GetDescription { param([string]$text) "Patchy snow possible" { return "❄️ patchy snow possible" } "Sunny" { return "β˜€οΈ sunny" } "Thundery outbreaks possible" { return "⚑️thundery outbreaks possible" } - default { return "$Text" } + "Thundery outbreaks in nearby" { return "⚑️thundery outbreaks in nearby" } + default { return $text } } } -function GetWindDir { param([string]$Text) - switch($Text) { +function GetWindDir([string]$text) { + switch($text) { "NW" { return "β†˜" } "NNW" { return "↓" } "N" { return "↓" } @@ -125,45 +129,46 @@ function GetWindDir { param([string]$Text) "WSW" { return "β†’" } "W" { return "β†’" } "WNW" { return "β†’" } - default { return "$Text" } + default { return "$text" } } } try { Write-Progress "Loading weather data from http://wttr.in ..." - $Weather = (Invoke-WebRequest -URI http://wttr.in/${Location}?format=j1 -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json - Write-Progress -completed "." - $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) { - $Date = (Get-Date).AddDays(1) - [string]$Weekday = $Date.DayOfWeek - Write-Host -foregroundColor green "$($Weekday.toUpper())" + $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 + Write-Progress -completed "Done." + + [int]$day = 0 + foreach($hourly in $weather.weather.hourly) { + $hour = $hourly.time / 100 + $tempC = $(($hourly.tempC.toString()).PadLeft(3)) + $precip = $($($hourly.precipMM).PadLeft(4)) + $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.trim() + if ($hour -eq 0) { + if ($day -eq 0) { + Write-Host "TODAY 🌑°C β˜‚οΈmm πŸ’§ πŸ’¨km/h β˜€οΈUV ☁️ πŸ‘km at $area ($region, $country)" -foregroundColor green + } elseif ($day -eq 1) { + $date = (Get-Date).AddDays(1) + [string]$dayOfWeek = $date.DayOfWeek + Write-Host "$($dayOfWeek.toUpper())" -foregroundColor green } else { - $Date = (Get-Date).AddDays(2) - [string]$Weekday = $Date.DayOfWeek - Write-Host -foregroundColor green "$($Weekday.toUpper())" + $date = (Get-Date).AddDays(2) + [string]$dayOfWeek = $date.DayOfWeek + Write-Host "$($dayOfWeek.toUpper())" -foregroundColor green } - $Day++ + $day++ } - "$(($Hour.toString()).PadLeft(2))°° $TempΒ° $Precip $Humidity% $($WindDir)$WindSpeed $UV $Clouds% $Visib $Desc" + "$(($hour.toString()).PadLeft(2))h $tempCΒ° $precip $humidity% $($windDir)$windSpeed $UV $clouds% $visib $desc" } exit 0 # success } catch { @@ -172,4 +177,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-weather.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-weather.ps1 as of 05/19/2024 10:25:22)* diff --git a/docs/list-wifi.md b/docs/list-wifi.md index 49e218e45..1ceb3854c 100644 --- a/docs/list-wifi.md +++ b/docs/list-wifi.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-wifi.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-wifi.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/list-window-titles.md b/docs/list-window-titles.md index 211aec9fa..c48254fe9 100644 --- a/docs/list-window-titles.md +++ b/docs/list-window-titles.md @@ -20,8 +20,8 @@ PS> ./list-window-titles.ps1 -Id Name MainWindowTitle - -- ---- --------------- +Id ProcessName MainWindowTitle + -- ----------- --------------- 11556 Spotify Spotify Free ... @@ -46,8 +46,8 @@ Script Content .EXAMPLE PS> ./list-window-titles.ps1 - Id Name MainWindowTitle - -- ---- --------------- + Id ProcessName MainWindowTitle + -- ----------- --------------- 11556 Spotify Spotify Free ... .LINK @@ -57,7 +57,7 @@ Script Content #> try { - Get-Process | Where-Object {$_.mainWindowTitle} | Format-Table Id,Name,mainWindowtitle -AutoSize + Get-Process | Where-Object {$_.mainWindowTitle} | Format-Table ID,ProcessName,MainWindowTitle -AutoSize exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-window-titles.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-window-titles.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/list-workdir.md b/docs/list-workdir.md index 1e830af8f..b9f9fd6e6 100644 --- a/docs/list-workdir.md +++ b/docs/list-workdir.md @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-workdir.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-workdir.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/list-wsl-distros.md b/docs/list-wsl-distros.md index 9329f03bb..cb075c443 100644 --- a/docs/list-wsl-distros.md +++ b/docs/list-wsl-distros.md @@ -23,4 +23,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of list-wsl-distros.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of list-wsl-distros.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/locate-city.md b/docs/locate-city.md index e3536d0e1..3c080ff83 100644 --- a/docs/locate-city.md +++ b/docs/locate-city.md @@ -6,10 +6,10 @@ This PowerShell script prints the geographic location of the given city. Parameters ---------- ```powershell -PS> ./locate-city.ps1 [[-City] ] [] +PS> ./locate-city.ps1 [[-city] ] [] --City - Specifies the city to look for +-city + Specifies the name of the city to look for Required? false Position? 1 @@ -25,7 +25,9 @@ PS> ./locate-city.ps1 [[-City] ] [] Example ------- ```powershell -PS> ./locate-city.ps1 Paris +PS> ./locate-city.ps1 Amsterdam +* Amsterdam (United States, New York, population 21241) is at 42.9420Β°N, -74.1907Β°W +* Amsterdam (Netherlands, Noord-Holland, population 1031000) is at 52.3500Β°N, 4.9166Β°W ``` @@ -45,46 +47,44 @@ Script Content 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 +.PARAMETER city + Specifies the name of the city to look for .EXAMPLE - PS> ./locate-city.ps1 Paris + PS> ./locate-city.ps1 Amsterdam + * Amsterdam (United States, New York, population 21241) is at 42.9420Β°N, -74.1907Β°W + * Amsterdam (Netherlands, Noord-Holland, population 1031000) is at 52.3500Β°N, 4.9166Β°W .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> -param([string]$City = "") +param([string]$city = "") try { - if ($City -eq "" ) { $City = Read-Host "Enter the city name" } + if ($city -eq "" ) { $city = Read-Host "Enter the name of the city" } - Write-Progress "Reading worldcities.csv..." - $Table = import-csv "$PSScriptRoot/../data/worldcities.csv" + Write-Progress "Reading data/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" + $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 + if (-not $foundOne) { throw "No city '$city' found in database" } + exit 0 # success } catch { - "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + "⚠️ Error $($_.InvocationInfo.ScriptLineNumber): $($Error[0])." exit 1 } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of locate-city.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of locate-city.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/locate-ipaddress.md b/docs/locate-ipaddress.md index 846929ebb..c8b235358 100644 --- a/docs/locate-ipaddress.md +++ b/docs/locate-ipaddress.md @@ -46,4 +46,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of locate-ipaddress.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of locate-ipaddress.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/locate-my-phone.md b/docs/locate-my-phone.md index 01b8e8733..4f0d48332 100644 --- a/docs/locate-my-phone.md +++ b/docs/locate-my-phone.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of locate-my-phone.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of locate-my-phone.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/locate-zip-code.md b/docs/locate-zip-code.md index 0913bebe4..9a9c73c4e 100644 --- a/docs/locate-zip-code.md +++ b/docs/locate-zip-code.md @@ -101,4 +101,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of locate-zip-code.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of locate-zip-code.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/lock-desktop.md b/docs/lock-desktop.md index 6f5c96e74..819b6ab92 100644 --- a/docs/lock-desktop.md +++ b/docs/lock-desktop.md @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of lock-desktop.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of lock-desktop.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/log-off.md b/docs/log-off.md index 7719f9916..6c5f65070 100644 --- a/docs/log-off.md +++ b/docs/log-off.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of log-off.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of log-off.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/make-install.md b/docs/make-install.md index 5f8424f9f..64f28db76 100644 --- a/docs/make-install.md +++ b/docs/make-install.md @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of make-install.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of make-install.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/measure-BubbleSort.md b/docs/measure-BubbleSort.md index d6dc91fda..68489a883 100644 --- a/docs/measure-BubbleSort.md +++ b/docs/measure-BubbleSort.md @@ -92,4 +92,4 @@ $elapsed3 = "{0:N3}" -f $elapsed # formatted to 3 decimal places exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-BubbleSort.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-BubbleSort.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/measure-BucketSort.md b/docs/measure-BucketSort.md index 362f2e2ee..fd515a3ef 100644 --- a/docs/measure-BucketSort.md +++ b/docs/measure-BucketSort.md @@ -120,4 +120,4 @@ $elapsed3 = "{0:N3}" -f $elapsed # formatted to 3 decimal places exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-BucketSort.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-BucketSort.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/measure-CountingSort.md b/docs/measure-CountingSort.md index 6e6f1bada..3327b7805 100644 --- a/docs/measure-CountingSort.md +++ b/docs/measure-CountingSort.md @@ -111,4 +111,4 @@ $elapsed3 = "{0:N3}" -f $elapsed # formatted to 3 decimal places exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-CountingSort.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-CountingSort.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/measure-HeapSort.md b/docs/measure-HeapSort.md index f1a2aa2e0..47aa95ebf 100644 --- a/docs/measure-HeapSort.md +++ b/docs/measure-HeapSort.md @@ -126,4 +126,4 @@ $elapsed3 = "{0:N3}" -f $elapsed # formatted to 3 decimal places exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-HeapSort.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-HeapSort.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/measure-InsertionSort.md b/docs/measure-InsertionSort.md index 32fb17581..f602b75f1 100644 --- a/docs/measure-InsertionSort.md +++ b/docs/measure-InsertionSort.md @@ -95,4 +95,4 @@ $elapsed3 = "{0:N3}" -f $elapsed # formatted to 3 decimal places exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-InsertionSort.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-InsertionSort.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/measure-MergeSort.md b/docs/measure-MergeSort.md index 2a51e1a1e..2b8b24c7c 100644 --- a/docs/measure-MergeSort.md +++ b/docs/measure-MergeSort.md @@ -120,4 +120,4 @@ $elapsed3 = "{0:N3}" -f $elapsed # formatted to 3 decimal places exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-MergeSort.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-MergeSort.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/measure-QuickSort.md b/docs/measure-QuickSort.md index 088bcf961..e3858faaa 100644 --- a/docs/measure-QuickSort.md +++ b/docs/measure-QuickSort.md @@ -101,4 +101,4 @@ $elapsed3 = "{0:N3}" -f $elapsed # formatted to 3 decimal places exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-QuickSort.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-QuickSort.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/measure-SelectionSort.md b/docs/measure-SelectionSort.md index 7fd82e2f2..9abf97ced 100644 --- a/docs/measure-SelectionSort.md +++ b/docs/measure-SelectionSort.md @@ -94,4 +94,4 @@ $elapsed3 = "{0:N3}" -f $elapsed # formatted to 3 decimal places exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-SelectionSort.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-SelectionSort.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/measure-sorting-algorithms.md b/docs/measure-sorting-algorithms.md index 2906c7533..236124f27 100644 --- a/docs/measure-sorting-algorithms.md +++ b/docs/measure-sorting-algorithms.md @@ -73,4 +73,4 @@ param([int]$numIntegers = 3000) exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of measure-sorting-algorithms.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of measure-sorting-algorithms.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/merry-christmas.md b/docs/merry-christmas.md index c75aa7620..4b0165dc5 100644 --- a/docs/merry-christmas.md +++ b/docs/merry-christmas.md @@ -50,4 +50,4 @@ $Reply = "Merry Christmas to you too!", "Happy Christmas to you too!" | Get-Rand exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of merry-christmas.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of merry-christmas.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/minimize-all-windows.md b/docs/minimize-all-windows.md index 9316bd894..facf84dea 100644 --- a/docs/minimize-all-windows.md +++ b/docs/minimize-all-windows.md @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of minimize-all-windows.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of minimize-all-windows.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/move-mouse-pointer.md b/docs/move-mouse-pointer.md index adf3d41ed..023b2971d 100644 --- a/docs/move-mouse-pointer.md +++ b/docs/move-mouse-pointer.md @@ -84,4 +84,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of move-mouse-pointer.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of move-mouse-pointer.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/move-vm.md b/docs/move-vm.md index a2e0b8d23..cd3980a98 100644 --- a/docs/move-vm.md +++ b/docs/move-vm.md @@ -22,4 +22,4 @@ Move-VM $VMName HOST2 -IncludeStorage -DestinationStoragePath "D:\VirtualMachine exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of move-vm.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of move-vm.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/my-profile.md b/docs/my-profile.md index 5bd6cee14..0092bfe5c 100644 --- a/docs/my-profile.md +++ b/docs/my-profile.md @@ -17,14 +17,17 @@ Parameters Script Content -------------- ```powershell -# MY POWERSHELL PROFILE (this profile file defines the look & feel of PowerShell) +# MY POWERSHELL PROFILE (defines the look & feel of PowerShell) # WINDOW TITLE if ($IsLinux) { $Username = $(whoami) } else { $Username = $env:USERNAME } $host.ui.RawUI.WindowTitle = "$Username @ $(hostname)" +# GREETING +Write-Host "Welcome $USERNAME at $(hostname), what's up?" -foregroundColor green + # COMMAND PROMPT -function prompt { Write-Host -noNewline -foregroundColor yellow "`n➀ "; return " " } +function prompt { Write-Host "`n➀ " -noNewline -foregroundColor yellow; return " " } # ALIAS NAMES del alias:pwd -force -errorAction SilentlyContinue @@ -34,4 +37,4 @@ del alias:ls -force -errorAction SilentlyContinue set-alias -name ls -value list-folder.ps1 # ls = list folder (short format) ``` -*(generated by convert-ps2md.ps1 using the comment-based help of my-profile.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of my-profile.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/new-branch.md b/docs/new-branch.md index d93a0c3a6..09d8170df 100644 --- a/docs/new-branch.md +++ b/docs/new-branch.md @@ -1,7 +1,7 @@ Script: *new-branch.ps1* ======================== -This PowerShell script creates a new Git branch in a local repository and switches to it. +This PowerShell script creates a new branch in a local Git repository and switches to it. Parameters ---------- @@ -9,7 +9,7 @@ Parameters PS> ./new-branch.ps1 [[-newBranch] ] [[-pathToRepo] ] [] -newBranch - Specifies the new Git branch name (check the allowed characters) + Specifies the new Git branch name Required? false Position? 1 @@ -18,7 +18,7 @@ PS> ./new-branch.ps1 [[-newBranch] ] [[-pathToRepo] ] [ - Specifies the file path to the local repository (current working directory per default) + Specifies the file path to the local Git repository (current working directory per default) Required? false Position? 2 @@ -36,12 +36,12 @@ Example ```powershell PS> ./new-branch.ps1 test123 C:\Repos\rust ⏳ (1/6) Searching for Git executable... git version 2.42.0.windows.2 -⏳ (2/6) Checking Git repository... -⏳ (3/6) Fetching updates... +⏳ (2/6) Checking local repository... πŸ“‚C:\Repos\rust +⏳ (3/6) Fetching remote updates... ⏳ (4/6) Creating new branch... ⏳ (5/6) Pushing updates... ⏳ (6/6) Updating submodules... -βœ”οΈ Created branch 'test123' in πŸ“‚rust repository in 18 sec (based on 'main') +βœ”οΈ Created branch 'test123' in repo πŸ“‚rust (based on 'main', took 18s) ``` @@ -58,22 +58,22 @@ Script Content ```powershell <# .SYNOPSIS - Creates a new branch + Creates a new Git branch .DESCRIPTION - This PowerShell script creates a new Git branch in a local repository and switches to it. + This PowerShell script creates a new branch in a local Git repository and switches to it. .PARAMETER newBranch - Specifies the new Git branch name (check the allowed characters) + Specifies the new Git branch name .PARAMETER pathToRepo - Specifies the file path to the local repository (current working directory per default) + Specifies the file path to the local Git repository (current working directory per default) .EXAMPLE PS> ./new-branch.ps1 test123 C:\Repos\rust ⏳ (1/6) Searching for Git executable... git version 2.42.0.windows.2 - ⏳ (2/6) Checking Git repository... - ⏳ (3/6) Fetching updates... + ⏳ (2/6) Checking local repository... πŸ“‚C:\Repos\rust + ⏳ (3/6) Fetching remote updates... ⏳ (4/6) Creating new branch... ⏳ (5/6) Pushing updates... ⏳ (6/6) Updating submodules... - βœ”οΈ Created branch 'test123' in πŸ“‚rust repository in 18 sec (based on 'main') + βœ”οΈ Created branch 'test123' in repo πŸ“‚rust (based on 'main', took 18s) .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -91,11 +91,13 @@ try { & git --version if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } - Write-Host "⏳ (2/6) Checking Git repository..." - if (-not(Test-Path "$pathToRepo" -pathType container)) { throw "Can't access directory: $pathToRepo" } + Write-Host "⏳ (2/6) Checking local repository... πŸ“‚$pathToRepo" + if (-not(Test-Path "$pathToRepo" -pathType container)) { throw "Can't access repo folder: $pathToRepo" } + $result = (git -C "$pathToRepo" status) + if ($lastExitCode -ne "0") { throw "'git status' in $pathToRepo failed with exit code $lastExitCode" } $repoName = (Get-Item "$pathToRepo").Name - "⏳ (3/6) Fetching updates..." + "⏳ (3/6) Fetching remote updates..." & git -C "$pathToRepo" fetch --all --recurse-submodules --prune --prune-tags --force if ($lastExitCode -ne "0") { throw "'git fetch' failed with exit code $lastExitCode" } @@ -115,7 +117,7 @@ try { if ($lastExitCode -ne "0") { throw "'git submodule update' failed with exit code $lastExitCode" } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Created branch '$newBranch' in πŸ“‚$repoName repository in $elapsed sec (based on '$currentBranch')" + "βœ”οΈ Created branch '$newBranch' in repo πŸ“‚$repoName (based on '$currentBranch', took $($elapsed)s)" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -123,4 +125,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-branch.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-branch.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/new-dir.md b/docs/new-dir.md new file mode 100644 index 000000000..c54baccb2 --- /dev/null +++ b/docs/new-dir.md @@ -0,0 +1,78 @@ +Script: *new-dir.ps1* +======================== + +This PowerShell script creates an empty new directory in the filesystem. + +Parameters +---------- +```powershell +PS> ./new-dir.ps1 [[-path] ] [] + +-path + Specifies the path and filename of the new directory + + Required? false + Position? 1 + Default value + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./new-dir.ps1 MyCollection +βœ”οΈ New πŸ“‚C:\Temp\MyCollection created. + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Creates a new directory +.DESCRIPTION + This PowerShell script creates an empty new directory in the filesystem. +.PARAMETER path + Specifies the path and filename of the new directory +.EXAMPLE + PS> ./new-dir.ps1 MyCollection + βœ”οΈ New πŸ“‚C:\Temp\MyCollection created. +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([string]$path = "") + +try { + if ($path -eq "") { $path = Read-Host "Enter the filename (and path) of the new directory" } + + if (Test-Path $path) { throw "Directory at $path already exists" } + + $null = (New-Item -itemType directory -path $path) + + $path = Resolve-Path $path + "βœ”οΈ New πŸ“‚$path created." + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of new-dir.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/new-email.md b/docs/new-email.md index 64a7a4b45..bacf7cdac 100644 --- a/docs/new-email.md +++ b/docs/new-email.md @@ -67,4 +67,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-email.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-email.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/new-linux-vm.md b/docs/new-linux-vm.md index 539ce29d1..7619d51b4 100644 --- a/docs/new-linux-vm.md +++ b/docs/new-linux-vm.md @@ -38,4 +38,4 @@ $VMName = "linux" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-linux-vm.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-linux-vm.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/new-qrcode.md b/docs/new-qrcode.md index 91701c106..f77fbc107 100644 --- a/docs/new-qrcode.md +++ b/docs/new-qrcode.md @@ -101,4 +101,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-qrcode.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-qrcode.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/new-script.md b/docs/new-script.md index 2df043118..57014dfc1 100644 --- a/docs/new-script.md +++ b/docs/new-script.md @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-script.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-script.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/new-shortcut.md b/docs/new-shortcut.md index 43b240c52..2f3485914 100644 --- a/docs/new-shortcut.md +++ b/docs/new-shortcut.md @@ -100,4 +100,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-shortcut.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-shortcut.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/new-symlink.md b/docs/new-symlink.md index 6f6138ae0..15bc05fbf 100644 --- a/docs/new-symlink.md +++ b/docs/new-symlink.md @@ -82,4 +82,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-symlink.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-symlink.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/new-tag.md b/docs/new-tag.md index 911185121..a396e10b8 100644 --- a/docs/new-tag.md +++ b/docs/new-tag.md @@ -101,4 +101,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-tag.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-tag.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/new-user.md b/docs/new-user.md index 7f9056d0b..f5aae69c2 100644 --- a/docs/new-user.md +++ b/docs/new-user.md @@ -25,7 +25,7 @@ Example ------- ```powershell PS> ./new-user.ps1 Joe -βœ”οΈ Created new user 'Joe' with encrypted home directory in 11 sec +βœ”οΈ Created new user 'Joe' with encrypted home directory in 11s. ``` @@ -47,7 +47,7 @@ Script Content This PowerShell script creates a new user account with an encrypted home directory. .EXAMPLE PS> ./new-user.ps1 Joe - βœ”οΈ Created new user 'Joe' with encrypted home directory in 11 sec + βœ”οΈ Created new user 'Joe' with encrypted home directory in 11s. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -67,7 +67,7 @@ try { } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Created new user '$username' with encrypted home directory in $elapsed sec" + "βœ”οΈ Created new user '$username' with encrypted home directory in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-user.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-user.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/new-windows-vm.md b/docs/new-windows-vm.md index 702fecf50..8c1f10cf3 100644 --- a/docs/new-windows-vm.md +++ b/docs/new-windows-vm.md @@ -37,4 +37,4 @@ $VMName = "windows" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-windows-vm.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-windows-vm.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/new-zipfile.md b/docs/new-zipfile.md index 43f0472aa..f9836c574 100644 --- a/docs/new-zipfile.md +++ b/docs/new-zipfile.md @@ -73,4 +73,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of new-zipfile.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of new-zipfile.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/on-desktop-login.md b/docs/on-desktop-login.md index 787ee04dd..ebf6f1e20 100644 --- a/docs/on-desktop-login.md +++ b/docs/on-desktop-login.md @@ -2,7 +2,7 @@ Script: *on-desktop-login.ps1* ======================== This PowerShell script executes some 'welcome' tasks on every desktop login by the user. -NOTE: For installation on Windows create and put a symbolic link to this script into the Autostart folder (usually at: C:\Users\\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup). +NOTE: for installation on Windows create and put a symbolic link to this script into the Autostart folder (usually at: C:\Users\\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup). Parameters ---------- @@ -34,10 +34,10 @@ Script Content ```powershell <# .SYNOPSIS - Executes tasks on every desktop login + Executes tasks on desktop login .DESCRIPTION This PowerShell script executes some 'welcome' tasks on every desktop login by the user. - NOTE: For installation on Windows create and put a symbolic link to this script into the Autostart folder (usually at: C:\Users\\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup). + NOTE: for installation on Windows create and put a symbolic link to this script into the Autostart folder (usually at: C:\Users\\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup). .EXAMPLE PS> ./on-desktop-login.ps1 .LINK @@ -66,6 +66,7 @@ try { & "$PSScriptRoot/cd-repos.ps1" & "$PSScriptRoot/fetch-repos.ps1" " " + & "$PSScriptRoot/play-big-ben.ps1" & "$PSScriptRoot/write-clock.ps1" exit 0 # success } catch { @@ -74,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of on-desktop-login.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of on-desktop-login.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-apps-folder.md b/docs/open-apps-folder.md index 9af237ca2..4542bcf5d 100644 --- a/docs/open-apps-folder.md +++ b/docs/open-apps-folder.md @@ -49,4 +49,4 @@ exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-apps-folder.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-apps-folder.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-auto-start-folder.md b/docs/open-auto-start-folder.md index 0fe424348..4c8e1f301 100644 --- a/docs/open-auto-start-folder.md +++ b/docs/open-auto-start-folder.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-auto-start-folder.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-auto-start-folder.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-bing-maps.md b/docs/open-bing-maps.md index 799ee0f4d..4e342f61a 100644 --- a/docs/open-bing-maps.md +++ b/docs/open-bing-maps.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-bing-maps.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-bing-maps.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-booking-com.md b/docs/open-booking-com.md index 90172cfe6..b4b6b2621 100644 --- a/docs/open-booking-com.md +++ b/docs/open-booking-com.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-booking-com.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-booking-com.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-c-drive.md b/docs/open-c-drive.md index 2fcad1c62..5cfa78156 100644 --- a/docs/open-c-drive.md +++ b/docs/open-c-drive.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-c-drive.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-c-drive.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-calculator.md b/docs/open-calculator.md index 113603193..c4880c436 100644 --- a/docs/open-calculator.md +++ b/docs/open-calculator.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-calculator.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-calculator.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-chrome.md b/docs/open-chrome.md index e0ac50f59..3cdc211b2 100644 --- a/docs/open-chrome.md +++ b/docs/open-chrome.md @@ -66,4 +66,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-chrome.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-chrome.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-clock.md b/docs/open-clock.md index f30e3e623..9d6040ab8 100644 --- a/docs/open-clock.md +++ b/docs/open-clock.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-clock.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-clock.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-cortana.md b/docs/open-cortana.md index b30cba99c..3e9c9f2a3 100644 --- a/docs/open-cortana.md +++ b/docs/open-cortana.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-cortana.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-cortana.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-d-drive.md b/docs/open-d-drive.md index 413441716..431f9d9aa 100644 --- a/docs/open-d-drive.md +++ b/docs/open-d-drive.md @@ -47,4 +47,4 @@ Script Content & "$PSScriptRoot/open-file-explorer.ps1" "D:" ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-d-drive.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-d-drive.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-dashboards.md b/docs/open-dashboards.md index f2b4cc65f..1b14aa4f9 100644 --- a/docs/open-dashboards.md +++ b/docs/open-dashboards.md @@ -6,10 +6,10 @@ This PowerShell script launches the Web browser with 20 tabs of popular dashboar Parameters ---------- ```powershell -PS> ./open-dashboards.ps1 [[-interval] ] [] +PS> ./open-dashboards.ps1 [[-timeInterval] ] [] --interval - Specifies the time interval (110ms per default) +-timeInterval + Specifies the time interval between each tab (110ms per default) Required? false Position? 1 @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./open-dashboards.ps1 -βœ… Launching Web browser with 20 tabs showing: Toggl Track, Google Calendar, Google Mail, ... +βœ… Launching Web browser with 20 tabs showing Toggl Trackβ€’Google Calendarβ€’Google Mail, ... NOTE: Execute './switch-tabs.ps1' to switch from tab to tab automatically. ... @@ -48,11 +48,11 @@ Script Content Open web dashboards .DESCRIPTION This PowerShell script launches the Web browser with 20 tabs of popular dashboard websites. -.PARAMETER interval - Specifies the time interval (110ms per default) +.PARAMETER timeInterval + Specifies the time interval between each tab (110ms per default) .EXAMPLE PS> ./open-dashboards.ps1 - βœ… Launching Web browser with 20 tabs showing: Toggl Track, Google Calendar, Google Mail, ... + βœ… Launching Web browser with 20 tabs showing Toggl Trackβ€’Google Calendarβ€’Google Mail, ... NOTE: Execute './switch-tabs.ps1' to switch from tab to tab automatically. ... .LINK @@ -61,19 +61,19 @@ Script Content Author: Markus Fleschutz | License: CC0 #> -param([int]$interval = 110) # milliseconds +param([int]$timeInterval = 110) # milliseconds try { Write-Progress "Reading Data/popular-dashboards.csv..." $table = Import-CSV "$PSScriptRoot/../data/popular-dashboards.csv" - $numRows = $table.Length Write-Progress -completed "Done." - Write-Host "βœ… Launching Web browser with 20 tabs showing: " -noNewline + Write-Host "βœ… Launching Web browser with 20 tabs showing " -noNewline + $numRows = $table.Length foreach($row in $table) { - Write-Host "$($row.NAME), " -noNewline + Write-Host "$($row.NAME)β€’" -noNewline & "$PSScriptRoot/open-default-browser.ps1" "$($row.URL)" - Start-Sleep -milliseconds $interval + Start-Sleep -milliseconds $timeInterval } Write-Host "" Write-Host "NOTE: Execute './switch-tabs.ps1' to switch from tab to tab automatically." @@ -84,4 +84,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-dashboards.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-dashboards.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-deep-l-translator.md b/docs/open-deep-l-translator.md index 5b2b3c7a8..45cef5fd6 100644 --- a/docs/open-deep-l-translator.md +++ b/docs/open-deep-l-translator.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-deep-l-translator.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-deep-l-translator.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-default-browser.md b/docs/open-default-browser.md index d2f9edef7..ae1f54bf7 100644 --- a/docs/open-default-browser.md +++ b/docs/open-default-browser.md @@ -66,4 +66,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-default-browser.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-default-browser.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-desktop-folder.md b/docs/open-desktop-folder.md index 593b2b092..73cf57899 100644 --- a/docs/open-desktop-folder.md +++ b/docs/open-desktop-folder.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-desktop-folder.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-desktop-folder.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-documents-folder.md b/docs/open-documents-folder.md index 82e92bea7..cd2c2d5b8 100644 --- a/docs/open-documents-folder.md +++ b/docs/open-documents-folder.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-documents-folder.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-documents-folder.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-downloads-folder.md b/docs/open-downloads-folder.md index 75cd7eafe..e09de1e45 100644 --- a/docs/open-downloads-folder.md +++ b/docs/open-downloads-folder.md @@ -61,4 +61,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-downloads-folder.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-downloads-folder.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-dropbox-folder.md b/docs/open-dropbox-folder.md index 7841b8517..e3ded0020 100644 --- a/docs/open-dropbox-folder.md +++ b/docs/open-dropbox-folder.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-dropbox-folder.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-dropbox-folder.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-duck-duck-go.md b/docs/open-duck-duck-go.md index 4f51e2f9c..276b287e5 100644 --- a/docs/open-duck-duck-go.md +++ b/docs/open-duck-duck-go.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-duck-duck-go.ps1 as of 03/27/2024 17:36:29)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-duck-duck-go.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-e-drive.md b/docs/open-e-drive.md index 351adc6e8..31670694b 100644 --- a/docs/open-e-drive.md +++ b/docs/open-e-drive.md @@ -47,4 +47,4 @@ Script Content & "$PSScriptRoot/open-file-explorer.ps1" "E:" ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-e-drive.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-e-drive.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-edge.md b/docs/open-edge.md index 6ed9b161b..1a25b0ef1 100644 --- a/docs/open-edge.md +++ b/docs/open-edge.md @@ -48,4 +48,4 @@ Start-Process microsoft-edge:// exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-edge.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-edge.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-egg-timer.md b/docs/open-egg-timer.md index 87f564a72..ae9a40774 100644 --- a/docs/open-egg-timer.md +++ b/docs/open-egg-timer.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-egg-timer.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-egg-timer.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-email-client.md b/docs/open-email-client.md index 39a65acd3..2162a6fd7 100644 --- a/docs/open-email-client.md +++ b/docs/open-email-client.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-email-client.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-email-client.ps1 as of 05/19/2024 10:25:23)* diff --git a/docs/open-f-drive.md b/docs/open-f-drive.md index dcaeaae40..4653bf0dd 100644 --- a/docs/open-f-drive.md +++ b/docs/open-f-drive.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-f-drive.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-f-drive.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-file-explorer.md b/docs/open-file-explorer.md index 1c7770487..ceba08c02 100644 --- a/docs/open-file-explorer.md +++ b/docs/open-file-explorer.md @@ -70,4 +70,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-file-explorer.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-file-explorer.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-fire-place.md b/docs/open-fire-place.md index cec484c53..65433b57e 100644 --- a/docs/open-fire-place.md +++ b/docs/open-fire-place.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-fire-place.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-fire-place.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-firefox.md b/docs/open-firefox.md index a0e86963a..eb74e1653 100644 --- a/docs/open-firefox.md +++ b/docs/open-firefox.md @@ -73,4 +73,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-firefox.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-firefox.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-flight-radar.md b/docs/open-flight-radar.md index b79941f29..8f99f4210 100644 --- a/docs/open-flight-radar.md +++ b/docs/open-flight-radar.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-flight-radar.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-flight-radar.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-g-drive.md b/docs/open-g-drive.md index 47ba3fade..35c2ff66b 100644 --- a/docs/open-g-drive.md +++ b/docs/open-g-drive.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-g-drive.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-g-drive.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-git-extensions.md b/docs/open-git-extensions.md index cb12c0866..48e9fa325 100644 --- a/docs/open-git-extensions.md +++ b/docs/open-git-extensions.md @@ -48,4 +48,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-git-extensions.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-git-extensions.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-google-books.md b/docs/open-google-books.md index 5c5ac6cf4..20db46d62 100644 --- a/docs/open-google-books.md +++ b/docs/open-google-books.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-books.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-books.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-google-calendar.md b/docs/open-google-calendar.md index b5a28eff0..b9bd078eb 100644 --- a/docs/open-google-calendar.md +++ b/docs/open-google-calendar.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-calendar.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-calendar.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-google-contacts.md b/docs/open-google-contacts.md index 23039f86b..aa6cc9328 100644 --- a/docs/open-google-contacts.md +++ b/docs/open-google-contacts.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-contacts.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-contacts.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-google-docs.md b/docs/open-google-docs.md index 3d84904fe..83f803006 100644 --- a/docs/open-google-docs.md +++ b/docs/open-google-docs.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-docs.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-docs.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-google-earth.md b/docs/open-google-earth.md index 4148c30da..b6b2b4221 100644 --- a/docs/open-google-earth.md +++ b/docs/open-google-earth.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-earth.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-earth.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-google-mail.md b/docs/open-google-mail.md index e9e0c6810..88de7a2fe 100644 --- a/docs/open-google-mail.md +++ b/docs/open-google-mail.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-mail.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-mail.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-google-maps.md b/docs/open-google-maps.md index 2e159842b..f55ea05b8 100644 --- a/docs/open-google-maps.md +++ b/docs/open-google-maps.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-maps.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-maps.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-google-news.md b/docs/open-google-news.md index 282a22398..0bafa3355 100644 --- a/docs/open-google-news.md +++ b/docs/open-google-news.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-news.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-news.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-google-photos.md b/docs/open-google-photos.md index 738b011e8..c3a4a93b9 100644 --- a/docs/open-google-photos.md +++ b/docs/open-google-photos.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-photos.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-photos.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-google-play.md b/docs/open-google-play.md index 9a6bb5d1b..97b8e2c31 100644 --- a/docs/open-google-play.md +++ b/docs/open-google-play.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-play.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-play.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-google-search.md b/docs/open-google-search.md index e91d41d69..4244433f8 100644 --- a/docs/open-google-search.md +++ b/docs/open-google-search.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-search.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-search.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-google-stadia.md b/docs/open-google-stadia.md index ec74803c9..ab1fe27a6 100644 --- a/docs/open-google-stadia.md +++ b/docs/open-google-stadia.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-stadia.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-stadia.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-google-translate.md b/docs/open-google-translate.md index 6f359e0fd..8b7f9d37f 100644 --- a/docs/open-google-translate.md +++ b/docs/open-google-translate.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-google-translate.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-google-translate.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-home-folder.md b/docs/open-home-folder.md index 723d02da7..cdd117e66 100644 --- a/docs/open-home-folder.md +++ b/docs/open-home-folder.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-home-folder.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-home-folder.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-internet-archive.md b/docs/open-internet-archive.md index caa9fb237..ba5014b8e 100644 --- a/docs/open-internet-archive.md +++ b/docs/open-internet-archive.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-internet-archive.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-internet-archive.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-jitsi-meet.md b/docs/open-jitsi-meet.md index e51a1f98d..e8bc51ae0 100644 --- a/docs/open-jitsi-meet.md +++ b/docs/open-jitsi-meet.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-jitsi-meet.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-jitsi-meet.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-m-drive.md b/docs/open-m-drive.md index 1616c887a..a4996bd3a 100644 --- a/docs/open-m-drive.md +++ b/docs/open-m-drive.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-m-drive.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-m-drive.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-magnifier.md b/docs/open-magnifier.md index fb144d9da..db6794e26 100644 --- a/docs/open-magnifier.md +++ b/docs/open-magnifier.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-magnifier.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-magnifier.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-microsoft-paint.md b/docs/open-microsoft-paint.md index 6e4480947..6e45c49f2 100644 --- a/docs/open-microsoft-paint.md +++ b/docs/open-microsoft-paint.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-microsoft-paint.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-microsoft-paint.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-microsoft-solitaire.md b/docs/open-microsoft-solitaire.md index 672e03e85..4579232e1 100644 --- a/docs/open-microsoft-solitaire.md +++ b/docs/open-microsoft-solitaire.md @@ -48,4 +48,4 @@ Start-Process xboxliveapp-1297287741: exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-microsoft-solitaire.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-microsoft-solitaire.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-microsoft-store.md b/docs/open-microsoft-store.md index 99cff0c05..1f249e1c7 100644 --- a/docs/open-microsoft-store.md +++ b/docs/open-microsoft-store.md @@ -48,4 +48,4 @@ Start-Process ms-windows-store: exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-microsoft-store.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-microsoft-store.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-microsoft-teams.md b/docs/open-microsoft-teams.md index 916dc3b74..8884d5f0b 100644 --- a/docs/open-microsoft-teams.md +++ b/docs/open-microsoft-teams.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-microsoft-teams.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-microsoft-teams.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-music-folder.md b/docs/open-music-folder.md index a27e946a5..ddfedf89f 100644 --- a/docs/open-music-folder.md +++ b/docs/open-music-folder.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-music-folder.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-music-folder.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-netflix.md b/docs/open-netflix.md index 5e5511db9..3b00346ee 100644 --- a/docs/open-netflix.md +++ b/docs/open-netflix.md @@ -48,4 +48,4 @@ Start-Process netflix: exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-netflix.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-netflix.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-note-pad.md b/docs/open-note-pad.md index a6cfc291d..961aa0578 100644 --- a/docs/open-note-pad.md +++ b/docs/open-note-pad.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-note-pad.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-note-pad.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-obs-studio.md b/docs/open-obs-studio.md index 27d57fed6..c8b108e0f 100644 --- a/docs/open-obs-studio.md +++ b/docs/open-obs-studio.md @@ -47,4 +47,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-obs-studio.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-obs-studio.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-office-365.md b/docs/open-office-365.md index 468a7a662..4443e94ff 100644 --- a/docs/open-office-365.md +++ b/docs/open-office-365.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-office-365.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-office-365.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-one-drive-folder.md b/docs/open-one-drive-folder.md index f84690ef6..1d6509fae 100644 --- a/docs/open-one-drive-folder.md +++ b/docs/open-one-drive-folder.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-one-drive-folder.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-one-drive-folder.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-outlook.md b/docs/open-outlook.md index c31f46d78..efcde2b56 100644 --- a/docs/open-outlook.md +++ b/docs/open-outlook.md @@ -47,4 +47,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-outlook.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-outlook.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-paint-three-d.md b/docs/open-paint-three-d.md index 4d682d066..029cd20bd 100644 --- a/docs/open-paint-three-d.md +++ b/docs/open-paint-three-d.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-paint-three-d.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-paint-three-d.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-pictures-folder.md b/docs/open-pictures-folder.md index 0a69dd182..eecd98455 100644 --- a/docs/open-pictures-folder.md +++ b/docs/open-pictures-folder.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-pictures-folder.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-pictures-folder.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-rdp.md b/docs/open-rdp.md index ec05e3c2c..b919d460c 100644 --- a/docs/open-rdp.md +++ b/docs/open-rdp.md @@ -64,4 +64,4 @@ if ($hostname -eq "") { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-rdp.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-rdp.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-recycle-bin-folder.md b/docs/open-recycle-bin-folder.md index a1bafbd19..a705ba8ae 100644 --- a/docs/open-recycle-bin-folder.md +++ b/docs/open-recycle-bin-folder.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-recycle-bin-folder.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-recycle-bin-folder.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-remote-desktop.md b/docs/open-remote-desktop.md index 08bb8369c..530047607 100644 --- a/docs/open-remote-desktop.md +++ b/docs/open-remote-desktop.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-remote-desktop.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-remote-desktop.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-repos-folder.md b/docs/open-repos-folder.md index 4b3aabea2..e76047061 100644 --- a/docs/open-repos-folder.md +++ b/docs/open-repos-folder.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-repos-folder.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-repos-folder.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-screen-clip.md b/docs/open-screen-clip.md index 636d4342c..4a04097d3 100644 --- a/docs/open-screen-clip.md +++ b/docs/open-screen-clip.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-screen-clip.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-screen-clip.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-screen-sketch.md b/docs/open-screen-sketch.md index cf6dd937c..1245392c5 100644 --- a/docs/open-screen-sketch.md +++ b/docs/open-screen-sketch.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-screen-sketch.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-screen-sketch.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-skype.md b/docs/open-skype.md index 54245bcf9..85399f8fd 100644 --- a/docs/open-skype.md +++ b/docs/open-skype.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-skype.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-skype.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-snipping-tool.md b/docs/open-snipping-tool.md index cbd1a9c9c..a57960b91 100644 --- a/docs/open-snipping-tool.md +++ b/docs/open-snipping-tool.md @@ -48,4 +48,4 @@ Start-Process SnippingTool.exe exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-snipping-tool.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-snipping-tool.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-speed-test.md b/docs/open-speed-test.md index f62626ae0..6b0d099be 100644 --- a/docs/open-speed-test.md +++ b/docs/open-speed-test.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-speed-test.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-speed-test.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-spotify.md b/docs/open-spotify.md index f01c02302..7a44a05fb 100644 --- a/docs/open-spotify.md +++ b/docs/open-spotify.md @@ -48,4 +48,4 @@ Start-Process spotify: exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-spotify.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-spotify.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-stack-overflow.md b/docs/open-stack-overflow.md index fc2928ad2..5d5e40051 100644 --- a/docs/open-stack-overflow.md +++ b/docs/open-stack-overflow.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-stack-overflow.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-stack-overflow.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-start-page.md b/docs/open-start-page.md index b3970bfce..ccc0f6376 100644 --- a/docs/open-start-page.md +++ b/docs/open-start-page.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-start-page.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-start-page.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-street-map.md b/docs/open-street-map.md index fccc4aa38..c73ba9378 100644 --- a/docs/open-street-map.md +++ b/docs/open-street-map.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-street-map.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-street-map.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-task-manager.md b/docs/open-task-manager.md index b5ee31a58..032b041da 100644 --- a/docs/open-task-manager.md +++ b/docs/open-task-manager.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-task-manager.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-task-manager.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-temporary-folder.md b/docs/open-temporary-folder.md index e5a4ceb94..047cba257 100644 --- a/docs/open-temporary-folder.md +++ b/docs/open-temporary-folder.md @@ -50,4 +50,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-temporary-folder.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-temporary-folder.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-three-d-viewer.md b/docs/open-three-d-viewer.md index c27199e50..b0ad2723a 100644 --- a/docs/open-three-d-viewer.md +++ b/docs/open-three-d-viewer.md @@ -48,4 +48,4 @@ Start-Process com.microsoft.3dviewer: exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-three-d-viewer.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-three-d-viewer.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-thunderbird.md b/docs/open-thunderbird.md index cc5c5f418..155fe642d 100644 --- a/docs/open-thunderbird.md +++ b/docs/open-thunderbird.md @@ -45,4 +45,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-thunderbird.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-thunderbird.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-videos-folders.md b/docs/open-videos-folders.md index 4335e7b38..d465ace92 100644 --- a/docs/open-videos-folders.md +++ b/docs/open-videos-folders.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-videos-folders.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-videos-folders.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-visual-studio.md b/docs/open-visual-studio.md index f5e2280a4..caf7ca14f 100644 --- a/docs/open-visual-studio.md +++ b/docs/open-visual-studio.md @@ -47,4 +47,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-visual-studio.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-visual-studio.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-vpn-settings.md b/docs/open-vpn-settings.md index 5ead3420d..2fd29a5d6 100644 --- a/docs/open-vpn-settings.md +++ b/docs/open-vpn-settings.md @@ -48,4 +48,4 @@ Start-Process ms-settings:network-vpn exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-vpn-settings.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-vpn-settings.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-windows-defender.md b/docs/open-windows-defender.md index cadc7cbf3..911a189fb 100644 --- a/docs/open-windows-defender.md +++ b/docs/open-windows-defender.md @@ -48,4 +48,4 @@ Start-Process windowsdefender: exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-windows-defender.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-windows-defender.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-windows-terminal.md b/docs/open-windows-terminal.md index 25490b06d..b266afadd 100644 --- a/docs/open-windows-terminal.md +++ b/docs/open-windows-terminal.md @@ -48,4 +48,4 @@ Start-Process wt.exe exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-windows-terminal.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-windows-terminal.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/open-xing.md b/docs/open-xing.md index 2d5b9431d..d25a5ab97 100644 --- a/docs/open-xing.md +++ b/docs/open-xing.md @@ -48,4 +48,4 @@ Start-Process xing: exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of open-xing.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of open-xing.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/pick-commit.md b/docs/pick-commit.md index 533b1b8ef..ed507b1a7 100644 --- a/docs/pick-commit.md +++ b/docs/pick-commit.md @@ -151,4 +151,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of pick-commit.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of pick-commit.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/ping-host.md b/docs/ping-host.md index bed4ff996..c4ea76445 100644 --- a/docs/ping-host.md +++ b/docs/ping-host.md @@ -132,4 +132,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of ping-host.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of ping-host.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/ping-local-hosts.md b/docs/ping-local-hosts.md index 1a7a6bd48..5c17ab322 100644 --- a/docs/ping-local-hosts.md +++ b/docs/ping-local-hosts.md @@ -6,7 +6,15 @@ This PowerShell script pings the computers in the local network and lists which Parameters ---------- ```powershell -PS> ./ping-local-hosts.ps1 [] +PS> ./ping-local-hosts.ps1 [[-timeout] ] [] + +-timeout + + Required? false + Position? 1 + Default value 600 + Accept pipeline input? false + Accept wildcard characters? false [] This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, @@ -46,36 +54,31 @@ Script Content Author: Markus Fleschutz | License: CC0 #> -$names = @('ad','amnesiac','archlinux','auriga','berlin','boston','brother','canon','castor','cisco','echodot','epson','fedora','fireball','firewall','fritz.box','fritz!repeater','gassensor','gateway','hippo','heizung','hodor','homemanager','io','iphone','jarvis','jenkins','la','laptop','jupiter','mars','mercury','miami','mobile','none','none-1','none-2','ny','octopi','office','officepc','paris','pi','pixel-6a','pluto','printer','proxy','r2d2','raspberry','rocket','rome','router','sentinel','server','shelly1','smartphone','smartwatch','soundbar','sunnyboy','surface','switch','tablet','tau','tigercat','tolino','tv','ubuntu','vega','venus','xrx','zeus') # sorted alphabetically -[int]$pingTimeout = 600 # ms +param([int]$timeout = 600) # ms ping timeout + try { Write-Progress "Sending pings to the local hosts..." + $names = @('accesspoint','AD','AP','amnesiac','archlinux','auriga','berlin','boston','brother','canon','castor','cisco','echodot','epson','epson2550','epson2815','fedora','fireball','firewall','fritz.box','fritz!repeater','gassensor','gateway','hippo','heizung','hodor','homemanager','io','iphone','jarvis','jenkins','LA','laptop','linux','jupiter','mars','mercury','miami','mobile','none','none-1','none-2','NY','octo','office','officepc','paris','PI','pixel-6a','PC','pluto','printer','proxy','R2D2','raspberry','rocket','rome','router','sentinel','server','shelly','shelly1','smartphone','smartwatch','soundbar','sunnyboy','surface','switch','tablet','tau','tigercat','tolino','TV','ubuntu','vega','venus','xrx','zeus') # sorted alphabetically $queue = [System.Collections.Queue]::new() foreach($name in $names) { $ping = [System.Net.Networkinformation.Ping]::new() - $queue.Enqueue( @{Host=$name; Ping=$ping; Async=$ping.SendPingAsync($name, $pingTimeout)} ) + $queue.Enqueue( @{Host=$name; Ping=$ping; Async=$ping.SendPingAsync($name, $timeout)} ) } - $up = "" - do { - $obj = $queue.Dequeue() - try { - if ($obj.Async.Wait($pingTimeout)) { - if ($obj.Async.Result.Status -ne "TimedOut") { - $up += "$($obj.Host) " - } + [string]$up = "" + while ($queue.Count -gt 0) { $obj = $queue.Dequeue() + try { if ($obj.Async.Wait($timeout)) { + if ($obj.Async.Result.Status -ne "TimedOut") { $up += "$($obj.Host) " } continue } - } catch { - if ($obj.Async.IsCompleted) { continue } - } + } catch { continue } $queue.Enqueue($obj) - } while ($queue.Count -gt 0) + } - Write-Progress -completed "done." - Write-Host "βœ… Up: $($up)" + Write-Progress -completed "Done." + Write-Host "βœ… Up: $up" exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -83,4 +86,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of ping-local-hosts.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of ping-local-hosts.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/ping-remote-hosts.md b/docs/ping-remote-hosts.md index 0e4725fad..6448fe93a 100644 --- a/docs/ping-remote-hosts.md +++ b/docs/ping-remote-hosts.md @@ -26,7 +26,7 @@ Example ------- ```powershell PS> ./ping-remote-hosts.ps1 -βœ… Online with 18ms latency (13ms...109ms, 0/10 ping loss) +βœ… Online with 18ms latency (13...109ms, 0/10 ping loss) ``` @@ -50,7 +50,7 @@ Script Content Specifies the hosts to ping, seperated by commata (10 Internet servers by default) .EXAMPLE PS> ./ping-remote-hosts.ps1 - βœ… Online with 18ms latency (13ms...109ms, 0/10 ping loss) + βœ… Online with 18ms latency (13...109ms, 0/10 ping loss) .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -61,14 +61,12 @@ param([string]$hosts = "bing.com,cnn.com,dropbox.com,github.com,google.com,ibm.c try { $hostsArray = $hosts.Split(",") - $parallelTasks = $hostsArray | foreach { - (New-Object Net.NetworkInformation.Ping).SendPingAsync($_,750) - } + $tasks = $hostsArray | foreach { (New-Object Net.NetworkInformation.Ping).SendPingAsync($_,750) } [int]$min = 9999999 [int]$max = [int]$avg = [int]$success = 0 [int]$total = $hostsArray.Count - [Threading.Tasks.Task]::WaitAll($parallelTasks) - foreach($ping in $parallelTasks.Result) { + [Threading.Tasks.Task]::WaitAll($tasks) + foreach($ping in $tasks.Result) { if ($ping.Status -ne "Success") { continue } $success++ [int]$latency = $ping.RoundtripTime @@ -79,7 +77,7 @@ try { [int]$loss = $total - $success if ($success -ne 0) { $avg /= $success - Write-Host "βœ… Online with $($avg)ms latency ($($min)ms...$($max)ms, $loss/$total ping loss)" + Write-Host "βœ… Online with $($avg)ms latency ($($min)...$($max)ms, $loss/$total ping loss)" } else { Write-Host "⚠️ Offline ($loss/$total ping loss)" } @@ -90,4 +88,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of ping-remote-hosts.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of ping-remote-hosts.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/ping-weather.md b/docs/ping-weather.md index 6f43fe132..298896130 100644 --- a/docs/ping-weather.md +++ b/docs/ping-weather.md @@ -99,4 +99,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of ping-weather.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of ping-weather.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/play-bee-sound.md b/docs/play-bee-sound.md index 094c19336..a7b8e9cb0 100644 --- a/docs/play-bee-sound.md +++ b/docs/play-bee-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-bee-sound.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-bee-sound.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/play-beep-sound.md b/docs/play-beep-sound.md index 07ff6f219..c03c92cc3 100644 --- a/docs/play-beep-sound.md +++ b/docs/play-beep-sound.md @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-beep-sound.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-beep-sound.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/play-big-ben.md b/docs/play-big-ben.md new file mode 100644 index 000000000..5b09988ac --- /dev/null +++ b/docs/play-big-ben.md @@ -0,0 +1,53 @@ +Script: *play-big-ben.ps1* +======================== + +This PowerShell script plays the sound of Big Ben. + +Parameters +---------- +```powershell +PS> ./play-big-ben.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./play-big-ben.ps1 +(listen and enjoy) + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Plays the Big Ben sound +.DESCRIPTION + This PowerShell script plays the sound of Big Ben. +.EXAMPLE + PS> ./play-big-ben.ps1 + (listen and enjoy) +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +& "$PSScriptRoot/play-mp3.ps1" "$PSScriptRoot/../data/sounds/Big Ben.mp3" +exit 0 # success +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of play-big-ben.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/play-cat-sound.md b/docs/play-cat-sound.md index 92d24dc2b..227f4bf82 100644 --- a/docs/play-cat-sound.md +++ b/docs/play-cat-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-cat-sound.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-cat-sound.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/play-cow-sound.md b/docs/play-cow-sound.md index 477ef88dc..8ced66d7b 100644 --- a/docs/play-cow-sound.md +++ b/docs/play-cow-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-cow-sound.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-cow-sound.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/play-dog-sound.md b/docs/play-dog-sound.md index 33aa13716..93dc0591f 100644 --- a/docs/play-dog-sound.md +++ b/docs/play-dog-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-dog-sound.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-dog-sound.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/play-donkey-sound.md b/docs/play-donkey-sound.md index 311cc0356..f7c5f1963 100644 --- a/docs/play-donkey-sound.md +++ b/docs/play-donkey-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-donkey-sound.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-donkey-sound.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/play-elephant-sound.md b/docs/play-elephant-sound.md index 6d761ebd5..86387382c 100644 --- a/docs/play-elephant-sound.md +++ b/docs/play-elephant-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-elephant-sound.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-elephant-sound.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/play-elk-sound.md b/docs/play-elk-sound.md index c49fd658a..a545ad97f 100644 --- a/docs/play-elk-sound.md +++ b/docs/play-elk-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-elk-sound.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-elk-sound.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/play-files.md b/docs/play-files.md index 8ad086088..0ebea90c5 100644 --- a/docs/play-files.md +++ b/docs/play-files.md @@ -76,4 +76,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-files.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-files.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/play-frog-sound.md b/docs/play-frog-sound.md index 7d4805c69..9f221788e 100644 --- a/docs/play-frog-sound.md +++ b/docs/play-frog-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-frog-sound.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-frog-sound.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/play-goat-sound.md b/docs/play-goat-sound.md index 3c617a2ef..8cc8f121e 100644 --- a/docs/play-goat-sound.md +++ b/docs/play-goat-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-goat-sound.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-goat-sound.ps1 as of 05/19/2024 10:25:24)* diff --git a/docs/play-gorilla-sound.md b/docs/play-gorilla-sound.md index c7a3c597b..552821e7d 100644 --- a/docs/play-gorilla-sound.md +++ b/docs/play-gorilla-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-gorilla-sound.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-gorilla-sound.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-happy-birthday.md b/docs/play-happy-birthday.md index 8053d6a99..51a0d4afc 100644 --- a/docs/play-happy-birthday.md +++ b/docs/play-happy-birthday.md @@ -79,4 +79,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-happy-birthday.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-happy-birthday.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-horse-sound.md b/docs/play-horse-sound.md index 91ae656d3..f8b36a097 100644 --- a/docs/play-horse-sound.md +++ b/docs/play-horse-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-horse-sound.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-horse-sound.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-imperial-march.md b/docs/play-imperial-march.md index 52911a5dd..452c9f6ae 100644 --- a/docs/play-imperial-march.md +++ b/docs/play-imperial-march.md @@ -72,4 +72,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-imperial-march.ps1 as of 03/27/2024 17:36:30)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-imperial-march.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-jingle-bells.md b/docs/play-jingle-bells.md index df2ac0638..76c6c64cf 100644 --- a/docs/play-jingle-bells.md +++ b/docs/play-jingle-bells.md @@ -201,4 +201,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-jingle-bells.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-jingle-bells.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-lion-sound.md b/docs/play-lion-sound.md index 1b855203b..ef3b32cac 100644 --- a/docs/play-lion-sound.md +++ b/docs/play-lion-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-lion-sound.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-lion-sound.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-m3u.md b/docs/play-m3u.md index cde764eb8..01eb63063 100644 --- a/docs/play-m3u.md +++ b/docs/play-m3u.md @@ -92,4 +92,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-m3u.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-m3u.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-mission-impossible.md b/docs/play-mission-impossible.md index 8b8c1360e..cd39b706a 100644 --- a/docs/play-mission-impossible.md +++ b/docs/play-mission-impossible.md @@ -100,4 +100,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-mission-impossible.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-mission-impossible.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-mp3.md b/docs/play-mp3.md index ed271b0d9..c22705fcd 100644 --- a/docs/play-mp3.md +++ b/docs/play-mp3.md @@ -1,15 +1,15 @@ Script: *play-mp3.ps1* ======================== -This PowerShell script plays a sound file in .MP3 file format. +This PowerShell script plays the given sound file (MPEG-1 audio layer-3 file format). Parameters ---------- ```powershell -PS> ./play-mp3.ps1 [[-Path] ] [] +PS> ./play-mp3.ps1 [[-path] ] [] --Path - Specifies the path to the .MP3 file +-path + Specifies the file path to the .MP3 file Required? false Position? 1 @@ -25,7 +25,7 @@ PS> ./play-mp3.ps1 [[-Path] ] [] Example ------- ```powershell -PS> ./play-mp3 C:\thunder.mp3 +PS> ./play-mp3.ps1 C:\thunder.mp3 ``` @@ -42,48 +42,50 @@ Script Content ```powershell <# .SYNOPSIS - Plays a MP3 sound file + Plays a .MP3 sound file .DESCRIPTION - This PowerShell script plays a sound file in .MP3 file format. -.PARAMETER Path - Specifies the path to the .MP3 file + This PowerShell script plays the given sound file (MPEG-1 audio layer-3 file format). +.PARAMETER path + Specifies the file path to the .MP3 file .EXAMPLE - PS> ./play-mp3 C:\thunder.mp3 + PS> ./play-mp3.ps1 C:\thunder.mp3 .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> -param([string]$Path = "") +param([string]$path = "") try { - if ($Path -eq "" ) { $Path = Read-Host "Enter the path to the MP3 sound file" } + if ($path -eq "" ) { $path = Read-Host "Enter the file path to the MP3 sound file" } - if (-not(Test-Path "$Path" -pathType leaf)) { throw "Can't access sound file: $Path" } - $FullPath = (Get-ChildItem $Path).fullname - $Filename = (Get-Item "$FullPath").name + if (-not(Test-Path "$path" -pathType leaf)) { throw "Can't access sound file: $path" } + $fullPath = (Get-ChildItem $path).fullname + $filename = (Get-Item "$fullPath").name Add-Type -assemblyName PresentationCore - $MediaPlayer = New-Object System.Windows.Media.MediaPlayer + $mediaPlayer = New-Object System.Windows.Media.MediaPlayer do { - $MediaPlayer.open($FullPath) - $Milliseconds = $MediaPlayer.NaturalDuration.TimeSpan.TotalMilliseconds - } until ($Milliseconds) - - [int]$Minutes = $Milliseconds / 60000 - [int]$Seconds = ($Milliseconds / 1000) % 60 - "▢️ Playing $Filename for $($Minutes.ToString('00')):$($Seconds.ToString('00')) sec..." - $PreviousTitle = $host.ui.RawUI.WindowTitle - $host.ui.RawUI.WindowTitle = "▢️ $Filename" - $MediaPlayer.Volume = 1 - $MediaPlayer.play() - Start-Sleep -milliseconds $Milliseconds - $MediaPlayer.stop() - $MediaPlayer.close() - $host.ui.RawUI.WindowTitle = $PreviousTitle - + $mediaPlayer.open($fullPath) + $milliseconds = $mediaPlayer.NaturalDuration.TimeSpan.TotalMilliseconds + } until ($milliseconds) + + [int]$minutes = $milliseconds / 60000 + [int]$seconds = ($milliseconds / 1000) % 60 + Write-Host " ▢️" -noNewline -foregroundColor green + Write-Host "Playing $filename for $($minutes.ToString('00')):$($seconds.ToString('00'))s..." + + $previousTitle = $host.ui.RawUI.WindowTitle + $host.ui.RawUI.WindowTitle = "▢️ $filename" + $mediaPlayer.Volume = 1 + $mediaPlayer.play() + Start-Sleep -milliseconds $milliseconds + + $mediaPlayer.stop() + $mediaPlayer.close() + $host.ui.RawUI.WindowTitle = $previousTitle exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -91,4 +93,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-mp3.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-mp3.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-parrot-sound.md b/docs/play-parrot-sound.md index 146dd67e7..4aaf0f0d0 100644 --- a/docs/play-parrot-sound.md +++ b/docs/play-parrot-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-parrot-sound.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-parrot-sound.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-pig-sound.md b/docs/play-pig-sound.md index 4c5e33f02..645b4d34e 100644 --- a/docs/play-pig-sound.md +++ b/docs/play-pig-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-pig-sound.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-pig-sound.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-pong.md b/docs/play-pong.md index ee59ef486..94f5adad1 100644 --- a/docs/play-pong.md +++ b/docs/play-pong.md @@ -176,4 +176,4 @@ while ($true) { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-pong.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-pong.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-rattlesnake-sound.md b/docs/play-rattlesnake-sound.md index a29414526..b8e74b2eb 100644 --- a/docs/play-rattlesnake-sound.md +++ b/docs/play-rattlesnake-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-rattlesnake-sound.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-rattlesnake-sound.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-rick.md b/docs/play-rick.md index 9f2639462..0ae5acf4b 100644 --- a/docs/play-rick.md +++ b/docs/play-rick.md @@ -49,4 +49,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-rick.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-rick.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-snake.md b/docs/play-snake.md index e7a8b4781..cb787ab24 100644 --- a/docs/play-snake.md +++ b/docs/play-snake.md @@ -86,4 +86,4 @@ Start-Sleep -milliseconds 300 exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-snake.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-snake.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-super-mario.md b/docs/play-super-mario.md index 7be758afc..5edc9f2c1 100644 --- a/docs/play-super-mario.md +++ b/docs/play-super-mario.md @@ -71,4 +71,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-super-mario.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-super-mario.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-system-sounds.md b/docs/play-system-sounds.md new file mode 100644 index 000000000..b07aeada2 --- /dev/null +++ b/docs/play-system-sounds.md @@ -0,0 +1,58 @@ +Script: *play-system-sounds.ps1* +======================== + +play-system-sounds.ps1 + + +Parameters +---------- +```powershell + + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Plays all system sounds +.DESCRIPTION + This PowerShell script plays all operating system sounds. +.EXAMPLE + PS> ./play-system-sounds.ps1 + (listen and enjoy) +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +function PlaySoundFiles([string]$filePattern) { + $files = (Get-ChildItem "$filePattern") + foreach($file in $files) { + & "$PSScriptRoot/play-mp3.ps1" "$file" + Start-Sleep -milliseconds 500 + } +} + +try { + if ($IsLinux -or $IsMacOS) { throw "Currently only supported for Windows" } + + $WinDir = Resolve-Path "$env:WINDIR" + if (-not(Test-Path "$WinDir" -pathType container)) { throw "Windows directory at πŸ“‚$Path doesn't exist" } + + Write-Host "`n Windows System Sounds at $WinDir\Media" -foregroundColor green + PlaySoundFiles "$WinDir\Media\*.wav" + PlaySoundFiles "$WinDir\Media\*\*.wav" + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of play-system-sounds.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-tetris-melody.md b/docs/play-tetris-melody.md index 2d5e21633..2df25ffa3 100644 --- a/docs/play-tetris-melody.md +++ b/docs/play-tetris-melody.md @@ -161,4 +161,4 @@ Start-Sleep -milliseconds 500 exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-tetris-melody.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-tetris-melody.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-vulture-sound.md b/docs/play-vulture-sound.md index f07d9fed7..3cbaa075f 100644 --- a/docs/play-vulture-sound.md +++ b/docs/play-vulture-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-vulture-sound.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-vulture-sound.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/play-wolf-sound.md b/docs/play-wolf-sound.md index 939bc8ee5..5bafc8550 100644 --- a/docs/play-wolf-sound.md +++ b/docs/play-wolf-sound.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of play-wolf-sound.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of play-wolf-sound.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/poweroff.md b/docs/poweroff.md index 7083db950..df7067b9c 100644 --- a/docs/poweroff.md +++ b/docs/poweroff.md @@ -59,4 +59,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of poweroff.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of poweroff.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/print-image.md b/docs/print-image.md index 36eb2e5e5..c8105ee08 100644 --- a/docs/print-image.md +++ b/docs/print-image.md @@ -69,4 +69,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of print-image.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of print-image.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/publish-to-ipfs.md b/docs/publish-to-ipfs.md index 9eba2650b..738bc553b 100644 --- a/docs/publish-to-ipfs.md +++ b/docs/publish-to-ipfs.md @@ -119,4 +119,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of publish-to-ipfs.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of publish-to-ipfs.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/pull-repo.md b/docs/pull-repo.md index 66975a25e..a18e7dbc4 100644 --- a/docs/pull-repo.md +++ b/docs/pull-repo.md @@ -1,14 +1,14 @@ Script: *pull-repo.ps1* ======================== -This PowerShell script pulls the latest updates into a local Git repository (including submodules). +This PowerShell script pulls remote updates into a local Git repository (including submodules). Parameters ---------- ```powershell -PS> ./pull-repo.ps1 [[-RepoDir] ] [] +PS> ./pull-repo.ps1 [[-pathToRepo] ] [] --RepoDir +-pathToRepo Specifies the file path to the local Git repository (default is working directory) Required? false @@ -25,12 +25,12 @@ PS> ./pull-repo.ps1 [[-RepoDir] ] [] Example ------- ```powershell -PS> ./pull-repo.ps1 C:\MyRepo -⏳ (1/4) Searching for Git executable... git version 2.42.0.windows.1 -⏳ (2/4) Checking local repository... -⏳ (3/4) Pulling updates... +PS> ./pull-repo.ps1 +⏳ (1/4) Searching for Git executable... git version 2.44.0.windows.1 +⏳ (2/4) Checking local repository... πŸ“‚C:\Repos\rust +⏳ (3/4) Pulling remote updates... ⏳ (4/4) Updating submodules... -βœ”οΈ Pulled updates into repo πŸ“‚MyRepo in 14 sec +βœ”οΈ Updates pulled into πŸ“‚rust repo in 14s. ``` @@ -47,49 +47,49 @@ Script Content ```powershell <# .SYNOPSIS - Pulls updates into a Git repository + Pulls updates into a Git repo .DESCRIPTION - This PowerShell script pulls the latest updates into a local Git repository (including submodules). -.PARAMETER RepoDir + This PowerShell script pulls remote updates into a local Git repository (including submodules). +.PARAMETER pathToRepo Specifies the file path to the local Git repository (default is working directory) .EXAMPLE - PS> ./pull-repo.ps1 C:\MyRepo - ⏳ (1/4) Searching for Git executable... git version 2.42.0.windows.1 - ⏳ (2/4) Checking local repository... - ⏳ (3/4) Pulling updates... + PS> ./pull-repo.ps1 + ⏳ (1/4) Searching for Git executable... git version 2.44.0.windows.1 + ⏳ (2/4) Checking local repository... πŸ“‚C:\Repos\rust + ⏳ (3/4) Pulling remote updates... ⏳ (4/4) Updating submodules... - βœ”οΈ Pulled updates into repo πŸ“‚MyRepo in 14 sec + βœ”οΈ Updates pulled into πŸ“‚rust repo in 14s. .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> -param([string]$RepoDir = "$PWD") +param([string]$pathToRepo = "$PWD") try { - $StopWatch = [system.diagnostics.stopwatch]::startNew() + $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" } - Write-Host "⏳ (2/4) Checking local repository..." - if (-not(Test-Path "$RepoDir" -pathType container)) { throw "Can't access folder: $RepoDir" } - $Result = (git -C "$RepoDir" status) - if ("$Result" -match "HEAD detached at ") { throw "Currently in detached HEAD state (not on a branch!), so nothing to pull" } - $RepoDirName = (Get-Item "$RepoDir").Name + Write-Host "⏳ (2/4) Checking local repository... πŸ“‚$pathToRepo" + if (-not(Test-Path "$pathToRepo" -pathType container)) { throw "Can't access folder: $pathToRepo" } + $result = (git -C "$pathToRepo" status) + if ("$result" -match "HEAD detached at ") { throw "Nothing to pull due to detached HEAD state (not on a branch!)" } + $pathToRepoName = (Get-Item "$pathToRepo").Name - Write-Host "⏳ (3/4) Pulling updates..." - & git -C "$RepoDir" pull --recurse-submodules=yes + Write-Host "⏳ (3/4) Pulling remote updates..." + & git -C "$pathToRepo" pull --recurse-submodules=yes if ($lastExitCode -ne "0") { throw "'git pull' failed with exit code $lastExitCode" } Write-Host "⏳ (4/4) Updating submodules... " - & git -C "$RepoDir" submodule update --init --recursive + & git -C "$pathToRepo" submodule update --init --recursive if ($lastExitCode -ne "0") { throw "'git submodule update' failed with exit code $lastExitCode" } - [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds - "βœ”οΈ Pulled updates into repo πŸ“‚$RepoDirName in $Elapsed sec" + [int]$elapsed = $stopWatch.Elapsed.TotalSeconds + "βœ”οΈ Updates pulled into πŸ“‚$pathToRepoName repo in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -97,4 +97,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of pull-repo.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of pull-repo.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/pull-repos.md b/docs/pull-repos.md index 6f9f317b5..048404cc5 100644 --- a/docs/pull-repos.md +++ b/docs/pull-repos.md @@ -94,7 +94,7 @@ try { } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds if ($failed -eq 0) { - "βœ”οΈ Updated $numFolders repos under πŸ“‚$parentDirName in $elapsed sec." + "βœ”οΈ Remote updates pulled into $numFolders repos within πŸ“‚$parentDirName in $($elapsed)s." exit 0 # success } else { "⚠️ Updated $numFolders repos under πŸ“‚$parentDirName but $failed failed (took $elapsed sec)." @@ -106,4 +106,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of pull-repos.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of pull-repos.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/query-smart-data.md b/docs/query-smart-data.md index 42314fb00..5ad7bab1b 100644 --- a/docs/query-smart-data.md +++ b/docs/query-smart-data.md @@ -106,4 +106,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of query-smart-data.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of query-smart-data.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/reboot-fritzbox.md b/docs/reboot-fritzbox.md index f31061aa8..7cd392cc9 100644 --- a/docs/reboot-fritzbox.md +++ b/docs/reboot-fritzbox.md @@ -152,4 +152,4 @@ echo $Result exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of reboot-fritzbox.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of reboot-fritzbox.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/reboot.md b/docs/reboot.md index be9488f25..22dd19e4b 100644 --- a/docs/reboot.md +++ b/docs/reboot.md @@ -59,4 +59,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of reboot.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of reboot.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/remind-me.md b/docs/remind-me.md index 2fcf8803d..5687725e5 100644 --- a/docs/remind-me.md +++ b/docs/remind-me.md @@ -88,4 +88,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of remind-me.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of remind-me.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/remove-dir-tree.md b/docs/remove-dir-tree.md index ad25d6dfb..bd82ab7ac 100644 --- a/docs/remove-dir-tree.md +++ b/docs/remove-dir-tree.md @@ -69,4 +69,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of remove-dir-tree.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of remove-dir-tree.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/remove-empty-dirs.md b/docs/remove-empty-dirs.md index 9eac2ba3a..def27876e 100644 --- a/docs/remove-empty-dirs.md +++ b/docs/remove-empty-dirs.md @@ -91,4 +91,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of remove-empty-dirs.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of remove-empty-dirs.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/remove-old-dirs.md b/docs/remove-old-dirs.md index 42f170b3f..86f0aaadf 100644 --- a/docs/remove-old-dirs.md +++ b/docs/remove-old-dirs.md @@ -92,4 +92,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of remove-old-dirs.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of remove-old-dirs.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/remove-print-jobs.md b/docs/remove-print-jobs.md index bf7f126d4..32f4bdfcd 100644 --- a/docs/remove-print-jobs.md +++ b/docs/remove-print-jobs.md @@ -65,4 +65,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of remove-print-jobs.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of remove-print-jobs.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/remove-tag.md b/docs/remove-tag.md index bc981eb5b..91b4026ca 100644 --- a/docs/remove-tag.md +++ b/docs/remove-tag.md @@ -111,4 +111,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of remove-tag.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of remove-tag.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/remove-user.md b/docs/remove-user.md new file mode 100644 index 000000000..a7732848e --- /dev/null +++ b/docs/remove-user.md @@ -0,0 +1,78 @@ +Script: *remove-user.ps1* +======================== + +This PowerShell script removes an existing user account including the home directory. + +Parameters +---------- +```powershell +PS> ./remove-user.ps1 [[-username] ] [] + +-username + + Required? false + Position? 1 + Default value + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./remove-user.ps1 Joe +βœ”οΈ Removed user 'Joe' including home directory in 11s. + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Removes an user account +.DESCRIPTION + This PowerShell script removes an existing user account including the home directory. +.EXAMPLE + PS> ./remove-user.ps1 Joe + βœ”οΈ Removed user 'Joe' including home directory in 11s. +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([string]$username = "") + +try { + if ($username -eq "") { $username = Read-Host "Enter the user name to remove" } + $stopWatch = [system.diagnostics.stopwatch]::startNew() + + if ($IsLinux) { + & sudo deluser --remove-home $username + } else { + throw "Not supported yet" + } + + [int]$elapsed = $stopWatch.Elapsed.TotalSeconds + "βœ”οΈ Removed user '$username' including home directory in $($elapsed)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 remove-user.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/remove-vm.md b/docs/remove-vm.md index 456be6ca9..ab72fe132 100644 --- a/docs/remove-vm.md +++ b/docs/remove-vm.md @@ -25,4 +25,4 @@ Remove-Item -Path "C:\VirtualMachines\$VMName" -Recurse exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of remove-vm.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of remove-vm.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/replace-in-files.md b/docs/replace-in-files.md index 22cc54b08..5b84e35bc 100644 --- a/docs/replace-in-files.md +++ b/docs/replace-in-files.md @@ -105,4 +105,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of replace-in-files.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of replace-in-files.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/restart-network-adapters.md b/docs/restart-network-adapters.md index d5eca1802..e25e02a8b 100644 --- a/docs/restart-network-adapters.md +++ b/docs/restart-network-adapters.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of restart-network-adapters.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of restart-network-adapters.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/roll-a-dice.md b/docs/roll-a-dice.md index 538a42f52..453adf56a 100644 --- a/docs/roll-a-dice.md +++ b/docs/roll-a-dice.md @@ -51,4 +51,4 @@ $Number = "1", "2", "3", "4", "5", "6" | Get-Random exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of roll-a-dice.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of roll-a-dice.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/save-credentials.md b/docs/save-credentials.md index afdbaa41d..f6b54431c 100644 --- a/docs/save-credentials.md +++ b/docs/save-credentials.md @@ -73,4 +73,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of save-credentials.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of save-credentials.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/save-screenshot.md b/docs/save-screenshot.md index 4d6339428..d815ce891 100644 --- a/docs/save-screenshot.md +++ b/docs/save-screenshot.md @@ -98,4 +98,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of save-screenshot.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of save-screenshot.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/scan-network.md b/docs/scan-network.md new file mode 100644 index 000000000..e82b5acce --- /dev/null +++ b/docs/scan-network.md @@ -0,0 +1,35 @@ +Script: *scan-network.ps1* +======================== + +scan-network.ps1 + + +Parameters +---------- +```powershell + + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Script Content +-------------- +```powershell +$a = Get-NetIPAddress | Where-Object -FilterScript { $_.SuffixOrigin -eq "DHCP" -or $_.SuffixOrigin -eq "manual" } # | Format-Table -property IPAddress -autoSize + +$arguments = "-sT -T3" # Set sane defaults for command string +$location = "nmap" # In case nmap is not in PATH +$targets = "" + +foreach ( $i in $a ) { + $s = $i.IPAddress + "/" + $i.PrefixLength + $targets = $targets + " " + $s +} +$arguments = $arguments + " " + $targets + +Start-Process $location -ArgumentList $arguments -Wait +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of scan-network.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/scan-ports.md b/docs/scan-ports.md index 852851cca..60c45325c 100644 --- a/docs/scan-ports.md +++ b/docs/scan-ports.md @@ -65,4 +65,4 @@ foreach($add in $range) { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of scan-ports.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of scan-ports.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/search-filename.md b/docs/search-filename.md index b65d251f0..0b0206520 100644 --- a/docs/search-filename.md +++ b/docs/search-filename.md @@ -96,4 +96,4 @@ Search-Folder -FilePath $path -SearchTerm $term exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of search-filename.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of search-filename.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/search-files.md b/docs/search-files.md index fabf14e57..a472ba9b0 100644 --- a/docs/search-files.md +++ b/docs/search-files.md @@ -1,15 +1,15 @@ Script: *search-files.ps1* ======================== -This PowerShell script searches for a pattern in the given files. +This PowerShell script searches for the given pattern in the given files. Parameters ---------- ```powershell -PS> ./search-files.ps1 [[-pattern] ] [[-files] ] [] +PS> ./search-files.ps1 [[-textPattern] ] [[-filePattern] ] [] --pattern - Specifies the search pattern +-textPattern + Specifies the text pattern to search for Required? false Position? 1 @@ -17,8 +17,8 @@ PS> ./search-files.ps1 [[-pattern] ] [[-files] ] [ - Specifies the files +-filePattern + Specifies the files to search Required? false Position? 2 @@ -34,7 +34,14 @@ PS> ./search-files.ps1 [[-pattern] ] [[-files] ] [ ./search-files UFO C:\Temp\*.txt +PS> ./search-files.ps1 UFO *.ps1 + + + +FILE LINE +---- ---- +/home/Markus/PowerShell/scripts/check-month.ps1 17: $MonthName = (Get-Date -UFormat %B) +... ``` @@ -51,40 +58,41 @@ Script Content ```powershell <# .SYNOPSIS - Searches for a pattern in files + Searches for a text pattern in files .DESCRIPTION - This PowerShell script searches for a pattern in the given files. -.PARAMETER pattern - Specifies the search pattern -.PARAMETER files - Specifies the files + This PowerShell script searches for the given pattern in the given files. +.PARAMETER textPattern + Specifies the text pattern to search for +.PARAMETER filePattern + Specifies the files to search .EXAMPLE - PS> ./search-files UFO C:\Temp\*.txt + PS> ./search-files.ps1 UFO *.ps1 + + FILE LINE + ---- ---- + /home/Markus/PowerShell/scripts/check-month.ps1 17: $MonthName = (Get-Date -UFormat %B) + ... .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> -param([string]$pattern = "", [string]$files = "") +param([string]$textPattern = "", [string]$filePattern = "") function ListLocations { param([string]$Pattern, [string]$Path) - $List = Select-String -Path $Path -Pattern "$Pattern" - foreach ($Item in $List) { - New-Object PSObject -Property @{ - 'Path' = "$($Item.Path)" - 'Line' = "$($Item.LineNumber)" - 'Text' = "$($Item.Line)" - } + $list = Select-String -path $Path -pattern "$Pattern" + foreach ($item in $list) { + New-Object PSObject -Property @{ 'FILE'="$($item.Path)"; 'LINE'="$($item.LineNumber):$($item.Line)" } } - write-output "(found $($List.Count) locations with pattern '$pattern')" + Write-Output "βœ”οΈ Found $($list.Count) lines containing '$Pattern' in $filePattern." } try { - if ($pattern -eq "" ) { $pattern = read-host "Enter search pattern" } - if ($files -eq "" ) { $files = read-host "Enter path to files" } + if ($textPattern -eq "" ) { $textPattern = Read-Host "Enter the text pattern (e.g. 'UFO')" } + if ($filePattern -eq "" ) { $filePattern = Read-Host "Enter the file pattern (e.g. '*.ps1')" } - ListLocations $pattern $files | format-table -property Path,Line,Text + ListLocations $textPattern $filePattern | Format-Table -property FILE,LINE -autoSize exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -92,4 +100,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of search-files.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of search-files.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/send-email.md b/docs/send-email.md index 25b0107d6..45dd46666 100644 --- a/docs/send-email.md +++ b/docs/send-email.md @@ -121,4 +121,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of send-email.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of send-email.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/send-tcp.md b/docs/send-tcp.md index 6c20fa2ea..9e399ba9c 100644 --- a/docs/send-tcp.md +++ b/docs/send-tcp.md @@ -104,4 +104,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of send-tcp.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of send-tcp.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/send-udp.md b/docs/send-udp.md index a4a171379..0e215b85d 100644 --- a/docs/send-udp.md +++ b/docs/send-udp.md @@ -102,4 +102,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of send-udp.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of send-udp.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/set-timer.md b/docs/set-timer.md index f892964cb..031460b3e 100644 --- a/docs/set-timer.md +++ b/docs/set-timer.md @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of set-timer.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of set-timer.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/set-volume.md b/docs/set-volume.md index 00b4189c3..2eff3e36e 100644 --- a/docs/set-volume.md +++ b/docs/set-volume.md @@ -77,4 +77,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of set-volume.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of set-volume.ps1 as of 05/19/2024 10:25:25)* diff --git a/docs/set-wallpaper.md b/docs/set-wallpaper.md index 0ca77a2dc..9979a799b 100644 --- a/docs/set-wallpaper.md +++ b/docs/set-wallpaper.md @@ -122,4 +122,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of set-wallpaper.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of set-wallpaper.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/show-lightnings.md b/docs/show-lightnings.md index 39a84a039..6b3a8c79a 100644 --- a/docs/show-lightnings.md +++ b/docs/show-lightnings.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of show-lightnings.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of show-lightnings.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/show-notification.md b/docs/show-notification.md index 9efd354c2..855eadd7c 100644 --- a/docs/show-notification.md +++ b/docs/show-notification.md @@ -6,9 +6,10 @@ This PowerShell script shows a toast-message notification for the Windows 10 Not Parameters ---------- ```powershell -PS> ./show-notification.ps1 [[-Text] ] [[-Title] ] [[-Duration] ] [] +PS> ./show-notification.ps1 [[-text] ] [[-title] ] [[-Duration] ] [] --Text +-text + Specifies the text to show ('Hello World' by default) Required? false Position? 1 @@ -16,7 +17,8 @@ PS> ./show-notification.ps1 [[-Text] ] [[-Title] ] [[-Duration] Accept pipeline input? false Accept wildcard characters? false --Title +-title + Specifies the title to show ('NOTE' by default) Required? false Position? 2 @@ -25,6 +27,7 @@ PS> ./show-notification.ps1 [[-Text] ] [[-Title] ] [[-Duration] Accept wildcard characters? false -Duration + Specifies the view duration in milliseconds (5000 by default) Required? false Position? 3 @@ -40,7 +43,7 @@ PS> ./show-notification.ps1 [[-Text] ] [[-Title] ] [[-Duration] Example ------- ```powershell -PS> ./show-notification "Hello World" +PS> ./show-notification ``` @@ -60,15 +63,21 @@ Script Content Shows a notification .DESCRIPTION This PowerShell script shows a toast-message notification for the Windows 10 Notification Center. +.PARAMETER text + Specifies the text to show ('Hello World' by default) +.PARAMETER title + Specifies the title to show ('NOTE' by default) +.PARAMETER duration + Specifies the view duration in milliseconds (5000 by default) .EXAMPLE - PS> ./show-notification "Hello World" + PS> ./show-notification .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> -param([string]$Text = "Hello World", [string]$Title = "NOTE", [int]$Duration = 5000) +param([string]$text = "Hello World", [string]$title = "NOTE", [int]$Duration = 5000) try { Add-Type -AssemblyName System.Windows.Forms @@ -76,8 +85,8 @@ try { $path = (Get-Process -id $pid).Path $balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) $balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Info - $balloon.BalloonTipText = $Text - $balloon.BalloonTipTitle = $Title + $balloon.BalloonTipText = $text + $balloon.BalloonTipTitle = $title $balloon.Visible = $true $balloon.ShowBalloonTip($Duration) exit 0 # success @@ -87,4 +96,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of show-notification.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of show-notification.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/show-traffic.md b/docs/show-traffic.md index 7e2a76f0d..992a30def 100644 --- a/docs/show-traffic.md +++ b/docs/show-traffic.md @@ -48,4 +48,4 @@ Script Content exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of show-traffic.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of show-traffic.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/simulate-presence.md b/docs/simulate-presence.md index 5583e63d1..3da308da8 100644 --- a/docs/simulate-presence.md +++ b/docs/simulate-presence.md @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of simulate-presence.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of simulate-presence.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/smart-data2csv.md b/docs/smart-data2csv.md index 18ae0686d..b162fec51 100644 --- a/docs/smart-data2csv.md +++ b/docs/smart-data2csv.md @@ -141,4 +141,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of smart-data2csv.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of smart-data2csv.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-arabic.md b/docs/speak-arabic.md index 1aea102c9..9810b043f 100644 --- a/docs/speak-arabic.md +++ b/docs/speak-arabic.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-arabic.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-arabic.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-checklist.md b/docs/speak-checklist.md index 16e121024..0ff517b84 100644 --- a/docs/speak-checklist.md +++ b/docs/speak-checklist.md @@ -78,4 +78,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-checklist.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-checklist.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-countdown.md b/docs/speak-countdown.md index 7cb1d73ac..78a749dea 100644 --- a/docs/speak-countdown.md +++ b/docs/speak-countdown.md @@ -70,4 +70,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-countdown.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-countdown.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-croatian.md b/docs/speak-croatian.md index a4276e4e3..57188ccc6 100644 --- a/docs/speak-croatian.md +++ b/docs/speak-croatian.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-croatian.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-croatian.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-danish.md b/docs/speak-danish.md index 71da933bd..b5ffe5850 100644 --- a/docs/speak-danish.md +++ b/docs/speak-danish.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-danish.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-danish.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-dutch.md b/docs/speak-dutch.md index c1ff00202..5687863d1 100644 --- a/docs/speak-dutch.md +++ b/docs/speak-dutch.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-dutch.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-dutch.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-english.md b/docs/speak-english.md index ccaa5af6d..9b000164d 100644 --- a/docs/speak-english.md +++ b/docs/speak-english.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-english.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-english.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-epub.md b/docs/speak-epub.md index 7219e1438..de7a84fd5 100644 --- a/docs/speak-epub.md +++ b/docs/speak-epub.md @@ -139,4 +139,4 @@ foreach($item in $content.package.manifest.Item) { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-epub.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-epub.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-esperanto.md b/docs/speak-esperanto.md index ac5034886..8276befa5 100644 --- a/docs/speak-esperanto.md +++ b/docs/speak-esperanto.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-esperanto.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-esperanto.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-file.md b/docs/speak-file.md index b373d9754..407097636 100644 --- a/docs/speak-file.md +++ b/docs/speak-file.md @@ -71,4 +71,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-file.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-file.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-finnish.md b/docs/speak-finnish.md index 5d3013e11..c64ab3485 100644 --- a/docs/speak-finnish.md +++ b/docs/speak-finnish.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-finnish.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-finnish.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-french.md b/docs/speak-french.md index a42820518..96064937d 100644 --- a/docs/speak-french.md +++ b/docs/speak-french.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-french.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-french.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-german.md b/docs/speak-german.md index bf1b4d4f9..831fd8d33 100644 --- a/docs/speak-german.md +++ b/docs/speak-german.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-german.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-german.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-greek.md b/docs/speak-greek.md index aa1c55f91..c3a4006b5 100644 --- a/docs/speak-greek.md +++ b/docs/speak-greek.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-greek.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-greek.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-hebrew.md b/docs/speak-hebrew.md index d3b4ea85a..a66a5045a 100644 --- a/docs/speak-hebrew.md +++ b/docs/speak-hebrew.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-hebrew.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-hebrew.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-hindi.md b/docs/speak-hindi.md index dad51942f..96427140a 100644 --- a/docs/speak-hindi.md +++ b/docs/speak-hindi.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-hindi.ps1 as of 03/27/2024 17:36:31)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-hindi.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-italian.md b/docs/speak-italian.md index 23b661d05..4eb023b46 100644 --- a/docs/speak-italian.md +++ b/docs/speak-italian.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-italian.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-italian.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-japanese.md b/docs/speak-japanese.md index 231884057..bb7b6c8e9 100644 --- a/docs/speak-japanese.md +++ b/docs/speak-japanese.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-japanese.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-japanese.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-korean.md b/docs/speak-korean.md index 9cf16e5e6..14bfd9ea5 100644 --- a/docs/speak-korean.md +++ b/docs/speak-korean.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-korean.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-korean.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-latin.md b/docs/speak-latin.md index 5cb2865b3..ecbbf5871 100644 --- a/docs/speak-latin.md +++ b/docs/speak-latin.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-latin.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-latin.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-mandarin.md b/docs/speak-mandarin.md index c63ab8c0a..78b3ce458 100644 --- a/docs/speak-mandarin.md +++ b/docs/speak-mandarin.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-mandarin.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-mandarin.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-norwegian.md b/docs/speak-norwegian.md index 2abd1cf44..74f09fb29 100644 --- a/docs/speak-norwegian.md +++ b/docs/speak-norwegian.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-norwegian.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-norwegian.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-polish.md b/docs/speak-polish.md index 5835be971..f21affc84 100644 --- a/docs/speak-polish.md +++ b/docs/speak-polish.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-polish.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-polish.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-portuguese.md b/docs/speak-portuguese.md index afc57e882..40bc60d79 100644 --- a/docs/speak-portuguese.md +++ b/docs/speak-portuguese.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-portuguese.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-portuguese.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-russian.md b/docs/speak-russian.md index 292288f90..a5d7de474 100644 --- a/docs/speak-russian.md +++ b/docs/speak-russian.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-russian.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-russian.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-spanish.md b/docs/speak-spanish.md index a74b63154..b27a165b2 100644 --- a/docs/speak-spanish.md +++ b/docs/speak-spanish.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-spanish.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-spanish.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-swedish.md b/docs/speak-swedish.md index 784bb1c61..6ba5a9a48 100644 --- a/docs/speak-swedish.md +++ b/docs/speak-swedish.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-swedish.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-swedish.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-test.md b/docs/speak-test.md index bd5ae4919..5d7823fa4 100644 --- a/docs/speak-test.md +++ b/docs/speak-test.md @@ -83,4 +83,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-test.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-test.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-text.md b/docs/speak-text.md index 48a6ca42c..87a4533ab 100644 --- a/docs/speak-text.md +++ b/docs/speak-text.md @@ -69,4 +69,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-text.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-text.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-thai.md b/docs/speak-thai.md index 8550d3d67..02b913c07 100644 --- a/docs/speak-thai.md +++ b/docs/speak-thai.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-thai.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-thai.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-turkish.md b/docs/speak-turkish.md index 48f257fca..489250b3a 100644 --- a/docs/speak-turkish.md +++ b/docs/speak-turkish.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-turkish.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-turkish.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/speak-ukrainian.md b/docs/speak-ukrainian.md index fdd2cabb8..4d4a69af0 100644 --- a/docs/speak-ukrainian.md +++ b/docs/speak-ukrainian.md @@ -75,4 +75,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of speak-ukrainian.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of speak-ukrainian.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/spell-word.md b/docs/spell-word.md index 6c0ba1944..c03e00fd8 100644 --- a/docs/spell-word.md +++ b/docs/spell-word.md @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of spell-word.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of spell-word.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/start-ipfs-server.md b/docs/start-ipfs-server.md index a99985141..6474823b1 100644 --- a/docs/start-ipfs-server.md +++ b/docs/start-ipfs-server.md @@ -90,4 +90,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of start-ipfs-server.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of start-ipfs-server.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/suspend.md b/docs/suspend.md index 7d48566d8..5d4e6e9ca 100644 --- a/docs/suspend.md +++ b/docs/suspend.md @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of suspend.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of suspend.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/switch-branch.md b/docs/switch-branch.md index 2e900bca4..4d34c4f49 100644 --- a/docs/switch-branch.md +++ b/docs/switch-branch.md @@ -1,7 +1,7 @@ Script: *switch-branch.ps1* ======================== -This PowerShell script switches to a given branch in a Git repository (including updating submodules). +This PowerShell script switches to the given branch in a Git repository (also updates submodules). Parameters ---------- @@ -9,7 +9,7 @@ Parameters PS> ./switch-branch.ps1 [[-branchName] ] [[-pathToRepo] ] [] -branchName - Specifies the target branch name + Specifies the Git branch name to switch to Required? false Position? 1 @@ -36,12 +36,12 @@ Example ```powershell PS> ./switch-branch main C:\Repos\rust ⏳ (1/6) Searching for Git executable... git version 2.43.0.windows.1 -⏳ (2/6) Checking Git repository... -⏳ (3/6) Fetching updates... +⏳ (2/6) Checking local repository... πŸ“‚C:\Repos\rust +⏳ (3/6) Fetching remote updates... ⏳ (4/6) Switching to branch 'main'... -⏳ (5/6) Pulling updates... +⏳ (5/6) Pulling remote updates... ⏳ (6/6) Updating submodules... -βœ”οΈ Switched πŸ“‚rust repository to 'main' branch in 22 sec. +βœ”οΈ Switched πŸ“‚rust repo to 'main' branch in 22s. ``` @@ -60,20 +60,20 @@ Script Content .SYNOPSIS Switches the Git branch .DESCRIPTION - This PowerShell script switches to a given branch in a Git repository (including updating submodules). + This PowerShell script switches to the given branch in a Git repository (also updates submodules). .PARAMETER branchName - Specifies the target branch name + Specifies the Git branch name to switch to .PARAMETER pathToRepo Specifies the file path to the local Git repository .EXAMPLE PS> ./switch-branch main C:\Repos\rust ⏳ (1/6) Searching for Git executable... git version 2.43.0.windows.1 - ⏳ (2/6) Checking Git repository... - ⏳ (3/6) Fetching updates... + ⏳ (2/6) Checking local repository... πŸ“‚C:\Repos\rust + ⏳ (3/6) Fetching remote updates... ⏳ (4/6) Switching to branch 'main'... - ⏳ (5/6) Pulling updates... + ⏳ (5/6) Pulling remote updates... ⏳ (6/6) Updating submodules... - βœ”οΈ Switched πŸ“‚rust repository to 'main' branch in 22 sec. + βœ”οΈ Switched πŸ“‚rust repo to 'main' branch in 22s. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -84,7 +84,6 @@ param([string]$branchName = "", [string]$pathToRepo = "$PWD") try { if ($branchName -eq "") { $branchName = Read-Host "Enter the branch name to switch to" } - if ($pathToRepo -eq "") { $pathToRepo = Read-Host "Enter the file path to the Git repository" } $stopWatch = [system.diagnostics.stopwatch]::startNew() @@ -92,15 +91,14 @@ try { & git --version if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } - Write-Host "⏳ (2/6) Checking Git repository..." - $pathToRepo = Resolve-Path "$pathToRepo" + Write-Host "⏳ (2/6) Checking local repository... πŸ“‚$pathToRepo" if (-not(Test-Path "$pathToRepo" -pathType container)) { throw "Can't access repo folder: $pathToRepo" } - $result = (git status) + $result = (git -C "$pathToRepo" status) if ($lastExitCode -ne "0") { throw "'git status' in $pathToRepo failed with exit code $lastExitCode" } if ("$result" -notmatch "nothing to commit, working tree clean") { throw "Git repository is NOT clean: $result" } $repoDirName = (Get-Item "$pathToRepo").Name - "⏳ (3/6) Fetching updates..." + "⏳ (3/6) Fetching remote updates..." & git -C "$pathToRepo" fetch --all --prune --prune-tags --force if ($lastExitCode -ne "0") { throw "'git fetch' failed with exit code $lastExitCode" } @@ -108,7 +106,7 @@ try { & git -C "$pathToRepo" checkout --recurse-submodules "$branchName" if ($lastExitCode -ne "0") { throw "'git checkout $branchName' failed with exit code $lastExitCode" } - "⏳ (5/6) Pulling updates..." + "⏳ (5/6) Pulling remote updates..." & git -C "$pathToRepo" pull --recurse-submodules if ($lastExitCode -ne "0") { throw "'git pull' failed with exit code $lastExitCode" } @@ -117,7 +115,7 @@ try { if ($lastExitCode -ne "0") { throw "'git submodule update' failed with exit code $lastExitCode" } [int]$elapsed = $stopWatch.Elapsed.TotalSeconds - "βœ”οΈ Switched πŸ“‚$repoDirName repository to '$branchName' branch in $elapsed sec." + "βœ”οΈ Switched πŸ“‚$repoDirName repo to '$branchName' branch in $($elapsed)s." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -125,4 +123,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of switch-branch.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of switch-branch.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/switch-shelly1.md b/docs/switch-shelly1.md index bad0d16ef..aea5b952e 100644 --- a/docs/switch-shelly1.md +++ b/docs/switch-shelly1.md @@ -94,4 +94,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of switch-shelly1.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of switch-shelly1.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/switch-tabs.md b/docs/switch-tabs.md index b0ef4325e..9bf086779 100644 --- a/docs/switch-tabs.md +++ b/docs/switch-tabs.md @@ -76,4 +76,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of switch-tabs.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of switch-tabs.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/sync-folder.md b/docs/sync-folder.md index 0be64233c..e331f9a56 100644 --- a/docs/sync-folder.md +++ b/docs/sync-folder.md @@ -96,4 +96,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of sync-folder.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of sync-folder.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/sync-repo.md b/docs/sync-repo.md index 9a2f4fb60..65cccb1ad 100644 --- a/docs/sync-repo.md +++ b/docs/sync-repo.md @@ -95,4 +95,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of sync-repo.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of sync-repo.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/tell-joke.md b/docs/tell-joke.md index 3981a6027..b6bbc8c7e 100644 --- a/docs/tell-joke.md +++ b/docs/tell-joke.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of tell-joke.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of tell-joke.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/tell-new-year.md b/docs/tell-new-year.md new file mode 100644 index 000000000..af6254e8e --- /dev/null +++ b/docs/tell-new-year.md @@ -0,0 +1,65 @@ +Script: *tell-new-year.ps1* +======================== + +This PowerShell script calculates the time until New Year and replies by text-to-speech (TTS). + +Parameters +---------- +```powershell +PS> ./tell-new-year.ps1 [] + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./tell-new-year.ps1 +(listen and enjoy) + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Tells the time until New Year +.DESCRIPTION + This PowerShell script calculates the time until New Year and replies by text-to-speech (TTS). +.EXAMPLE + PS> ./tell-new-year.ps1 + (listen and enjoy) +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +try { + $now = [DateTime]::Now + $NewYear = [Datetime]("12/31/" + $now.Year) + $days = ($NewYear – $now).Days + 1 + if ($days -gt 1) { + & "$PSScriptRoot/speak-english.ps1" "New Year is in $days days." + } elseif ($days -eq 1) { + & "$PSScriptRoot/speak-english.ps1" "New Year is tomorrow." + } + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of tell-new-year.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/tell-quote.md b/docs/tell-quote.md index 2cdeaa219..ae3a54323 100644 --- a/docs/tell-quote.md +++ b/docs/tell-quote.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of tell-quote.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of tell-quote.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/toggle-caps-lock.md b/docs/toggle-caps-lock.md index 5f7a63946..697ab9b6b 100644 --- a/docs/toggle-caps-lock.md +++ b/docs/toggle-caps-lock.md @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of toggle-caps-lock.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of toggle-caps-lock.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/toggle-num-lock.md b/docs/toggle-num-lock.md index c06678901..abeeadecb 100644 --- a/docs/toggle-num-lock.md +++ b/docs/toggle-num-lock.md @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of toggle-num-lock.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of toggle-num-lock.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/toggle-scroll-lock.md b/docs/toggle-scroll-lock.md index f5c7458dd..23653b42c 100644 --- a/docs/toggle-scroll-lock.md +++ b/docs/toggle-scroll-lock.md @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of toggle-scroll-lock.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of toggle-scroll-lock.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/translate-file.md b/docs/translate-file.md index 9e3983bd6..6bd7ef74e 100644 --- a/docs/translate-file.md +++ b/docs/translate-file.md @@ -108,4 +108,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of translate-file.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of translate-file.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/translate-files.md b/docs/translate-files.md index 722f782ca..720fa2e4f 100644 --- a/docs/translate-files.md +++ b/docs/translate-files.md @@ -105,4 +105,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of translate-files.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of translate-files.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/translate-text.md b/docs/translate-text.md index 345d83d14..f022c61a8 100644 --- a/docs/translate-text.md +++ b/docs/translate-text.md @@ -104,4 +104,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of translate-text.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of translate-text.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/turn-volume-down.md b/docs/turn-volume-down.md index 3c0356cef..ce405d4e5 100644 --- a/docs/turn-volume-down.md +++ b/docs/turn-volume-down.md @@ -69,4 +69,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-down.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-down.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/turn-volume-fully-up.md b/docs/turn-volume-fully-up.md index 82a6e40c7..93aa8ce08 100644 --- a/docs/turn-volume-fully-up.md +++ b/docs/turn-volume-fully-up.md @@ -56,4 +56,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-fully-up.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-fully-up.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/turn-volume-off.md b/docs/turn-volume-off.md index 7c15fbfe2..1bb636240 100644 --- a/docs/turn-volume-off.md +++ b/docs/turn-volume-off.md @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-off.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-off.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/turn-volume-on.md b/docs/turn-volume-on.md index 262945709..fb367d4b2 100644 --- a/docs/turn-volume-on.md +++ b/docs/turn-volume-on.md @@ -54,4 +54,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-on.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-on.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/turn-volume-up.md b/docs/turn-volume-up.md index 00c32587c..b77273a6b 100644 --- a/docs/turn-volume-up.md +++ b/docs/turn-volume-up.md @@ -69,4 +69,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-up.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of turn-volume-up.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/uninstall-all-apps.md b/docs/uninstall-all-apps.md index a844a6c0e..f99590fb5 100644 --- a/docs/uninstall-all-apps.md +++ b/docs/uninstall-all-apps.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-all-apps.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-all-apps.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/uninstall-bloatware.md b/docs/uninstall-bloatware.md index ba35a7348..b1fea4853 100644 --- a/docs/uninstall-bloatware.md +++ b/docs/uninstall-bloatware.md @@ -98,4 +98,4 @@ winget uninstall 'Prime Video for Windows' exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-bloatware.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-bloatware.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/uninstall-chrome.md b/docs/uninstall-chrome.md index daddb7ee6..3dbcd05d9 100644 --- a/docs/uninstall-chrome.md +++ b/docs/uninstall-chrome.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-chrome.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-chrome.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/uninstall-crystal-disk-info.md b/docs/uninstall-crystal-disk-info.md index 5d747bb4d..7e49bf184 100644 --- a/docs/uninstall-crystal-disk-info.md +++ b/docs/uninstall-crystal-disk-info.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-crystal-disk-info.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-crystal-disk-info.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/uninstall-crystal-disk-mark.md b/docs/uninstall-crystal-disk-mark.md index 2dae7ed0a..8b0550a61 100644 --- a/docs/uninstall-crystal-disk-mark.md +++ b/docs/uninstall-crystal-disk-mark.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-crystal-disk-mark.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-crystal-disk-mark.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/uninstall-discord.md b/docs/uninstall-discord.md index 41fe68b2f..44d7a32ec 100644 --- a/docs/uninstall-discord.md +++ b/docs/uninstall-discord.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-discord.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-discord.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/uninstall-edge.md b/docs/uninstall-edge.md index 1b07822bb..e0b2dbd36 100644 --- a/docs/uninstall-edge.md +++ b/docs/uninstall-edge.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-edge.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-edge.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/uninstall-firefox.md b/docs/uninstall-firefox.md index 225005dc1..5c16d55f4 100644 --- a/docs/uninstall-firefox.md +++ b/docs/uninstall-firefox.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-firefox.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-firefox.ps1 as of 05/19/2024 10:25:26)* diff --git a/docs/uninstall-git-extensions.md b/docs/uninstall-git-extensions.md index f456c1fb7..63c2c5bc9 100644 --- a/docs/uninstall-git-extensions.md +++ b/docs/uninstall-git-extensions.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-git-extensions.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-git-extensions.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/uninstall-github-cli.md b/docs/uninstall-github-cli.md index b823c5c50..32bbd563d 100644 --- a/docs/uninstall-github-cli.md +++ b/docs/uninstall-github-cli.md @@ -70,4 +70,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-github-cli.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-github-cli.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/uninstall-irfanview.md b/docs/uninstall-irfanview.md index b163a3337..a7a7e6f3c 100644 --- a/docs/uninstall-irfanview.md +++ b/docs/uninstall-irfanview.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-irfanview.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-irfanview.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/uninstall-microsoft-teams.md b/docs/uninstall-microsoft-teams.md index fc4cb237e..86487e721 100644 --- a/docs/uninstall-microsoft-teams.md +++ b/docs/uninstall-microsoft-teams.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-microsoft-teams.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-microsoft-teams.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/uninstall-netflix.md b/docs/uninstall-netflix.md index 208e4456a..677471153 100644 --- a/docs/uninstall-netflix.md +++ b/docs/uninstall-netflix.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-netflix.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-netflix.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/uninstall-nine-zip.md b/docs/uninstall-nine-zip.md index aef64df9c..f70e8705d 100644 --- a/docs/uninstall-nine-zip.md +++ b/docs/uninstall-nine-zip.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-nine-zip.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-nine-zip.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/uninstall-one-calendar.md b/docs/uninstall-one-calendar.md index 093d10cc5..45718346d 100644 --- a/docs/uninstall-one-calendar.md +++ b/docs/uninstall-one-calendar.md @@ -60,4 +60,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-one-calendar.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-one-calendar.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/uninstall-opera-browser.md b/docs/uninstall-opera-browser.md index 745c7644a..b4f0846d0 100644 --- a/docs/uninstall-opera-browser.md +++ b/docs/uninstall-opera-browser.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-opera-browser.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-opera-browser.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/uninstall-opera-gx.md b/docs/uninstall-opera-gx.md index 6b2bcf0f2..338fee9f1 100644 --- a/docs/uninstall-opera-gx.md +++ b/docs/uninstall-opera-gx.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-opera-gx.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-opera-gx.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/uninstall-paint-3d.md b/docs/uninstall-paint-3d.md index 456860124..0c8181fe3 100644 --- a/docs/uninstall-paint-3d.md +++ b/docs/uninstall-paint-3d.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-paint-3d.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-paint-3d.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/uninstall-rufus.md b/docs/uninstall-rufus.md index 9c59e1944..abb4a85b0 100644 --- a/docs/uninstall-rufus.md +++ b/docs/uninstall-rufus.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-rufus.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-rufus.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/uninstall-skype.md b/docs/uninstall-skype.md index cc653f5ac..0fc574516 100644 --- a/docs/uninstall-skype.md +++ b/docs/uninstall-skype.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-skype.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-skype.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/uninstall-spotify.md b/docs/uninstall-spotify.md index c27c64046..c525c0b48 100644 --- a/docs/uninstall-spotify.md +++ b/docs/uninstall-spotify.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-spotify.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-spotify.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/uninstall-twitter.md b/docs/uninstall-twitter.md index aa307a4c5..7da9ec528 100644 --- a/docs/uninstall-twitter.md +++ b/docs/uninstall-twitter.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-twitter.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-twitter.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/uninstall-visual-studio-code.md b/docs/uninstall-visual-studio-code.md index 349ea787f..f8e738f9a 100644 --- a/docs/uninstall-visual-studio-code.md +++ b/docs/uninstall-visual-studio-code.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-visual-studio-code.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-visual-studio-code.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/uninstall-vlc.md b/docs/uninstall-vlc.md index ad5743a51..c28f7c4b2 100644 --- a/docs/uninstall-vlc.md +++ b/docs/uninstall-vlc.md @@ -64,4 +64,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-vlc.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-vlc.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/uninstall-windows-terminal.md b/docs/uninstall-windows-terminal.md index 15fa96b85..93062c692 100644 --- a/docs/uninstall-windows-terminal.md +++ b/docs/uninstall-windows-terminal.md @@ -58,4 +58,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-windows-terminal.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of uninstall-windows-terminal.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/update-powershell-profile.md b/docs/update-powershell-profile.md new file mode 100644 index 000000000..dbe3e5e11 --- /dev/null +++ b/docs/update-powershell-profile.md @@ -0,0 +1,83 @@ +Script: *update-powershell-profile.ps1* +======================== + +This PowerShell script write/overwrites the PowerShell profile for the current user. + +Parameters +---------- +```powershell +PS> ./update-powershell-profile.ps1 [[-path] ] [] + +-path + Specifies the path to the new profile ($PSScriptRoot/my-profile.ps1 by default) + + Required? false + Position? 1 + Default value "$PSScriptRoot/my-profile.ps1" + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./update-powershell-profile.ps1 +⏳ (1/2) Query location of PowerShell profile 'CurrentUserCurrentHost'... +⏳ (2/2) Copy my-profile.ps1 to C:\Users\Markus\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1... +βœ”οΈ Your PowerShell profile is updated - it get's active on next login. + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Updates the PowerShell profile +.DESCRIPTION + This PowerShell script write/overwrites the PowerShell profile for the current user. +.PARAMETER path + Specifies the path to the new profile ($PSScriptRoot/my-profile.ps1 by default) +.EXAMPLE + PS> ./update-powershell-profile.ps1 + ⏳ (1/2) Query location of PowerShell profile 'CurrentUserCurrentHost'... + ⏳ (2/2) Copy my-profile.ps1 to C:\Users\Markus\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1... + βœ”οΈ Your PowerShell profile is updated - it get's active on next login. +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([string]$path = "$PSScriptRoot/my-profile.ps1") + +try { + "⏳ (1/2) Query location of PowerShell profile 'CurrentUserCurrentHost'..." + $pathToProfile = $PROFILE.CurrentUserCurrentHost + + $filename = (Get-Item "$path").Name + "⏳ (2/2) Copy $filename to $pathToProfile..." + $null = New-Item -Path $pathToProfile -ItemType "file" -Force + Copy-Item "$path" "$pathToProfile" -force + + "βœ”οΈ Your PowerShell profile is updated - it get's active on next login." + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of update-powershell-profile.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/upgrade-ubuntu.md b/docs/upgrade-ubuntu.md index 0b919e966..3b47980c7 100644 --- a/docs/upgrade-ubuntu.md +++ b/docs/upgrade-ubuntu.md @@ -87,4 +87,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of upgrade-ubuntu.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of upgrade-ubuntu.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/upload-file.md b/docs/upload-file.md index 4f3f75adf..a62db7275 100644 --- a/docs/upload-file.md +++ b/docs/upload-file.md @@ -145,4 +145,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of upload-file.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of upload-file.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/upload-to-dropbox.md b/docs/upload-to-dropbox.md index 6f5391a79..c36e588b8 100644 --- a/docs/upload-to-dropbox.md +++ b/docs/upload-to-dropbox.md @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of upload-to-dropbox.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of upload-to-dropbox.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/wake-up.md b/docs/wake-up.md index 1b8dc8e87..0edb1a9f6 100644 --- a/docs/wake-up.md +++ b/docs/wake-up.md @@ -53,7 +53,7 @@ Example ------- ```powershell PS> ./wake-up.ps1 11:22:33:44:55:66 192.168.100.100 -βœ”οΈ Sent magic packet to IP 192.168.100.100, UDP port 9 (3 times). Wait a minute until the computer fully boots up. +βœ”οΈ Magic packet sent 3x to IP 192.168.100.100, UDP port 9 - wait a minute until the computer fully boots up. ``` @@ -83,7 +83,7 @@ Script Content Specifies # of times to send the packet (3 by default) .EXAMPLE PS> ./wake-up.ps1 11:22:33:44:55:66 192.168.100.100 - βœ”οΈ Sent magic packet to IP 192.168.100.100, UDP port 9 (3 times). Wait a minute until the computer fully boots up. + βœ”οΈ Magic packet sent 3x to IP 192.168.100.100, UDP port 9 - wait a minute until the computer fully boots up. .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -109,10 +109,10 @@ try { if ($ipAddr -eq "" ) { $ipAddr = Read-Host "Enter the host's IP or subnet address, e.g. 192.168.0.255" } for ($i = 0; $i -lt $numTimes; $i++) { - Send-WOL $macAddr $ipAddr $udpPort + Send-WOL $macAddr.Trim() $ipAddr.Trim() $udpPort Start-Sleep -milliseconds 100 } - "βœ”οΈ Sent magic packet to IP $ipAddr, UDP port $udpPort ($numTimes times). Wait a minute until the computer fully boots up." + "βœ”οΈ Magic packet sent $($numTimes)x to IP $ipAddr, UDP port $udpPort - wait a minute until the computer fully boots up." exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -120,4 +120,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of wake-up.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of wake-up.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/watch-commits.md b/docs/watch-commits.md new file mode 100644 index 000000000..070b285c9 --- /dev/null +++ b/docs/watch-commits.md @@ -0,0 +1,118 @@ +Script: *watch-commits.ps1* +======================== + +This PowerShell script permanently lists the latest commit in a Git repository in real-time. + +Parameters +---------- +```powershell +PS> ./watch-commits.ps1 [[-pathToRepo] ] [[-updateInterval] ] [[-speed] ] [] + +-pathToRepo + Specifies the file path to the local Git repository. + + Required? false + Position? 1 + Default value "$PWD" + Accept pipeline input? false + Accept wildcard characters? false + +-updateInterval + + Required? false + Position? 2 + Default value 30 + Accept pipeline input? false + Accept wildcard characters? false + +-speed + + Required? false + Position? 3 + Default value 17 + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./commit-ticker.ps1 +❇️ Updated general.csv by Markus Fleschutz (HEAD -> main, origin/main, origin/HEAD) +... + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Show commits live in real-time. +.DESCRIPTION + This PowerShell script permanently lists the latest commit in a Git repository in real-time. +.PARAMETER pathToRepo + Specifies the file path to the local Git repository. +.EXAMPLE + PS> ./commit-ticker.ps1 + ❇️ Updated general.csv by Markus Fleschutz (HEAD -> main, origin/main, origin/HEAD) + ... +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([string]$pathToRepo = "$PWD", [int]$updateInterval = 30, [int]$speed = 17) + +try { + Write-Progress "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 "Checking file patch to Git repository..." + if (-not(Test-Path "$pathToRepo" -pathType container)) { throw "Can't access directory: $pathToRepo" } + + Write-Progress "Fetching updates..." + & git -C "$pathToRepo" fetch --all --recurse-submodules=no --jobs=1 --quiet + if ($lastExitCode -ne "0") { throw "'git fetch' failed" } + Write-Progress -completed "Done." + + $prevLine = "" + $tzOffset = (Get-Timezone).BaseUtcOffset.TotalSeconds + for (;;) { + $line = (git -C "$pathToRepo" log origin --format=format:'%at %s by %an%d' --max-count=1) + if ($line -ne $prevLine) { + $unixTimestamp = [int64]$line.Substring(0,10) + $time = (Get-Date -day 1 -month 1 -year 1970 -hour 0 -minute 0 -second 0).AddSeconds($unixTimestamp) + $time = $time.AddSeconds($tzOffset) + $timeString = $time.ToString("HH:mm") + $message = $line.Substring(11) + & "$PSScriptRoot/write-typewriter.ps1" "❇️ $timeString $message" $speed + $prevLine = $line + } else { + Start-Sleep -seconds $updateInterval + } + & git -C "$pathToRepo" fetch --all --recurse-submodules=no --jobs=1 --quiet + if ($lastExitCode -ne "0") { throw "'git fetch' 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 watch-commits.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/watch-file.md b/docs/watch-file.md index 7680b2e35..e471ebfdb 100644 --- a/docs/watch-file.md +++ b/docs/watch-file.md @@ -64,4 +64,4 @@ function Watch-File { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of watch-file.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of watch-file.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/watch-news.md b/docs/watch-news.md new file mode 100644 index 000000000..5cdfefed3 --- /dev/null +++ b/docs/watch-news.md @@ -0,0 +1,93 @@ +Script: *watch-news.ps1* +======================== + +This PowerShell script lists the latest headlines by using a RSS (Really Simple Syndication) feed. + +Parameters +---------- +```powershell +PS> ./watch-news.ps1 [[-RSS_URL] ] [[-timeInterval] ] [] + +-RSS_URL + Specifies the URL to the RSS feed (Yahoo World News by default) + + Required? false + Position? 1 + Default value https://news.yahoo.com/rss/world + Accept pipeline input? false + Accept wildcard characters? false + +-timeInterval + + Required? false + Position? 2 + Default value 30000 + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./watch-headlines.ps1 + ❇️ Niger coup: Ecowas deadline sparks anxiety in northern Nigeria ❇️ + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Watch the latest headlines +.DESCRIPTION + This PowerShell script lists the latest headlines by using a RSS (Really Simple Syndication) feed. +.PARAMETER RSS_URL + Specifies the URL to the RSS feed (Yahoo World News by default) +.EXAMPLE + PS> ./watch-headlines.ps1 + ❇️ Niger coup: Ecowas deadline sparks anxiety in northern Nigeria ❇️ +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([string]$RSS_URL = "https://news.yahoo.com/rss/world", [int]$timeInterval = 30000) # in ms + +function GetLatestHeadline { + [xml]$content = (Invoke-WebRequest -URI $RSS_URL -useBasicParsing).Content + foreach ($item in $content.rss.channel.item) { return "$($item.title)" } + return "" +} + +try { + $previous = "" + while ($true) { + $latest = GetLatestHeadline + if ($latest -ne $previous) { + & "$PSScriptRoot/write-animated.ps1" "❇️ $latest ❇️" + $previous = $latest + } + Start-Sleep -milliseconds $timeInterval + } + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of watch-news.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/weather-report.md b/docs/weather-report.md index 8e6c9dcc4..fb7156748 100644 --- a/docs/weather-report.md +++ b/docs/weather-report.md @@ -66,4 +66,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of weather-report.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of weather-report.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/weather.md b/docs/weather.md index cc3d3db2a..57e5c17c2 100644 --- a/docs/weather.md +++ b/docs/weather.md @@ -66,4 +66,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of weather.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of weather.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/what-is.md b/docs/what-is.md index d5fbe9c68..9ca1ad396 100644 --- a/docs/what-is.md +++ b/docs/what-is.md @@ -79,4 +79,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of what-is.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of what-is.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/windefender.md b/docs/windefender.md index 5d08d5cc5..dac9004b7 100644 --- a/docs/windefender.md +++ b/docs/windefender.md @@ -82,4 +82,4 @@ break } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of windefender.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of windefender.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-animated.md b/docs/write-animated.md index ffe95aded..ee50963c8 100644 --- a/docs/write-animated.md +++ b/docs/write-animated.md @@ -1,90 +1,28 @@ Script: *write-animated.ps1* ======================== -This PowerShell script writes animated text to the console. +This PowerShell script writes text centered and animated to the console. Parameters ---------- ```powershell -PS> ./write-animated.ps1 [[-Line1] ] [[-Line2] ] [[-Line3] ] [[-Line4] ] [[-Line5] ] [[-Line6] ] [[-Line7] ] [[-Line8] ] [[-Line9] ] [[-Speed] ] [] +PS> ./write-animated.ps1 [[-text] ] [[-speed] ] [] --Line1 +-text + Specifies the text line to write ("Welcome to PowerShell" by default) Required? false Position? 1 - Default value + Default value Welcome to PowerShell Accept pipeline input? false Accept wildcard characters? false --Line2 +-speed + Specifies the animation speed per character (10ms by default) Required? false Position? 2 - Default value - Accept pipeline input? false - Accept wildcard characters? false - --Line3 - - Required? false - Position? 3 - Default value - Accept pipeline input? false - Accept wildcard characters? false - --Line4 - - Required? false - Position? 4 - Default value - Accept pipeline input? false - Accept wildcard characters? false - --Line5 - - Required? false - Position? 5 - Default value - Accept pipeline input? false - Accept wildcard characters? false - --Line6 - - Required? false - Position? 6 - Default value - Accept pipeline input? false - Accept wildcard characters? false - --Line7 - - Required? false - Position? 7 - Default value - Accept pipeline input? false - Accept wildcard characters? false - --Line8 - - Required? false - Position? 8 - Default value - Accept pipeline input? false - Accept wildcard characters? false - --Line9 - - Required? false - Position? 9 - Default value - Accept pipeline input? false - Accept wildcard characters? false - --Speed - - Required? false - Position? 10 - Default value 30 + Default value 10 Accept pipeline input? false Accept wildcard characters? false @@ -96,7 +34,8 @@ PS> ./write-animated.ps1 [[-Line1] ] [[-Line2] ] [[-Line3] ./write-animated "Hello World" +PS> ./write-animated.ps1 +(watch and enjoy) ``` @@ -115,51 +54,37 @@ Script Content .SYNOPSIS Writes animated text .DESCRIPTION - This PowerShell script writes animated text to the console. + This PowerShell script writes text centered and animated to the console. +.PARAMETER text + Specifies the text line to write ("Welcome to PowerShell" by default) +.PARAMETER speed + Specifies the animation speed per character (10ms by default) .EXAMPLE - PS> ./write-animated "Hello World" + PS> ./write-animated.ps1 + (watch and enjoy) .LINK https://github.com/fleschutz/PowerShell .NOTES Author: Markus Fleschutz | License: CC0 #> -param($Line1 = "", $Line2 = "", $Line3 = "", $Line4 = "", $Line5 = "", $Line6 = "", $Line7 = "", $Line8 = "", $Line9 = "", [int]$Speed = 30) # 30 ms pause - -$TerminalWidth = 120 # characters - -function WriteLine { param([string]$Line) - if ($Line -eq "") { return } - [int]$End = $Line.Length - $StartPosition = $HOST.UI.RawUI.CursorPosition - $Spaces = " " - foreach($Pos in 1 .. $End) { - $TextToDisplay = $Spaces.Substring(0, $TerminalWidth / 2 - $pos / 2) + $Line.Substring(0, $Pos) - Write-Host $TextToDisplay -noNewline - Start-Sleep -milliseconds $Speed - $HOST.UI.RawUI.CursorPosition = $StartPosition +param([string]$text = "Welcome to PowerShell", [int]$speed = 10) # 10ms + +function WriteLine([string]$line) { + [int]$end = $line.Length + $startPos = $HOST.UI.RawUI.CursorPosition + $spaces = " " + [int]$termHalfWidth = 120 / 2 + foreach($pos in 1 .. $end) { + $HOST.UI.RawUI.CursorPosition = $startPos + Write-Host "$($spaces.Substring(0, $termHalfWidth - $pos / 2) + $line.Substring(0, $pos))" -noNewline + Start-Sleep -milliseconds $speed } Write-Host "" } try { - if ($Line1 -eq "") { - $Line1 = "Welcome to PowerShell Scripts" - $Line2 = " " - $Line3 = "This repository contains useful and cross-platform PowerShell scripts." - $Line4 = " " - $Line5 = "Best regards," - $Line6 = "Markus" - } - WriteLine $Line1 - WriteLine $Line2 - WriteLine $Line3 - WriteLine $Line4 - WriteLine $Line5 - WriteLine $Line6 - WriteLine $Line7 - WriteLine $Line8 - WriteLine $Line9 + WriteLine $text exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -167,4 +92,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-animated.ps1 as of 03/27/2024 17:36:32)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-animated.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-ascii-image.md b/docs/write-ascii-image.md index 62701e19d..1d8760f13 100644 --- a/docs/write-ascii-image.md +++ b/docs/write-ascii-image.md @@ -61,4 +61,4 @@ WriteLine " '`--._,dd###pp='''" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-ascii-image.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-ascii-image.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-big.md b/docs/write-big.md index 5af41e828..4a4cb3f2d 100644 --- a/docs/write-big.md +++ b/docs/write-big.md @@ -471,4 +471,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-big.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-big.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-blue.md b/docs/write-blue.md index b5dcf5e92..3da9081e7 100644 --- a/docs/write-blue.md +++ b/docs/write-blue.md @@ -64,4 +64,4 @@ write-host -foregroundColor blue "$text" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-blue.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-blue.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-braille.md b/docs/write-braille.md index 1d51efba1..550b310d3 100644 --- a/docs/write-braille.md +++ b/docs/write-braille.md @@ -408,4 +408,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-braille.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-braille.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-centered.md b/docs/write-centered.md new file mode 100644 index 000000000..ddb2b4002 --- /dev/null +++ b/docs/write-centered.md @@ -0,0 +1,79 @@ +Script: *write-centered.ps1* +======================== + +This PowerShell script writes the given text centered to the console. + +Parameters +---------- +```powershell +PS> ./write-centered.ps1 [[-text] ] [] + +-text + Specifies the text to write + + Required? false + Position? 1 + Default value + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./write-headline.ps1 "Hello World" + Hello World + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Writes text centered +.DESCRIPTION + This PowerShell script writes the given text centered to the console. +.PARAMETER text + Specifies the text to write +.EXAMPLE + PS> ./write-headline.ps1 "Hello World" + Hello World +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([string]$text = "") + +try { + if ($text -eq "") { $text = Read-Host "Enter the text to write" } + + $ui = (Get-Host).ui + $rui = $ui.rawui + [int]$numSpaces = ($rui.MaxWindowSize.Width - $text.Length) / 2 + + [string]$spaces = "" + for ([int]$i = 0; $i -lt $numSpaces; $i++) { $spaces += " " } + Write-Host "$spaces$text" + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of write-centered.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-changelog.md b/docs/write-changelog.md index 1ecbb2cc8..daea66b62 100644 --- a/docs/write-changelog.md +++ b/docs/write-changelog.md @@ -155,4 +155,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-changelog.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-changelog.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-chart.md b/docs/write-chart.md index 6f8dd1390..903090617 100644 --- a/docs/write-chart.md +++ b/docs/write-chart.md @@ -68,4 +68,4 @@ WriteChartLine "Tom" 30.9 100.0 exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-chart.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-chart.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-clock.md b/docs/write-clock.md index 2592f9e0f..94d5bc3ca 100644 --- a/docs/write-clock.md +++ b/docs/write-clock.md @@ -73,4 +73,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-clock.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-clock.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-code.md b/docs/write-code.md index 691cd4dab..9308cc460 100644 --- a/docs/write-code.md +++ b/docs/write-code.md @@ -118,4 +118,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-code.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-code.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-date.md b/docs/write-date.md index 4d39d5d43..d5b78c73f 100644 --- a/docs/write-date.md +++ b/docs/write-date.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-date.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-date.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-fractal.md b/docs/write-fractal.md index 0b670de11..2c0eda6a9 100644 --- a/docs/write-fractal.md +++ b/docs/write-fractal.md @@ -79,4 +79,4 @@ while ($true) { exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-fractal.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-fractal.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-green.md b/docs/write-green.md index 5f5dff933..be01b1d39 100644 --- a/docs/write-green.md +++ b/docs/write-green.md @@ -63,4 +63,4 @@ write-host -foregroundColor green "$text" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-green.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-green.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-headline.md b/docs/write-headline.md new file mode 100644 index 000000000..117f9f90d --- /dev/null +++ b/docs/write-headline.md @@ -0,0 +1,83 @@ +Script: *write-headline.ps1* +======================== + +This PowerShell script writes the given text as a headline. + +Parameters +---------- +```powershell +PS> ./write-headline.ps1 [[-text] ] [] + +-text + Specifies the text to write + + Required? false + Position? 1 + Default value + Accept pipeline input? false + Accept wildcard characters? false + +[] + This script supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, + WarningVariable, OutBuffer, PipelineVariable, and OutVariable. +``` + +Example +------- +```powershell +PS> ./write-headline.ps1 "Hello World" + + + +* Hello World * +--------------- + +``` + +Notes +----- +Author: Markus Fleschutz | License: CC0 + +Related Links +------------- +https://github.com/fleschutz/PowerShell + +Script Content +-------------- +```powershell +<# +.SYNOPSIS + Writes a headline +.DESCRIPTION + This PowerShell script writes the given text as a headline. +.PARAMETER text + Specifies the text to write +.EXAMPLE + PS> ./write-headline.ps1 "Hello World" + + * Hello World * + --------------- +.LINK + https://github.com/fleschutz/PowerShell +.NOTES + Author: Markus Fleschutz | License: CC0 +#> + +param([string]$text = "") + +try { + if ($text -eq "") { $text = Read-Host "Enter the text to write" } + + Write-Host "`n* $text *" -foregroundColor green + [int]$len = $text.Length + [string]$line = "----" + for ([int]$i = 0; $i -lt $len; $i++) { $line += "-" } + Write-Host "$line" -foregroundColor green + exit 0 # success +} catch { + "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +} +``` + +*(generated by convert-ps2md.ps1 using the comment-based help of write-headline.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-in-emojis.md b/docs/write-in-emojis.md index cd6082d03..b6e616172 100644 --- a/docs/write-in-emojis.md +++ b/docs/write-in-emojis.md @@ -74,4 +74,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-in-emojis.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-in-emojis.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-joke.md b/docs/write-joke.md index 64bf8fd18..6c4a347e2 100644 --- a/docs/write-joke.md +++ b/docs/write-joke.md @@ -61,4 +61,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-joke.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-joke.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-lowercase.md b/docs/write-lowercase.md index af775f267..0fdaf014e 100644 --- a/docs/write-lowercase.md +++ b/docs/write-lowercase.md @@ -65,4 +65,4 @@ Write-Output $text.ToLower() exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-lowercase.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-lowercase.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-marquee.md b/docs/write-marquee.md index 67b70b266..f56c43ed5 100644 --- a/docs/write-marquee.md +++ b/docs/write-marquee.md @@ -89,4 +89,4 @@ StartMarquee " exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-marquee.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-marquee.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-matrix.md b/docs/write-matrix.md index b17063195..8f39679de 100644 --- a/docs/write-matrix.md +++ b/docs/write-matrix.md @@ -81,4 +81,4 @@ exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-matrix.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-matrix.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-moon.md b/docs/write-moon.md index a9403a5da..3602c838e 100644 --- a/docs/write-moon.md +++ b/docs/write-moon.md @@ -53,4 +53,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-moon.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-moon.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-morse-code.md b/docs/write-morse-code.md index 2cf424257..0f3aad4d3 100644 --- a/docs/write-morse-code.md +++ b/docs/write-morse-code.md @@ -153,4 +153,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-morse-code.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-morse-code.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-motd.md b/docs/write-motd.md index 03c0267ab..1a451f805 100644 --- a/docs/write-motd.md +++ b/docs/write-motd.md @@ -140,4 +140,4 @@ Write-Host " 'VEzjt:;;z>*`` " -ForegroundColor Yellow exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-motd.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-motd.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-qr-code.md b/docs/write-qr-code.md index 61d25e749..2f2e25833 100644 --- a/docs/write-qr-code.md +++ b/docs/write-qr-code.md @@ -61,4 +61,4 @@ Write-Host " " -foregroundColor black -backgroundColor w exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-qr-code.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-qr-code.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-quote.md b/docs/write-quote.md index 318be3627..5501c4816 100644 --- a/docs/write-quote.md +++ b/docs/write-quote.md @@ -1,7 +1,7 @@ Script: *write-quote.ps1* ======================== -This PowerShell script selects a random quote from Data/quotes.csv and writes it to the console. +This PowerShell script selects a random quote from .../data/quotes.csv and writes it to the console. Parameters ---------- @@ -18,7 +18,7 @@ Example ```powershell PS> ./write-quote.ps1 β€œ We must become the change we want to see. β€ž - - MAHATMA GANDHI + - Mahatma Gandhi ``` @@ -37,11 +37,11 @@ Script Content .SYNOPSIS Writes a random quote .DESCRIPTION - This PowerShell script selects a random quote from Data/quotes.csv and writes it to the console. + This PowerShell script selects a random quote from .../data/quotes.csv and writes it to the console. .EXAMPLE PS> ./write-quote.ps1 β€œ We must become the change we want to see. β€ž - - MAHATMA GANDHI + - Mahatma Gandhi .LINK https://github.com/fleschutz/PowerShell .NOTES @@ -54,11 +54,12 @@ try { $randomNumberGenerator = New-Object System.Random $row = [int]$randomNumberGenerator.next(0, $table.Count - 1) $quote = $table[$row].QUOTE - $author = $table[$row].AUTHOR.toUpper() + $author = $table[$row].AUTHOR $spaces = " " $spaces = $spaces.Substring(0, $quote.Length - $author.Length) - Write-Host "`n"'β€œ'"$quote"'β€ž'"`n$spaces- $author" -foregroundColor Magenta + Write-Host "`n"'β€œ'"$quote"'β€ž'"" -foregroundColor Green + Write-Host "$spaces- $author" -foregroundColor Blue exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" @@ -66,4 +67,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-quote.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-quote.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-red.md b/docs/write-red.md index 2ce46c51e..a0c709e37 100644 --- a/docs/write-red.md +++ b/docs/write-red.md @@ -63,4 +63,4 @@ write-host -foregroundcolor red "$text" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-red.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-red.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-rot13.md b/docs/write-rot13.md index 610bd782c..9cc8da2b6 100644 --- a/docs/write-rot13.md +++ b/docs/write-rot13.md @@ -82,4 +82,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-rot13.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-rot13.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-shit.md b/docs/write-shit.md index a5fe8d031..d5918fd08 100644 --- a/docs/write-shit.md +++ b/docs/write-shit.md @@ -50,4 +50,4 @@ Write-Output "πŸ’©" exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-shit.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-shit.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-sine-curves.md b/docs/write-sine-curves.md index 33830d9c7..5494338c0 100644 --- a/docs/write-sine-curves.md +++ b/docs/write-sine-curves.md @@ -56,4 +56,4 @@ Script Content } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-sine-curves.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-sine-curves.ps1 as of 05/19/2024 10:25:27)* diff --git a/docs/write-time.md b/docs/write-time.md index 338edd77e..83ced064a 100644 --- a/docs/write-time.md +++ b/docs/write-time.md @@ -57,4 +57,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-time.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-time.ps1 as of 05/19/2024 10:25:28)* diff --git a/docs/write-typewriter.md b/docs/write-typewriter.md index 83f9cb015..1a300d57b 100644 --- a/docs/write-typewriter.md +++ b/docs/write-typewriter.md @@ -91,4 +91,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-typewriter.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-typewriter.ps1 as of 05/19/2024 10:25:28)* diff --git a/docs/write-uppercase.md b/docs/write-uppercase.md index 2604d3134..dad26393b 100644 --- a/docs/write-uppercase.md +++ b/docs/write-uppercase.md @@ -65,4 +65,4 @@ Write-Output $text.ToUpper() exit 0 # success ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-uppercase.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-uppercase.ps1 as of 05/19/2024 10:25:28)* diff --git a/docs/write-vertical.md b/docs/write-vertical.md index 49f336e12..aa0c169e7 100644 --- a/docs/write-vertical.md +++ b/docs/write-vertical.md @@ -71,4 +71,4 @@ try { } ``` -*(generated by convert-ps2md.ps1 using the comment-based help of write-vertical.ps1 as of 03/27/2024 17:36:33)* +*(generated by convert-ps2md.ps1 using the comment-based help of write-vertical.ps1 as of 05/19/2024 10:25:28)*