Brownserve.PSTools Module¶
Description¶
A collection of PowerShell tools used across various Brownserve projects to aid in CI/CD deployments and provide a common, easy-to-maintain codebase.
Brownserve.PSTools Cmdlets¶
Add-BrownserveChangelogEntry¶
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
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-Response¶
Prompts a user for a response.
Get-SPDXLicenseIDs¶
Attempts to get the latest SPDX license short ID list.
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.
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-SPDXLicense¶
Creates a new licence using the SPDX format
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-ConfigurationFromFile¶
Reads values from a configuration file
Remove-Markdown¶
This cmdlet removes markdown from a string.
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
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-Version¶
A simple function to increment a semantic version number.