PowerShell helper functions for the Eigenverft Manifested Drydock, optimized for lightning-fast iteration and reliable local + CI/CD workflows.
π Key Features:
- Lightning-fast iteration with built-in auto-versioning
- Parity-driven tasks: same commands run locally and in CI/CD
- Offline-capable with
Export-OfflineModuleBundlesupport - Comprehensive .NET project tooling and reporting
- Robust Git operations and deployment management
# PowerShell 5.1+ or PowerShell Core
Install-Module -Name Eigenverft.Manifested.Drydock -Repository PSGallery -Scope CurrentUser -Force
# For offline systems, export bundle first:
Export-OfflineModuleBundle -Folder C:\temp\export -Name @(
'PowerShellGet',
'PackageManagement',
'Pester',
'PSScriptAnalyzer',
'Eigenverft.Manifested.Drydock'
)No admin rights needed, sets up PowerShellGet and PackageManagement for CurrentUser:
# From Command Prompt:
powershell -NoProfile -ExecutionPolicy Unrestricted -Command "& { irm -Uri https://raw.githubusercontent.com/eigenverft/Eigenverft.Manifested.Drydock/refs/heads/main/install/DrydockInit.ps1 | iex }"
# From PowerShell 5.1:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process ; irm -Uri https://raw.githubusercontent.com/eigenverft/Eigenverft.Manifested.Drydock/refs/heads/main/install/DrydockInit.ps1 | iexπ‘ Use
Get-Help <FunctionName> -Fullfor detailed documentation and examples.
- Get-GitTopLevelDirectory (ggtd) Return repository root using
git rev-parse --show-toplevel. Example:Get-GitTopLevelDirectory - Get-GitCurrentBranch (ggcb) Return current branch; on detached HEAD, try containing branches or fall back to commit hash.
Example:
Get-GitCurrentBranch - Get-GitCurrentBranchRoot (ggcbr) Return the first path segment of the branch (e.g.,
featurefromfeature/foo). Example:Get-GitCurrentBranchRoot - Get-GitRepositoryName (ggrn) Parse repository name from
remote.origin.url(HTTPS/SSH supported). Example:Get-GitRepositoryName - Get-GitRemoteUrl (gru) Return
remote.origin.urlas configured. Example:Get-GitRemoteUrl - Invoke-GitAddCommitPush (igacp) Stage folders, commit with transient identity, push branch, optionally tag.
Example:
Invoke-GitAddCommitPush -TopLevelDirectory (Get-GitTopLevelDirectory) -Folders @('source/Eigenverft.Manifested.Drydock') -CurrentBranch (Get-GitCurrentBranch)
- Convert-DateTimeTo64SecVersionComponents (cdv64) Encode DateTime to
Build.Major.Minor.Revisionwith 64s granularity. Example:Convert-DateTimeTo64SecVersionComponents -VersionBuild 1 -VersionMajor 0 - Convert-64SecVersionComponentsToDateTime (cdv64r) Decode four-part 64s-packed version back to approximate UTC DateTime.
Example:
Convert-64SecVersionComponentsToDateTime -VersionBuild 1 -VersionMajor 0 -VersionMinor 20250 -VersionRevision 1234 - Convert-DateTimeTo64SecPowershellVersion (cdv64ps) Map to simplified three-part
Build.NewMajor.NewMinorversion. Example:Convert-DateTimeTo64SecPowershellVersion -VersionBuild 1 - Convert-64SecPowershellVersionToDateTime (cdv64psr) Reverse the simplified mapping to reconstruct approximate DateTime.
Example:
Convert-64SecPowershellVersionToDateTime -VersionBuild 1 -VersionMajor 20250 -VersionMinor 1234
- Invoke-Exec (iexec) Run external command with per-call and common arguments; enforce allowed exit codes; optional timing/capture.
Example:
Invoke-Exec -Executable 'dotnet' -Arguments @('build','MyApp.csproj') -CommonArguments @('--configuration','Release') - Find-FilesByPattern (ffbp) Recursively find files under a path by
-Filterpattern. Example:Find-FilesByPattern -Path (Get-GitTopLevelDirectory) -Pattern '*.psd1' - Get-ConfigValue (gcv) If -Check is empty, read JSON and resolve a dotted property path.
Example:
Get-ConfigValue -Check $env:POWERSHELL_GALLERY -FilePath '.github/workflows/cicd.secrets.json' -Property 'POWERSHELL_GALLERY' - Test-VariableValue (tvv) Show variable name/value from a scriptblock; optional hide or exit-on-empty.
Example:
$branch='main'; Test-VariableValue -Variable { $branch } - Test-CommandAvailable Resolve a command (cmdlet/function/app/script); optionally throw or exit.
Example:
Test-CommandAvailable -Command 'git' - Get-RunEnvironment (gre) Detect CI provider/hosting vs local.
Example:
Get-RunEnvironment
- Test-InstallationScopeCapability Return
AllUsersif elevated, otherwiseCurrentUser. Example:Test-InstallationScopeCapability - Set-PSGalleryTrust Ensure
PSGalleryexists and is trusted (PowerShellGet preferred). Example:Set-PSGalleryTrust - Use-Tls12 Enable TLS 1.2 for the current PS5.x session.
Example:
Use-Tls12 - Test-PSGalleryConnectivity HEADβGET probe for PSGallery API (HTTP 200β399 is success).
Example:
Test-PSGalleryConnectivity - Initialize-NugetPackageProvider Ensure NuGet provider (>= 2.8.5.201) for scope.
Example:
Initialize-NugetPackageProvider -Scope CurrentUser - Initialize-PowerShellGet Ensure PowerShellGet (>= 2.2.5.1) with PSGallery trusted.
Example:
Initialize-PowerShellGet -Scope CurrentUser - Initialize-PackageManagement Ensure PackageManagement (>= 1.4.8.1).
Example:
Initialize-PackageManagement -Scope CurrentUser - Initialize-PowerShellBootstrap PS5.x-only bootstrap sequence.
Example:
Initialize-PowerShellBootstrap - Initialize-PowerShellMiniBootstrap Minimal PS5.x bootstrap.
Example:
Initialize-PowerShellMiniBootstrap - Import-Script Globalize and execute function/filter declarations from
.ps1files. Example:Import-Script -File @('.github/workflows/cicd.migration.ps1') -ErrorIfMissing - Export-OfflineModuleBundle Export PSGallery modules and provider for offline install.
Example:
Export-OfflineModuleBundle -Folder 'C:\Bundle' -Modules @('PowerShellGet','PackageManagement') - Uninstall-PreviousModuleVersions Remove older versions of a module.
Example:
Uninstall-PreviousModuleVersions -ModuleName 'Eigenverft.Manifested.Drydock' - Find-ModuleScopeClutter Detect modules installed in both user and system scopes.
Example:
Find-ModuleScopeClutter -detailed - Update-ManifestModuleVersion (ummv) Update
ModuleVersionin a.psd1manifest. Example:Update-ManifestModuleVersion -ManifestPath .\ -NewVersion '2.0.0' - Update-ManifestReleaseNotes (umrn) Update
PSData.ReleaseNotesin a.psd1manifest. Example:Update-ManifestReleaseNotes -ManifestPath .\ -NewReleaseNotes 'Fixed bugs; improved logging.' - Update-ManifestPrerelease (umpr) Update
PSData.Prereleasein a.psd1manifest. Example:Update-ManifestPrerelease -ManifestPath .\ -NewPrerelease 'rc.1'
- New-CompatScheduledTask Create/update a Windows Scheduled Task via COM with clear run context, triggers, and guidance.
Example:
New-CompatScheduledTask -TaskFolder "MyTasks" -TaskName 'MyDaily' -DailyAtTime '12:00' ` -ActionPath "$env:WINDIR\System32\WindowsPowerShell\v1.0\powershell.exe" ` -ActionArguments '-NoProfile -ExecutionPolicy Bypass -File "C:\Scripts\job.ps1"' New-CompatScheduledTask -TaskFolder "MyTasks" -TaskName 'MyLogin' -LogonThisUser ` -ActionPath "$env:WINDIR\System32\WindowsPowerShell\v1.0\powershell.exe" ` -ActionArguments '-NoProfile -ExecutionPolicy Bypass -File "C:\Scripts\job.ps1"'
- Enable-TempDotnetTools Install local-tools from a manifest into an ephemeral cache for the current session.
Example:
Enable-TempDotnetTools -ManifestFile '.config\dotnet-tools.json' - Disable-TempDotnetTools Remove ephemeral tool cache from PATH and optionally delete it.
Example:
Disable-TempDotnetTools -ManifestFile '.config\dotnet-tools.json' -Delete - Register-LocalNuGetDotNetPackageSource Register a NuGet source using dotnet CLI.
Example:
Register-LocalNuGetDotNetPackageSource -SourceLocation 'C:\nuget-local' - Unregister-LocalNuGetDotNetPackageSource Unregister a NuGet source by name.
Example:
Unregister-LocalNuGetDotNetPackageSource -SourceName 'local-feed' - New-DotnetBillOfMaterialsReport Generate a Bill of Materials report from package listings.
Example:
New-DotnetBillOfMaterialsReport -jsonInput $json -OutputFormat markdown -OutputFile 'reports/bom.md' - New-DotnetVulnerabilitiesReport Generate a vulnerabilities report from package scans.
Example:
New-DotnetVulnerabilitiesReport -jsonInput $json -OutputFormat markdown -OutputFile 'reports/vuln.md' - New-DotnetDeprecatedReport Generate a deprecation report for packages.
Example:
New-DotnetDeprecatedReport -jsonInput $json -OutputFormat markdown -OutputFile 'reports/deprecated.md' - New-DotnetOutdatedReport Generate an outdated packages report.
Example:
New-DotnetOutdatedReport -jsonInput $json -OutputFormat markdown -OutputFile 'reports/outdated.md' - New-ThirdPartyNotice Create/update THIRD-PARTY-NOTICES.txt from license data.
Example:
New-ThirdPartyNotice -LicenseJsonPath 'licenses.json' -OutputPath 'THIRD-PARTY-NOTICES.txt'
Notes:
- Use
Get-Help <FunctionName> -Detailedfor parameters, examples, and notes. - Aliases are shown in parentheses where available.
- π Ensure
gitis on PATH for Git helper functions - π All datetime-based conversions use UTC by default
β οΈ The 64-second encoding is lossy: reconstruction yields an approximate DateTime- π Report outputs support both text and markdown formats
- π All functions are idempotent and safe to run repeatedly
This project is licensed under the MIT License - see the LICENSE file for details.
For questions and support:
- π Open an issue in this repository
- π€ Submit a pull request with improvements