This PowerShell script measures the speed of the CountingSort algorithm. CountingSort is an algorithm for sorting a collection of objects according to keys that are small positive integers; that is, it is an integer sorting algorithm. It operates by counting the number of objects that possess distinct key values, and applying prefix sum on those counts to determine the positions of each key value in the output sequence. Its running time is linear in the number of items and the difference between the maximum key value and the minimum key value, so it is only suitable for direct use in situations where the variation in keys is not significantly greater than the number of items. It is often used as a subroutine in radix sort, another sorting algorithm, which can handle larger keys more efficiently.
numIntegers Specifies the number of integers to sort
PS> ./measure-CountingSort.ps1🧭 0.045 sec to sort 1000 integers by CountingSortAuthor: Markus Fleschutz | License: CC0
This PowerShell script measures the speed of the BucketSort algorithm. BucketSort is a sorting algorithm that works by distributing the elements of an array into a number of buckets. Each bucket is then sorted individually, either using a different sorting algorithm, or by recursively applying the bucket sorting algorithm. It is a distribution sort, a generalization of pigeonhole sort that allows multiple keys per bucket, and is a cousin of radix sort in the most-to-least significant digit flavor. Bucket sort can be implemented with comparisons and therefore can also be considered a comparison sort algorithm. The computational complexity depends on the algorithm used to sort each bucket, the number of buckets to use, and whether the input is uniformly distributed.
numIntegers Specifies the number of integers to sort
PS> ./measure-BucketSort.ps1🧭 0.065 sec to sort 1000 integers by BucketSortAuthor: Markus Fleschutz | License: CC0
This PowerShell script measures the speed of the BubbleSort algorithm. BubbleSort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted. The algorithm, which is a comparison sort, is named for the way smaller or larger elements "bubble" to the top of the list.
numIntegers Specifies the number of integers to sort
PS> ./measure-BubbleSort.ps1🧭 0.729 sec to sort 1000 integers by BubbleSortAuthor: Markus Fleschutz | License: CC0
This PowerShell script prints the geographic location of the given IP address. .PARAMTER IPaddress Specifies the IP address
PS> ./locate-ipaddress.ps1 177.144.67.98Author: Markus Fleschutz | License: CC0
This PowerShell script lists the path to current working directory (but not the content itself).
PS> ./list-workdir.ps1📂C:\Users\MarkusAuthor: Markus Fleschutz | License: CC0
This PowerShell script lists the user accounts on the local computer.
PS> ./list-user-accounts.ps1Author: Markus Fleschutz | License: CC0
This PowerShell script scans a directory tree and lists unused files (no read/write access since a number of days).
path Specifies the path to the directory tree (current working dir by default)
days Specifies the number of days (100 by default)
PS> ./list-unused-files.ps1 C:\Windows...✅ Found 43729 unused files (no access for 100 days) within 📂C:\Windows in 113 secAuthor: Markus Fleschutz | License: CC0
This PowerShell script fetches all tags in a local Git repository and lists it (oldest tag first).
repoDir Specifies the path to the Git repository (current working directory by default)
searchPattern Specifies the search pattern (anything by default)
PS> ./list-tags.ps1 C:\MyRepoTag Commit Message--- --------------v0.1 Update README.md...Author: Markus Fleschutz | License: CC0
This PowerShell script lists "Did you mean?" suggestions from Google.
text Specifies the word or sentence to get suggestions for.
PS> ./list-suggestions.ps1 Joejoe bidenjoe cocker...Author: Markus Fleschutz | License: CC0
This PowerShell script lists the submodules in the given Git repository.
RepoDir Specifies the path to the repository (current working directory by default)
PS> ./list-submodules.ps1 C:\MyRepoAuthor: Markus Fleschutz | License: CC0