I have these in my $PROFILE, they make day-to-day pfaffing around in the console more productive:

function New-UniquenessToken {
    $UnambiguousLettersInAscii = (97..102) + (104) + (107..107) + (112) + (114..117) + (120..122)
    -join ($UnambiguousLettersInAscii | Get-Random -Count 5 | ForEach-Object { [char]$_ })
}
New-Alias -Name nut -Force -Value New-UniquenessToken

There can be times - especially when creating Azure resources in a global namespace - where you need a suffix that guarantees uniqueness, and you don’t have the space for a full GUID. This function returns a five character string of letters that has none of the ones that can easily confused with each other or numbers (g, q, l, o, etc.)

function New-FeatureBranch {
    [CmdletBinding()]
    param (
        [Parameter(
            Mandatory = $true,
            Position = 0
        )]
        [string]
        $IssueNumber
    )
    $featureBranchPrefix = 'users/cdoherty'
    $branchName = "$featureBranchPrefix/$IssueNumber"
    git checkout -b $branchName
}
New-Alias -Name nfb -Force -Value New-FeatureBranch

Creates a new feature branch when passed a work item id, Jira issue code, or other token tying the feature branch to an issue in your work tracking system.

function New-PullRequest {
    $gitRemoteUrl = $(git remote get-url --push origin)
    $AzureDevOpsUrl = $gitRemoteUrl.Replace('##YOUR_ORGANIZATION_NAME##@', '') + "/pullrequests?_a=mine"
    Start-Process $AzureDevOpsUrl
}
New-Alias -Name npr -Force -Value New-PullRequest

They retired the Azure DevOps extension in Visual Studio Code and replaced it with – nothing. This function opens the Pull Request page in Azure DevOps, and if you’ve just pushed a branch there will be a handy button to create a PR for you.

function Set-MySubscription {
    [CmdletBinding()]
    param (
        [Parameter(
            Mandatory = $true,
            Position = 0
        )]
        [ValidateSet("Dev", "IntegrationTesting", "UserAcceptanceTesting", "Production", "MyPersonalSubscription")]
        [string]
        $SubscriptionName
    )
    $Subscriptions = @{
        Dev                    = "##SUBSCRIPTION_ID##"
        IntegrationTesting     = "##SUBSCRIPTION_ID##"
        UserAcceptanceTesting  = "##SUBSCRIPTION_ID##"
        Production             = "##SUBSCRIPTION_ID##"
        MyPersonalSubscription = "##SUBSCRIPTION_ID##"
    }
    Set-AzContext -Subscription $Subscriptions[$SubscriptionName]
}
New-Alias -Name sms -Force -Value Set-MySubscription

Do a lot of Azure work from PowerShell and flipping back and forth between subscriptions becomes a pain. This function is really a trivial wrapper around Set-AzContext, but allows you to give short tabbable aliases to the subscriptions you work with most frequently.

function Invoke-FileDownload {
    [CmdletBinding()]
    param (
        # URI to a file to download
        [Parameter(Mandatory = $true)]
        [string]
        $Uri
    )
    
    $fileName = ([uri]$Uri).Segments[-1]
    $webRequestOptions = @{
        Uri     = $Uri
        OutFile = $fileName
    }
    Invoke-WebRequest @webRequestOptions
}

Yes, there’s Invoke-WebRequest, but if you don’t specify -OutFile you get a bytestream, which isn’t helpful if you’re downloading an installer. This function figures out the name of the file you’re trying to download and directs the bytestream to that name in the current directory.