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
This PowerShell script silently removes a directory tree recursively. Use it with care!
pathToDirTree Specifies the file path to the directory tree
PS> ./remove-dir-tree.ps1 C:\TempAuthor: Markus Fleschutz | License: CC0
This PowerShell script reboots the local computer immediately (needs admin rights).
PS> ./rebootAuthor: Markus Fleschutz | License: CC0
This PowerShell script pulls remote updates into a local Git repository (including submodules).
pathToRepo Specifies the file path to the local Git repository (default is working directory)
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...✅ Updates pulled into 📂rust repo in 14s.Author: Markus Fleschutz | License: CC0
This script halts the local computer immediately (needs admin rights).
PS> ./poweroffAuthor: Markus Fleschutz | License: CC0
This PowerShell script measures the ping roundtrip times from the local computer to remote ones (10 Internet servers by default).
hosts Specifies the hosts to ping, seperated by commata (10 Internet servers by default)
PS> ./ping-internet.ps1✅ Internet ping: 12ms (9...18ms range)Author: Markus Fleschutz | License: CC0
This PowerShell script pings the given host.
hostname Specifies the hostname or IP address to ping (x.com by default)
PS> ./ping-host.ps1 x.com✅ 'x.com' is online (20ms to IP 104.244.42.1)Author: Markus Fleschutz | License: CC0