Brownserve.PSSourceControl.psm1
|
<# .DESCRIPTION Source control helpers for Git and GitHub used across Brownserve PowerShell modules and projects. #> #Requires -Version 6.0 [CmdletBinding()] param() $ErrorActionPreference = 'Stop' $PublicCmdlets = @() # Dot source our private functions so they are available for our public functions to use $PrivatePath = Join-Path $PSScriptRoot -ChildPath 'Private' $PrivatePath | Resolve-Path | Get-ChildItem -Filter *.ps1 -Recurse | ForEach-Object { . $_.FullName } # Dot source our public functions and then add their help information to an array Join-Path $PSScriptRoot -ChildPath 'Public' | Resolve-Path | Get-ChildItem -Filter *.ps1 -Recurse | ForEach-Object { . $_.FullName Export-ModuleMember $_.BaseName $PublicCmdlets += Get-Help $_.BaseName } <# If our special variable exists then add these cmdlets to said variable so we can output their summary later on. Unfortunately just checking for the existence of the variable isn't enough as if it's blank PowerShell seems to treat it as null :( #> if ($Global:BrownserveCmdlets -is 'System.Array') { $Global:BrownserveCmdlets += @{ Module = "$($MyInvocation.MyCommand)" Cmdlets = $PublicCmdlets } } |