DBremen/PowerShellScripts

Repository files navigation

Some PowerShell scipts that can be hopefully also useful to others. Most of them were written by me, if not I tried to reference the author and or source. Since I collected those scripts over several years, I couldn't always remember though.

FunctionLocationSynopsisRelated Blog PostFull Documentation
Diff-CSVBinary wrapper\Diff-CSV.ps1PowerShell wrapper for diff-table.exe a tool to diff csv filesLink
Diff-ExcelBinary wrapper\Diff-Excel.ps1PowerShell wrapper for ExcelConmpare a tool to diff excel filesLink
Get-ESSearchResultBinary wrapper\Get-ESSearchResult.ps1PowerShell wrapper around Everything search command line (es.exe).LinkLink
SilverSearcherBinary wrapper\SilverSearcher.ps1PowerShell wrapper around silver searcher (ag.exe) Recursively search for PATTERN in PATH. Like grep or ack, but faster.Link
Add-LookupColumnData Wrangling\Add-LookupColumn.ps1Funciton to use Excel's vlookup through PowerShell. Requires Excel to be installed.Link
Convert-CsvToXlsData Wrangling\Convert-CsvToXls.ps1Convert a .csv file to xlsx (despite the name)Link
ConvertFrom-NamedCaptureGroupData Wrangling\ConvertFrom-NamedCaptureGroup.ps1Convert the output of a RegEx named capture group to a PSObjectLink
Get-ChangeLogData Wrangling\Get-ChangeLog.ps1Comparing two objects or .csv files column by column.LinkLink
Get-CSVDelimiterData Wrangling\Get-CSVDelimiter.ps1Autodetects delimiter used in CSV files and number of rowsLink
Get-LineNumberData Wrangling\Get-LineNumber.ps1Retrieve specific Linenumber(s) from afile.Link
Get-TextWithinData Wrangling\Get-TextWithin.ps1Get the text between two surrounding characters (e.g. brackets, quotes, or custom characters)LinkLink
grepData Wrangling\grep.ps1Filter output based on keyword, but still retain PowerShell object format. Hence it can be even used in the middle of a pipeline (see example):Link
Group-ConsecutiveRangesData Wrangling\Group-ConsecutiveRanges.ps1Given an integer array with numbers, return groups of consecutive ranges.Link
Import-ExcelData Wrangling\Import-Excel.ps1Import data from Excel using Excel's COM interface.Link
Join-CSVData Wrangling\Join-CSV.ps1Function to join two .csv files based on a common column. Based on a PowerShellMagazine article from Chrissy LeMaire (see link).Link
Join-LinqData Wrangling\Join-Linq.ps1Performs an inner join of two object arrays based on a common column.Link
Query-CsvData Wrangling\Query-Csv.ps1Function to retrieve data from a .csv file based on sql query. Based on a PowerShellMagazine article from Chrissy LeMaire (see link).Link
Sort-CustomListData Wrangling\Sort-CustomList.ps1Sort data using a custom list in PowerShell.LinkLink
Update-ContentData Wrangling\Update-Content.ps1Insert text on a new line after the line matching the StartPattern or replace text between start- and end Pattern within a fileLink
Compare-FileExtend Builtin\Compare-File.ps1A wrapper and extension for the built-in Compare-Object cmdlet to compare two txt based files and receive a side-by-side comparison (including Line numbes).Link
Compare-ObjectExtend Builtin\Compare-Object.ps1Proxy function for the built-in Compare-Object cmdlet. This version also works with arrays, arrays of PSCustomObjects and custom classes it iterates over nested objects and properties to compare their values and also support compact output. See description and paramenter help for more. Compares two sets of objects.LinkLink
Get-ChoiceExtend Builtin\Get-Choice.ps1An alternative to the built-in PromptForChoice providing a consistent UI across different hosts.LinkLink
Get-HelpExamplesExtend Builtin\Get-HelpExamples.ps1Get examples for a Cmdlet.Link
Get-HelpSyntaxExtend Builtin\Get-HelpSyntax.ps1Get the syntax for a cmdlet pretty printed + explanationLinkLink
Get-RangeExtend Builtin\Get-Range.ps1Function to retrieve a continuous or stepwise Range of integers,decimals,dates,month names, day names or chars. Simulating Haskell`s Range operatorLinkLink
Join-TablesExtend Builtin\Join-Tables.ps1Function to join tables based on one or more common columns with an option to summarize (aggregate) joined columns.Link
Select-ObjectXExtend Builtin\Simplified-Select.ps1Proxy function for Select-Object providing easier syntax for calculated properties.LinkLink
WhereExExtend Builtin\WhereEx.ps1POC for a simplified Where-Object with multiple conditions on the same property for PowerShell.LinkLink
Add-FormatTableViewformat output\Add-FormatTableView.ps1Function to add a Format Table View for a typeLinkLink
Add-PropertySetformat output\Add-PropertySet.ps1Function to create property setsLinkLink
ConvertTo-HtmlConditionalFormatformat output\ConvertTo-HtmlConditionalFormat.ps1Function to convert PowerShell objects into an HTML table with the option to format individual table cells based on property values using CSS selectors.Link
Format-Errorformat output\Format-Error.ps1Format $error[x] output.Link
Format-Patternformat output\Format-Pattern.ps1Highlight a pattern in the output. Cannot be used in the middle of a pipeline. And works only on the commandline.Link
Get-FormatViewformat output\Get-FormatView.ps1Function to get the format views for a particular type.LinkLink
Out-ConditionalColorformat output\Out-ConditionalColor.ps1Filter to conditionally format PowerShell output within the PowerShell console.Link
Out-ConditionalColorPropertiesformat output\Out-ConditionalColorProperties.ps1Filter to conditionally format property values within PowerShell output on the console.Link
Out-Diffformat output\Out-Diff.ps1Generate html diff from git diff output using diff2html.Link
Get-ACEDataACE\ACE.psm1Checkout the whole modules as it exports several more functions. Queries Excel and Access files.Link
Clear-ClipboardClear-Clipboard\Clear-Clipboard.psm1Identify the process that currently blocks the clipboard (Using GetOpenClipboardWindow and GetWindowThreadProcessId API calls) Opens a small GUI offering options to either stop or restart the processLinkLink
Get-LegacyHelpGet-LegacyHelp\Get-LegacyHelp.psm1Display help for windows commandline commandsLinkLink
Start-LoggingLogging\Logging.psm1Module to provide a logging functionality for scripts originally written by Oisin Grehan see link.Link
8Queensprogramming exercises\8 Queens.ps1PowerShell solution for a classical programming exercise.Link
Confirm-Bracketsprogramming exercises\Confirm-Brackets.ps1Function to check and display (through indentation) pairing of braces, brackets, and parentheses '{[()]}Link
GenerateSolveMazeprogramming exercises\GenerateSolveMaze.ps1Function to generate a GUI (Windows forms) to build and solve random mazesLink
Get-CartesianProductprogramming exercises\Get-CartesianProduct.ps1Get the cartesian product for an object that contains array properties. See example.Link
TowerOfHanoiprogramming exercises\TowerOfHanoi.ps1PowerShell solution to the Tower of Hanoi problem (http://en.wikipedia.org/wiki/Tower_of_Hanoi) using recursion.Link
Add-PowerShellContextMenuUtils\Add-PowerShellContextMenu.ps1Function to create context menu entries in order to invoke PowerShellLinkLink
Add-ScriptHelpISEAddOnUtils\Add-ScriptHelpISEAddOn.ps1Function to create an ISE Add-On that will generate comment based help for functions. The functions requires the Show-UI module.LinkLink
ConvertFrom-ExcelClipboardUtils\ConvertFrom-ExcelClipboard.ps1Convert copied range from excel to an array of PSObjectsLinkLink
ConvertFrom-HtmlToTextUtils\ConvertFrom-HtmlToText.ps1Extract the text out of a HTML stringLink
ConvertTo-LocaltimeUtils\ConvertTo-LocalTime.ps1Convert a datetime from a remote timezone to the local time.LinkLink
ConvertTo-PSFunctionUtils\ConvertTo-PSFunction.ps1Function to "convert" legacy command line commands to PowerShell functionsLink
Delete-ComputerRestorePointUtils\Delete-ComputerRestorePoint.ps1Function to Delete Windows System Restore pointsLink
ForeachFor2Utils\ForeachFor2.ps1Function to step through two series of values in two collections and run commands against them.Link
Get-BreaktimerUtils\Get-Breaktimer.ps1Function to display a break timer with a countdown based on absolute or relative times.Link
Get-FieldUtils\Get-Field.ps1Gets the public and private fields of objects.Link
Get-FileAndExtractUtils\Get-FileAndExtract.ps1Function to download and extract files.Link
Get-FileEncodingUtils\Get-FileEncoding.ps1Get the file encoding of a given file.Link
Get-FormatStringsUtils\Get-FormatStrings.ps1Show common format strings for a given input and the respective outputsLinkLink
Get-GoogleSuggestionUtils\Get-GoogleSuggestion.ps1Function to get "Did you mean?" suggestions from Google.Link
Get-MSDNInfoUtils\Get-MSDNInfo.ps1Opens the MSDN web page of an object member: type, method or property.Link
Get-OutlookSentItemsUtils\Get-OutlookSentItems.ps1Get emails in "Sent Items"Link
Get-OutputProducingCommandUtils\Get-OutputProducingCommand.ps1Get the line(s) of code that produce an output from a function or script.Link
Get-ParamInfoUtils\Get-ParamInfo.ps1Retrieve extensive parameter information about a cmdletLink
Get-UninstallerUtils\Get-Uninstaller.ps1Function to get the uninstaller for installed software via registry (PowerShell v4 and <) or Get-Package)LinkLink
Get-WIFIPasswordUtils\Get-WIFIPassword.ps1Get the Wifi password of stored networks using netsh.Link
Invoke-ContextMenuActionUtils\Invoke-ContextMenuAction.ps1List or permforms verb actions on file system objects that show up in the context menu.Link
Invoke-HTMLPesterReportUtils\Invoke-HTMLPesterReport.ps1Generate HTML report for Pester test results using ReportUnit.exeLinkLink
Invoke-LegacyCommandUtils\Invoke-LegacyCommand.ps1Helper to invoke legacy command with switches from PowerShell in a convenient way. Also supports pipeline input to invoke the command with arguments multiple times.Link
Invoke-ParallelUtils\Invoke-Parallel.ps1Execute a scriptblock in parallel using runspaces taking pipeline input.Link
Invoke-ParserUtils\Invoke-Parser.ps1Uses PowerShell's parser and returns the AST, Tokens and ErrorsLink
Migrate-ScheduledTaskUtils\Migrate-ScheduledTask.ps1Script to migrate scheduled tasks from Windows XP/Server 2003 to Windows 7/Server 2008 task schedulerLink
Monitor-FolderUtils\Monitor-Folder.ps1Monitors a folder for changes using non-persistent asynchronous eventsLink
New-PSObjectUtils\New-PSObject.ps1Helper function to create PSCustomObjects based on array of names and array of properties.Link
Open-RegistryUtils\Open-Registry.ps1Open the regedit at the specified path similar to sysinternals regjump.Link
Restart-ProcessUtils\Restart-Process.ps1Function to restart process(es)LinkLink
Set-IPAddressUtils\Set-IPAddress.ps1Set a network interfacres IPv4 address (hard coded 24bit mask) either dynamic or static including DNS settings.Link
Start-ProcessUnelevatedUtils\Start-ProcessUnelevated.ps1Function to start a process unelevated from an elevated command promptLink
Generate-ScriptMarkdownHelpPowerShellScripts\Generate-ScriptMarkdownHelp.ps1The function that generated the Markdown help in this repository. (see Example for usage). Generates markdown help for for each function containing comment based help (Description not empty) within a folder recursively and a summary table for the main README.mdLink
Get-FunctionFromScriptPowerShellScripts\Generate-ScriptMarkdownHelp.ps1Gets the functions and filters declared within a script block or a fileLink

About

Some PowerShell scipts that can be hopefully also useful to others. Most of them were written by me, if not I tried to reference the author and or source. Since I collected those scripts over several years, I couldn't always remember though.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •