Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file.

## [1.3.0] - 2025-09-23

- Added support for `ps1xml1` format data. Place it in resources folder with `Name.format.ps1xml` to be automatically added as format file and imported in module manifest

## [1.2.0] - 2025-09-17

### Added
Expand Down
2 changes: 1 addition & 1 deletion project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ProjectName": "ModuleTools",
"Description": "ModuleTools is a versatile, standalone PowerShell module builder. Create anything from simple to robust modules with ease. Built for CICD and Automation.",
"Version": "1.2.1",
"Version": "1.3.0",
"copyResourcesToModuleRoot": false,
"Manifest": {
"Author": "Manjunath Beli",
Expand Down
4 changes: 3 additions & 1 deletion src/private/Build-Module.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
function Build-Module {
Write-Verbose 'Buidling module psm1 file'
$data = Get-MTProjectInfo
$MTBuildVersion = (Get-Command Invoke-MTBuild).Version
Write-Verbose "Running ModuleTols Version: $MTBuildVersion"
Write-Verbose 'Buidling module psm1 file'
Test-ProjectSchema -Schema Build | Out-Null

$sb = [System.Text.StringBuilder]::new()
Expand Down
14 changes: 13 additions & 1 deletion src/private/Build.Manifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ function Build-Manifest {
$aliasToExport += Get-AliasInFunctionFromFile -filePath $_
}

## Import Formatting (if any)
$FormatsToProcess = @()
Get-ChildItem -Path $data.ResourcesDir -File -Filter '*.ps1xml' -ErrorAction SilentlyContinue | ForEach-Object {
if ($data.copyResourcesToModuleRoot) {
$FormatsToProcess += $_.Name
} else {
$FormatsToProcess += Join-Path -Path 'resources' -ChildPath $_.Name
}
}

$ManfiestAllowedParams = (Get-Command New-ModuleManifest).Parameters.Keys
$sv = [semver]$data.Version
$ParmsManifest = @{
Expand All @@ -21,8 +31,10 @@ function Build-Manifest {
AliasesToExport = $aliasToExport
RootModule = "$($data.ProjectName).psm1"
ModuleVersion = [version]$sv
FormatsToProcess = $FormatsToProcess
}


## Release lable
if ($sv.PreReleaseLabel) {
$ParmsManifest['Prerelease'] = $sv.PreReleaseLabel
}
Expand Down
3 changes: 2 additions & 1 deletion src/public/GetMTProjectInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ function Get-MTProjectInfo {
$Out['ModuleFilePSM1'] = [System.IO.Path]::Join($Out.OutputModuleDir, "$ProjectName.psm1")
$Out['ManifestFilePSD1'] = [System.IO.Path]::Join($Out.OutputModuleDir, "$ProjectName.psd1")

return $Out
$Output = [pscustomobject]$Out | Add-Member -TypeName MTProjectInfo -PassThru
return $Output
}
Loading