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
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 removes all empty subfolders within a directory tree.
DirTree Specifies the path to the directory tree
PS> ./remove-empty-dirs C:\TempAuthor: Markus Fleschutz | License: CC0