Skip to content

Brownserve.PSTools Module

Description

A collection of PowerShell tools used in various projects.

Brownserve.PSTools Cmdlets

Add-BrownserveChangelogEntry

Inserts a new changelog entry into a given changelog file

Add-ChangelogEntry

This cmdlet is deprecated. Please use Add-BrownserveChangelogEntry instead. Inserts a new changelog entry into a given changelog file

Add-GitChanges

This cmdlet is a wrapper for the git command 'git add \<path>'.

Add-GitHubReleaseAsset

Uploads a file to a GitHub release.

Add-ModuleHelp

Creates XML MALM help for a PowerShell module

Add-PullRequestComment

Adds a comment to a given pull request

Assert-Command

Ensures the given command exists and is available to the current PowerShell session

Assert-Directory

Ensures that a directory is valid

Assert-Path

Ensures a given path exists.

Build-ModuleDocumentation

This will build markdown PowerShell module documentation using PlatyPS

ConvertTo-BlockComment

Converts a given text string into a block comment

ConvertTo-HTTPSRepoURL

Converts a git SSH URI into the HTTPS equivalent

ConvertTo-SortedHashtable

Converts a given hashtable to an alphabetically sorted hashtable

Copy-GitRemoteRepository

Clones a given git repository to the local machine

Format-BrownserveContent

Formats a given string to be compatible with the various *-BrownserveContent cmdlets.

Format-Markdown

Formats a markdown file to ensure it follows the markdownlint rules.

Format-NuGetPackageVersion

Formats a version number to ensure compatibility with NuGet and nuget.org

Format-TerraformResourceName

Strips out illegal characters from Terraform resource names

Get-BrownserveContent

Wrapper for Get-Content that returns the content in a format that is easier to work with.

Get-BrownserveRepositoryPaths

Returns a list of all paths that are managed for a given repository.

Get-GitBranches

Gets the current branches for the given repository

Get-GitChanges

Gets the git status for a given repository

Get-GitCurrentBranch

Gets the current branch for a given repository

Get-GitHubIssues

Gets the issues for a given GitHub repository

Get-GitHubPullRequests

Gets pull request information from a given GitHub repository.

Get-GitHubRelease

Gets a list of releases from a given GitHub repo

Get-GitHubTags

Gets a list of tags for a given GitHub repository

Get-GitMerges

Returns a list of merge commits for a given GitHub repository

Get-GitRemoteOriginURL

Gets the remote origin URL for a given repository

Get-GitRootDirectory

Returns the root directory of a git repository.

Get-OpenPullRequests

This cmdlet is deprecated. Please use Get-GitHubOpenPullRequests instead Gets the open Pull requests for a given repository

Get-Response

Prompts a user for a response.

Get-SPDXLicenseIDs

Attempts to get the latest SPDX license short ID list.

Get-Terraform

Downloads the given version of Terraform for your OS

Get-TerraformResource

Searches for and returns a given Terraform resource block.

Get-Vault

Downloads the given version of Vault for your OS

Get-VaultSecret

Returns a secret from a given vault path

Import-PlatyPSModule

Imports the PlatyPS module avoiding collisions with other modules.

Initialize-BrownserveRepository

Prepares a repository for use for a given project

Install-ChocolateyPackage

Helper cmdlet for installing Chocolatey packages programmatically

Invoke-ConvertFromYaml

Wrapper cmdlet for ConvertFrom-Yaml

Invoke-ConvertToYaml

Wrapper cmdlet for ConvertTo-YAML

Invoke-DownloadMethod

Downloads a file using the best method available depending on operating system.

Invoke-NativeCommand

Invokes a native command while gracefully handling the output and error streams.

Invoke-TerraformApply

Invokes 'terraform apply' with a given set of arguments

Invoke-TerraformInit

Performs a `terraform init`

Invoke-TerraformPlan

Invokes a Terraform plan with a selection of given parameters

Invoke-TerraformShow

Runs the terraform show command and converts the output into a PowerShell object.

Invoke-TerraformValidate

Performs a 'terraform validate'

Merge-Hashtable

Merges two hashtables together

New-BrownserveChangelogEntry

Creates a new changelog entry for a given version in the standard Brownserve format.

New-BrownservePowerShellModule

Creates a new PowerShell module in the standard Brownserve format

New-BrownservePowerShellModuleBuild

Adds the various requirements to build a PowerShell module to a given project/repo.

New-BrownserveTemporaryDirectory

Creates a temporary directory

New-BrownserveTemporaryFile

Creates a temporary file in a known good location.

New-GitBranch

Creates a new branch in a given git repository

New-GitHubBranch

Creates a new remote branch in a GitHub repository.

New-GitHubCommit

Creates a commit on a GitHub repository branch via the GitHub API.

New-GitHubPullRequest

Creates a new GitHub pull request

New-GitHubRelease

Creates a release on GitHub

New-NuGetPackageVersion

This cmdlet has been deprecated and will be removed in a future release, please use Format-NuGetPackageVersion instead Obtains a NuGet package version based on the build version number and branch name.

New-PullRequest

This cmdlet is deprecated. Please use New-GitHubPullRequest instead. Creates a new pull request in GitHub

New-SPDXLicense

Creates a new licence using the SPDX format

New-TerraformResourceBlock

Creates a Terraform resource block that can easily be inserted into Terraform code.

Publish-TeamcityArtifact

Tells Teamcity to export a given file/folder as an artifact.

Push-GitChanges

Pushes local git changes to the remote repository.

Read-BrownserveChangelog

Reads in a changelog file and returns the contents as a custom object.

Read-Changelog

This cmdlet is deprecated and will be removed in a future release, please use Read-BrownserveChangelog instead. Retrieves version information and release notes from a CHANGELOG.md file.

Read-ConfigurationFromFile

Reads values from a configuration file

Remove-Markdown

This cmdlet removes markdown from a string.

Search-FileContent

Searches a file for a given set of regex and returns any text between them.

Select-BrownserveContent

Selects text from a given file

Send-BuildNotification

Sends a standard Brownserve build notification.

Send-SlackNotification

Sends a notification to a given Slack webhook

Set-BrownserveContent

Writes the contents of a file to disk.

Set-LineEndings

Sets the line endings of a file to either CRLF or LF

Set-TeamcityBuildNumber

Sets the build number in Teamcity.

Set-TerraformLogLevel

Provides an easy way to set the Terraform log level.

Split-URI

Takes a given URI and splits it into its constituent parts.

Submit-GitChanges

This cmdlet is a wrapper for \<git commit>.

Switch-GitBranch

Checks out a given branch.

Test-Administrator

A simple function for testing if a user is running with administrator/root privileges or not.

Test-Numeric

Tests if a given object is numeric.

Test-OperatingSystem

Quick way of terminating scripts when they are running on an incompatible OS.

Update-BrownservePowerShellModule

Updates a given Brownserve PowerShell module to use the latest template.

Update-BrownserveRepository

Updates a given repository to use the latest tooling and settings

Update-Changelog

Updates a repo's changelog according to the semver v1.0.0 spec.

Update-Version

A simple function to increment a semantic version number.

Write-TeamcityBuildProblem

Writes a Teamcity build problem to StdOut and the same message to StdErr.

Write-TeamcityStatus

Writes a status message to StdOut