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 scans a folder for malware (including subfolders). Requires ESET Endpoint Security or Windows Defender.
path Specifies the file path to the folder (default is working directory).
PS> ./scan-folder.ps1 C:\Windows⏳ Scanning C:\Windows with ESET Endpoint Security......Author: Markus Fleschutz | License: CC0
This PowerShell script takes a single screenshot and saves it into a target folder (default is the user's screenshots folder).
TargetFolder Specifies the target folder (the user's screenshots folder by default)
PS> ./save-screenshot✅ screenshot saved to C:\Users\Markus\Pictures\Screenshots\2021-10-10T14-33-22.pngAuthor: Markus Fleschutz | License: CC0
This PowerShell script asks for credentials and saves them encrypted into a target file.
targetFile Specifies the target file ("~\my.credentials" by default)
PS> ./save-credentials.ps1Enter username and password, please.✅ Your credentials have been saved to C:\Users\Markus\my.credentials (encrypted).Author: Markus Fleschutz | License: CC0
This PowerShell script restarts all local network adapters (needs admin rights).
PS> ./restart-network-adaptersAuthor: 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 a Git tag, either locally, remote, or both.
TagName Specifies the Git tag name
Mode Specifies either locally, remote, or both
RepoDir Specifies the path to the Git repository
PS> ./remove-tag v1.7 locallyAuthor: Markus Fleschutz | License: CC0
This PowerShell script removes all print jobs from all printer devices.
PS> ./remove-print-jobsAuthor: Markus Fleschutz | License: CC0