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 @@ -40,6 +40,10 @@ Keep stable `Update-NovaModuleVersion` / `% nova bump` releases on the SemVer ma

### Fixed

- Add a PowerShell installed-tool version view through `Get-NovaProjectInfo -Installed`.
- PowerShell now exposes the installed `NovaModuleTools` module name and version directly instead of requiring the
launcher-only `% nova --version` path.
- `Get-Help Get-NovaProjectInfo` now documents both the project-version and installed-tool-version views.
- Stop build-driven workflows when a `src/public` file contains zero or multiple top-level functions.
- This prevents helper functions from being exported accidentally just because they live in a public file.
- `Invoke-NovaBuild`, `Test-NovaBuild -Build`, packaging, publishing, and release flows now surface the warning
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,11 @@ the
installed module manifest. When `Invoke-NovaBuild` detects a newer `NovaModuleTools` version after a build, the update
warning also includes that same release notes link.

To compare the current project version with what is installed locally for that same module, use:
To inspect the current project version, the installed version of the current project module, or the installed
`NovaModuleTools` tool version, use:

```powershell
PS> Get-NovaProjectInfo -Installed
% nova version
% nova version --installed
% nova version -i
Expand All @@ -132,6 +134,7 @@ To compare the current project version with what is installed locally for that s
- `% nova version --installed` / `% nova version -i` shows the locally installed version of the current project/module
from
the local module path
- `Get-NovaProjectInfo -Installed` shows the installed `NovaModuleTools` module name and version from PowerShell
- `% nova --version` / `% nova -v` shows the installed `NovaModuleTools` version

### CLI help
Expand Down
86 changes: 71 additions & 15 deletions docs/NovaModuleTools/en-US/Get-NovaProjectInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ external help file: NovaModuleTools-Help.xml
HelpUri: ''
Locale: en-US
Module Name: NovaModuleTools
ms.date: 04/25/2026
ms.date: 05/06/2026
PlatyPS schema version: 2024-05-01
title: Get-NovaProjectInfo
---
Expand All @@ -13,16 +13,28 @@ title: Get-NovaProjectInfo

## SYNOPSIS

Reads `project.json` and returns resolved NovaModuleTools project metadata.
Reads `project.json` and returns resolved NovaModuleTools project metadata or a version-focused view.

## SYNTAX

### __AllParameterSets
### ProjectInfo

```text
PS> Get-NovaProjectInfo [[-Path] <string>] [<CommonParameters>]
```

### ProjectVersion

```text
PS> Get-NovaProjectInfo [[-Path] <string>] [-Version] [<CommonParameters>]
```

### InstalledVersion

```text
PS> Get-NovaProjectInfo [-Installed] [<CommonParameters>]
```

## DESCRIPTION

`Get-NovaProjectInfo` reads the `project.json` file in a NovaModuleTools project and returns a project information
Expand All @@ -37,6 +49,9 @@ Use this command from scripts, tests, or troubleshooting when you want one objec

When you use `-Version`, the command returns only the project version string instead of the full project object.

When you use `-Installed`, the command returns the installed `NovaModuleTools` module name and version string instead of
project metadata.

## EXAMPLES

### EXAMPLE 1
Expand All @@ -63,6 +78,14 @@ PS> Get-NovaProjectInfo -Version

Returns only the version string from `project.json`.

### EXAMPLE 4

```text
PS> Get-NovaProjectInfo -Installed
```

Returns the installed `NovaModuleTools` module name and version string.

## PARAMETERS

### -Path
Expand All @@ -75,12 +98,18 @@ DefaultValue: (Get-Location).Path
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
- Name: ProjectInfo
Position: 0
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
- Name: ProjectVersion
Position: 0
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
Expand All @@ -96,12 +125,33 @@ DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
- Name: ProjectVersion
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
```

### -Installed

Return the installed `NovaModuleTools` module name and version string instead of project metadata.

