This PowerShell script continuously lists the latest headlines by using a RSS (Really Simple Syndication) feed.
URL Specifies the URL to the RSS feed (Yahoo World News by default)
lines Specifies the initial number of headlines
timeInterval Specifies the time interval in seconds between two Web requests (60 seconds by default)
PS> ./watch-news.ps1UTC HEADLINES (source: https://www.yahoo.com/news/world)--- ---------14:29 Niger coup: Ecowas deadline sparks anxiety in northern Nigeria...Author: Markus Fleschutz | License: CC0
This PowerShell script continuously lists the latest commits in a Git repository in real-time.
pathToRepo Specifies the file path to the local Git repository.
PS> ./watch-commits.ps1TIME COMMIT---- ------11:25 Updated general.csv by Markus Fleschutz (HEAD -> main, origin/main, origin/HEAD)...Author: Markus Fleschutz | License: CC0
This PowerShell script synchronizes a local Git repository by pull and push (including submodules).
path Specifies the path to the Git repository (current working directory by default)
PS> ./sync-repo.ps1 C:\Repos\curl⏳ (1/4) Searching for Git executable... git version 2.42.0.windows.1⏳ (2/4) Checking local repository... C:\Repos\curl⏳ (3/4) Pulling remote updates... Already up to date.⏳ (4/4) Pushing local updates... Everything up-to-date✅ Synced the 📂curl repo in 5s.Author: Markus Fleschutz | License: CC0
This PowerShell script switches to the given branch in a Git repository and also updates the submodules.
branchName Specifies the Git branch name to switch to
pathToRepo Specifies the file path to the local Git repository
PS> ./switch-branch main⏳ (1/6) Searching for Git executable... git version 2.43.0.windows.1⏳ (2/6) Checking local repository... C:\Repos\rust⏳ (3/6) Fetching remote updates...⏳ (4/6) Switching to 'main' branch...⏳ (5/6) Pulling remote updates...⏳ (6/6) Updating submodules...✅ Switched repo 📂rust to 'main' branch in 22s.Author: Markus Fleschutz | License: CC0
This PowerShell script searches for the given text pattern in a Git repository.
textPattern Specifies the text pattern to search for
path Specifies the file path to the local Git repository
PS> ./search-repo.ps1 UFOlist-calendar.ps1: Write-Host (" " * 4 * [int](Get-Date $day -uformat %u)) -NoNewLinelist-calendar.ps1: $dayOffset = [int](Get-Date -day 1 -month ($month + $i) -year $year -uformat %u)Author: Markus Fleschutz | License: CC0
This PowerShell script searches for the given text pattern in the given files.
textPattern Specifies the text pattern to search for
filePattern Specifies the files to search
PS> ./search-files.ps1 UFO *.ps1FILE LINE---- ----/home/Markus/PowerShell/scripts/check-month.ps1 17: $MonthName = (Get-Date -UFormat %B)...Author: Markus Fleschutz | License: CC0
This PowerShell script serves as a quick Powershell replacement to the search functionality in Windows After you pass in a root folder and a search term, the script will list all files and folders matching that phrase.
path Specifies the path
term Specifies the search term
PS> ./search-filenameAuthor: Markus Fleschutz | License: CC0
This PowerShell script searches and replaces a pattern in the given files by the replacement.
pattern Specifies the text pattern to search for (ask user by default)
replacement Specifies the text replacement (ask user by default)
filePattern Specifies the file search pattern (ask user by default)
PS> ./replace-in-files NSA "No Such Agency" C:\Temp\*.txtAuthor: Markus Fleschutz | License: CC0
This PowerShell script removes an existing user account including the home directory.
PS> ./remove-user.ps1 Joe✅ Removed user 'Joe' including home directory in 11s.Author: Markus Fleschutz | License: CC0
This PowerShell script removes any subfolder in a parent folder older than (using last write time).
path Specifies the file path to the parent folder
numDays Specifies the number of days (1000 by default)
PS> ./remove-old-dirs.ps1 C:\Temp 365⏳ Scanning C:\Temp for subfolders older than 365 days...⏳ Removing old 'TestFolder'...✅ Removed 1 of 49 subfolders in 1s.Author: Markus Fleschutz | License: CC0