This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function New-ShortenedUri { | |
<# | |
.SYNOPSIS | |
Genereates a shortened Uri. | |
.DESCRIPTION | |
Genereates a shorted Uri based on the provided Uri using the TinyUrl service. | |
.PARAMETER Uri | |
A mandatory Uri to be shortened. | |
.PARAMETER CopyToClipboard | |
An optional switch that copies the shortened Uri to the clipboard if specified. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ConvertFrom-UnixTimestamp { | |
<# | |
.SYNOPSIS | |
Converts a Unix timestamp to a DateTime object. | |
.DESCRIPTION | |
Converts a Unix timestamp to a DateTime object. | |
.PARAMETER Milliseconds | |
The Unix timestamp to convert. | |
.INPUTS | |
String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function New-RandomMACAddress { | |
<# | |
.SYNOPSIS | |
Generates a MAC address. | |
.DESCRIPTION | |
This function generates a random MAC address. If specified, the MAC address will be generated using the vendor prefix (OUI) for | |
the partial name of the vendor provided, if found in the IEEE OUI listing. See https://standards-oui.ieee.org/cid/cid.csv for the | |
full OUI listing. | |
The OUI listing is downloaded to the system's temp directory from the internet. If the OUI listing already exists, it will not be |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Export-DistributionGroupInfo { | |
<# | |
.SYNOPSIS | |
This function exports the information for an Exchange Online distribution group. | |
.DESCRIPTION | |
This function takes in an array of distribution group PrimarySmtpAddresses. Each group is looked up and their information | |
is condensed to a single .csv file which is exported to your Downloads directory. | |
.PARAMETER Groups |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Import-ModuleFromGitx { | |
<# | |
.SYNOPSIS | |
Imports a PowerShell module from a GitHub repository. | |
.DESCRIPTION | |
This function lets you import a PowerShell module directly from a GitHub repository without needing to install the module. | |
The module is downloaded from the specified GitHub repository URI, extracted, and imported into your current PowerShell session. | |
.PARAMETER Uri |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
A colorful PowerShell prompt. | |
.DESCRIPTION | |
This function replaces your default PowerShell prompt with a colorful one. | |
The format of the prompt looks like this: `username@hostname:[C:\Users\griff.systems\Documents]>` | |
Each new command line gets a random console color from the available default console colors. | |
You can add this to your `$profile` to use the custom prompt. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Uninstall-WindowsCopilot { | |
<# | |
.SYNOPSIS | |
Uninstalls Windows Copilot. | |
.DESCRIPTION | |
This function uninstalls the new Windows Copilot package. | |
.PARAMETER Scope |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Update-GitRepositories { | |
<# | |
.SYNOPSIS | |
Pulls updates for Git repositories. | |
.DESCRIPTION | |
This function invokes `git pull --rebase` on all Git repositories found in the specified base directory. | |
.PARAMETER BaseDirectory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-DiceRoll { | |
<# | |
.SYNOPSIS | |
Rolls one or more dice of standard types (d4, d6, d8, d10, d12, d20) and returns the results. | |
.DESCRIPTION | |
The Invoke-DiceRoll function simulates rolling dice commonly used in tabletop games. | |
You can specify the number of each die type to roll (d4, d6, d8, d10, d12, d20). | |
.PARAMETER D4 | |
The number of 4-sided dice (d4) to roll. |