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 logs off the current Windows user.
PS> ./log-off.ps1Author: Markus Fleschutz | License: CC0
This PowerShell script locks the local computer desktop immediately.
PS> ./lock-desktop.ps1Author: 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 installed/available Linux distributions for Windows Subsystem for Linux (WSL).
PS> ./list-wsl-distros.ps1NAME STATE VERSION* Ubuntu-24.04 Stopped 2...Author: 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 queries all main window titles and lists them as a table.
PS> ./list-window-titles.ps1Id ProcessName MainWindowTitle-- ----------- ---------------11556 Spotify Spotify Free...Author: Markus Fleschutz | License: CC0
This PowerShell script lists the WIFI networks.
PS> ./list-wifi.ps1Author: Markus Fleschutz | License: CC0