scripts
Scripts from the
Scripts
repo.
Command
π
Hide-Command.ps1
: Make a command unavailable.
π
Invoke-CommandWithParams.ps1
: Execute a command by using matching dictionary entries as parameters.
π
Use-Command.ps1
: Checks for the existence of the given command, and adds if missing and a source is defined.
Configuration
π
Use-NetMailConfig.ps1
: Use .NET configuration to set defaults for Send-MailMessage.
Console
Set-ConsoleColorTheme.ps1
: Overrides ConsoleClass window color palette entries with a preset color theme.
Credential
π
Get-CachedCredential.ps1
: Return a credential from secure storage, or prompt the user for it if not found.
π
Remove-CachedCredential.ps1
: Removes a credential from secure storage.
Save-Secret.ps1
: Sets a secret in a secret vault with metadata.
Data formats
Test-Windows1252.ps1
: Determines whether a file contains Windows-1252 bytes that are invalid UTF-8 bytes.
Database
π
ConvertFrom-DataRow.ps1
: Converts a DataRow object to a PSObject, Hashtable, or single value.
π
Use-SqlcmdParams.ps1
: Use the calling script parameters to set Invoke-Sqlcmd defaults.
Date and time
ConvertTo-LogParserTimestamp.ps1
: Formats a datetime as a LogParser literal.
DotNet
Get-DotNetFrameworkVersions.ps1
: Determine which .NET Frameworks are installed on the requested system.
Get-DotNetGlobalTools.ps1
: Returns a list of global dotnet tools.
Get-DotNetVersions.ps1
: Determine which .NET Core & Framework versions are installed.
π
Update-DotNetPackages.ps1
: Updates NuGet packages for a .NET solution or project.
EnvironmentVariables
Compress-EnvironmentVariables.ps1
: Replaces each of the longest matching parts of a string with an embedded environment variable with that value.
Files
Join-FileName.ps1
: Combines a filename with a string.
π
Measure-Caches.ps1
: Returns a list of matching cache directories, and their sizes, sorted.
New-Shortcut.ps1
: Create a Windows shortcut.
Remove-LockyFile.ps1
: Removes a file that may be prone to locking.
Test-LockedFile.ps1
: Returns true if the specified file is locked.
Packages and libraries
Find-ProjectPackages.ps1
: Find modules used in projects.
PowerShell
π
Add-ScopeLevel.ps1
: Convert a scope level to account for another call stack level.
π
Convert-ExternalScriptToModule.ps1
: Convert a script from external script usage to module cmdlet usage.
Scheduled Tasks
Backup-SchTasks.ps1
: Exports the local list of Scheduled Tasks into a single XML file.
π
ConvertFrom-CimInstance.ps1
: Convert a CimInstance object to a PSObject.
Copy-SchTasks.ps1
: Copy scheduled jobs from another computer to this one, using a GUI list to choose jobs.
Get-SimpleSchTasks.ps1
: Returns simple scheduled task info.
Restore-SchTasks.ps1
: Imports from a single XML file into the local Scheduled Tasks.
Set-SchTaskMsa.ps1
: Sets a Scheduled Taskβs runtime user as the given gMSA/MSA.
Scripts
π
New-PesterTests.ps1
: Creates a new Pester testing script from a scriptβs examples and parameter sets.
π
New-Script.ps1
: Creates a simple boilerplate script.
Optimize-Help.ps1
: Cleans up comment-based help blocks by fully unindenting and capitalizing dot keywords.
π
Rename-Script.ps1
: Renames all instances of a script, and updates any usage of it.
Search and replace
Find-Lines.ps1
: Searches a specific subset of files for lines matching a pattern.
System and updates
Convert-ChocolateyToWinget.ps1
: Change from managing various packages with Chocolatey to WinGet.
Export-EdgeKeywords.ps1
: Returns the configured search keywords from an Edge SQLite file.
Export-InstalledPackages.ps1
: Exports the list of packages installed by various tools.
Find-InstalledPrograms.ps1
: Searches installed programs.
Get-SystemDetails.ps1
: Collects some useful system hardware and operating system details via CIM.
Import-EdgeKeywords.ps1
: Adds search keywords to an Edge SQLite profile configuration.
π
Read-ChocolateySummary.ps1
: Retrieves the a summary from the Chocolatey log.
π
Update-Everything.ps1
: Updates everything it can on the system.
Use-Java.ps1
: Switch the Java version for the current process by modifying environment variables.
Unicode
Get-UnicodeData.ps1
: Returns the current (cached) Unicode character data.
Windows Terminal
π
Set-TerminalProfile.ps1
: Adds or updates a Windows Terminal command profile.
Test-WindowsTerminal.ps1
: Returns true if PowerShell is running within Windows Terminal.
Other
π
Backup-Workstation.ps1
: Adds various configuration files and exported settings to a ZIP file.
π
Export-Readme.ps1
: Generate README.md file for the scripts repo.
Get-ADServiceAccountInfo.ps1
: Lists the Global Managed Service Accounts for the domain, including the computers they are bound to.
Get-AspNetEvents.ps1
: Parses ASP.NET errors from the event log on the given server.
Get-IisLog.ps1
: Easily query IIS logs.
Get-PathUsage.ps1
: Returns the list of directories in the path, and the commands found in each.
Measure-Indents.ps1
: Measures the indentation characters used in a text file.
Measure-StandardDeviation.ps1
: Calculate the standard deviation of numeric values.
Measure-TextFile.ps1
: Counts each type of indent and line ending.
π
New-RandomVehicle.ps1
: Generates random vehicle details with a valid VIN.
π
Optimize-Path.ps1
: Sorts, prunes, and normalizes both user and system Path entries.
Repair-AppxPackages.ps1
: Re-registers all installed Appx packages.
π
Restore-Workstation.ps1
: Restores various configuration files and exported settings from a ZIP file.
Send-MailMessageFile.ps1
: Sends emails from a drop folder using .NET config defaults.