```yaml
Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: InstalledVersion
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
Expand All @@ -125,6 +175,10 @@ You can't pipe objects to this cmdlet.

Returned when you use `-Version`.

### System.String

Returned when you use `-Installed`.

### PSCustomObject

Returned by default. The object includes project metadata, defaulted build settings, and resolved paths.
Expand All @@ -133,6 +187,8 @@ Returned by default. The object includes project metadata, defaulted build setti

This command throws a clear error when `project.json` is missing or empty.

`-Installed` does not require a project path or a `project.json` file.

## RELATED LINKS

- https://github.com/stiwicourage/NovaModuleTools/blob/main/docs/NovaModuleTools/en-US/Invoke-NovaBuild.md
Expand Down
3 changes: 2 additions & 1 deletion docs/NovaModuleTools/en-US/NovaModuleTools.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ manifest generation, external help generation, resource copying, and Pester-base

### `PS> Get-NovaProjectInfo`

Reads `project.json` and returns resolved project metadata and paths.
Reads `project.json` and returns resolved project metadata and paths, or returns the project/install version views when
requested.

### `PS> Get-NovaUpdateNotificationPreference`

Expand Down
24 changes: 16 additions & 8 deletions docs/commands.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,19 +189,23 @@ <h3><code>Get-NovaProjectInfo</code> / <code>% nova info</code></h3>
<ul class="plain-list">
<li><strong>Best for:</strong> scripts, troubleshooting, and understanding resolved paths
</li>
<li><strong>Key parameters:</strong> <code>-Path</code>, <code>-Version</code></li>
<li><strong>Key parameters:</strong> <code>-Path</code>, <code>-Version</code>, <code>-Installed</code>
</li>
<li><strong>Output:</strong> a project object, or just the version string when you use
<code>-Version</code></li>
<code>-Version</code>, or the installed <code>NovaModuleTools</code> name and version
string when you use
<code>-Installed</code></li>
</ul>
<div class="surface-example" data-command-example>
<div class="surface-example__meta">
<p class="surface-example__title">Inspect project metadata</p>
<p class="surface-example__title">Inspect project metadata or version views</p>
<p class="surface-example__status">Showing: <span
data-command-surface-label>PowerShell</span></p>
</div>
<div class="surface-example__surface" data-command-surface="powershell">
<pre><code>PS&gt; Get-NovaProjectInfo
PS&gt; Get-NovaProjectInfo -Version</code></pre>
PS&gt; Get-NovaProjectInfo -Version
PS&gt; Get-NovaProjectInfo -Installed</code></pre>
</div>
<div class="surface-example__surface" data-command-surface="command-line" hidden>
<pre><code>% nova info
Expand Down Expand Up @@ -534,7 +538,8 @@ <h3><code>% nova version</code>, <code>% nova version --installed</code>, and <c
data-command-surface-label>PowerShell</span></p>
</div>
<div class="surface-example__surface" data-command-surface="powershell">
<pre><code>PS&gt; Get-NovaProjectInfo -Version</code></pre>
<pre><code>PS&gt; Get-NovaProjectInfo -Version
PS&gt; Get-NovaProjectInfo -Installed</code></pre>
</div>
<div class="surface-example__surface" data-command-surface="command-line" hidden>
<pre><code>% nova version
Expand All @@ -545,9 +550,12 @@ <h3><code>% nova version</code>, <code>% nova version --installed</code>, and <c
</div>
</div>
<div class="surface-note" data-command-visibility="powershell">
<p><strong>PowerShell note:</strong> the cmdlet surface covers the project version directly.
Installed-module and installed-tool version views stay on the launcher flow described in
the linked guide.</p>
<p><strong>PowerShell note:</strong> <code>Get-NovaProjectInfo -Version</code> covers the
project version and
<code>Get-NovaProjectInfo -Installed</code> covers the installed
<code>NovaModuleTools</code> tool version.
The installed current-project module view stays on the launcher flow described in the
linked guide.</p>
</div>
<p><a class="text-link" href="./versioning-and-updates.html#version-views">See version view
differences</a></p>
Expand Down
13 changes: 7 additions & 6 deletions docs/versioning-and-updates.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ <h2>Choose the right version command</h2>
</td>
</tr>
<tr>
<td><code>% nova --version</code></td>
<td><code>Get-NovaProjectInfo -Installed</code> or <code>% nova --version</code></td>
<td>The installed NovaModuleTools version.</td>
<td>Use this when you are troubleshooting Nova itself or checking whether the tool needs an
update.
Expand All @@ -136,7 +136,8 @@ <h2>Choose the right version command</h2>
</p>
</div>
<div class="surface-example__surface" data-command-surface="powershell">
<pre><code>PS&gt; Get-NovaProjectInfo -Version</code></pre>
<pre><code>PS&gt; Get-NovaProjectInfo -Version
PS&gt; Get-NovaProjectInfo -Installed</code></pre>
</div>
<div class="surface-example__surface" data-command-surface="command-line" hidden>
<pre><code>% nova version
Expand All @@ -147,10 +148,10 @@ <h2>Choose the right version command</h2>
</div>
</div>
<div class="surface-note" data-command-visibility="powershell">
<p><strong>PowerShell note:</strong> project version lookup has a direct cmdlet form. The installed
module/tool version views remain launcher-oriented on this page, as shown in the comparison
table
above.</p>
<p><strong>PowerShell note:</strong> project version lookup and installed-tool version lookup both
have direct
cmdlet forms. The installed current-project module view remains launcher-oriented on this page,
as shown in the comparison table above.</p>
</div>
</section>

Expand Down
2 changes: 1 addition & 1 deletion src/private/cli/SetNovaCliExecutablePermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function Set-NovaCliExecutablePermission {
return
}

& chmod '+x' $Path
& chmod '+x' $Path 2> $null
if ($LASTEXITCODE -ne 0) {
Stop-NovaOperation -Message "Failed to make nova launcher executable: $Path" -ErrorId 'Nova.Dependency.CliLauncherPermissionUpdateFailed' -Category InvalidOperation -TargetObject $Path
}
Expand Down
17 changes: 14 additions & 3 deletions src/public/GetNovaProjectInfo.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
function Get-NovaProjectInfo {
[CmdletBinding()]
[CmdletBinding(DefaultParameterSetName = 'ProjectInfo')]
param(
[Parameter(Position = 0)]
[Parameter(Position = 0, ParameterSetName = 'ProjectInfo')]
[Parameter(Position = 0, ParameterSetName = 'ProjectVersion')]
[string]$Path = (Get-Location).Path,
[switch]$Version
[Parameter(ParameterSetName = 'ProjectVersion')]
[switch]$Version,
[Parameter(ParameterSetName = 'InstalledVersion')]
[switch]$Installed
)

if ($Installed) {
$module = $ExecutionContext.SessionState.Module
$installedVersion = Get-NovaCliInstalledVersion -Module $module
return Format-NovaCliVersionString -Name $module.Name -Version $installedVersion
}

$workflowContext = Get-NovaProjectInfoContext -Path $Path
return Get-NovaProjectInfoResult -WorkflowContext $workflowContext -Version:$Version
}
2 changes: 1 addition & 1 deletion tests/ArchitectureGuardrails.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Describe 'Architecture guardrails' {
It 'public command files use only their approved Nova helper surface' {
$testCases = @(
[pscustomobject]@{Path = 'src/public/DeployNovaPackage.ps1'; ExpectedHelpers = @('Get-NovaPackageUploadWorkflowContext', 'Get-NovaProjectInfo', 'Invoke-NovaPackageUploadWorkflow', 'New-NovaPackageUploadDynamicParameterDictionary', 'New-NovaPackageUploadOption')}
[pscustomobject]@{Path = 'src/public/GetNovaProjectInfo.ps1'; ExpectedHelpers = @('Get-NovaProjectInfoContext', 'Get-NovaProjectInfoResult')}
[pscustomobject]@{Path = 'src/public/GetNovaProjectInfo.ps1'; ExpectedHelpers = @('Format-NovaCliVersionString', 'Get-NovaCliInstalledVersion', 'Get-NovaProjectInfoContext', 'Get-NovaProjectInfoResult')}
[pscustomobject]@{Path = 'src/public/GetNovaUpdateNotificationPreference.ps1'; ExpectedHelpers = @('Get-NovaUpdateNotificationPreferenceStatus')}
[pscustomobject]@{Path = 'src/public/InitializeNovaModule.ps1'; ExpectedHelpers = @('Get-NovaModuleInitializationWorkflowContext', 'Invoke-NovaModuleInitializationWorkflow')}
[pscustomobject]@{Path = 'src/public/InstallNovaCli.ps1'; ExpectedHelpers = @('Get-NovaCliInstallWorkflowContext', 'Invoke-NovaCliInstallWorkflow', 'Write-NovaModuleReleaseNotesLink')}
Expand Down
15 changes: 15 additions & 0 deletions tests/NovaCommandModel.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,21 @@ Describe 'Nova command model - project, help, and build behavior' {
}
}

It 'Get-NovaProjectInfo -Installed returns the installed NovaModuleTools name and version without reading project.json' {
InModuleScope $script:moduleName -Parameters @{ExpectedModuleName = $script:moduleName} {
param($ExpectedModuleName)

Mock Get-NovaCliInstalledVersion {'9.9.9-preview'}
Mock Get-NovaProjectInfoContext {throw 'should not resolve project context'}
Mock Get-NovaProjectInfoResult {throw 'should not shape project output'}

Get-NovaProjectInfo -Installed | Should -Be "$ExpectedModuleName 9.9.9-preview"
Assert-MockCalled Get-NovaCliInstalledVersion -Times 1 -Scope It
Assert-MockCalled Get-NovaProjectInfoContext -Times 0 -Scope It
Assert-MockCalled Get-NovaProjectInfoResult -Times 0 -Scope It
}
}

It 'Get-NovaProjectInfo delegates context resolution and result shaping to private helpers' {
InModuleScope $script:moduleName {
Mock Get-NovaProjectInfoContext {
Expand Down
Loading