Get-ProjectVersion
Retrieves project version information from .csproj, .psd1, and build scripts.
Syntax
Get-ProjectVersion [-ExcludeFolders <String[]>] [-ModuleName <String>] [-Path <String>] [<CommonParameters>]#All Parameter SetsDescription
Scans the specified path for: *.csproj files*.psd1 filesPowerShell build scripts (*.ps1) that contain Invoke-ModuleBuild and returns one record per discovered version entry.
This is useful for multi-project repositories where you want to quickly verify version alignment across projects/modules.
Examples
Get version information for all projects in the current directory
Get-ProjectVersionReturns entries for discovered .csproj/.psd1/build scripts under the current folder.
Filter results to one module name
Get-ProjectVersion -ModuleName 'MyModule' -Path 'C:\Projects'Useful when a repository contains multiple modules/projects but you need only one.
Parameters
- -ExcludeFolders String[]
- Path fragments (or folder names) to exclude from the search (in addition to default 'obj' and 'bin'). This matches against the full path, case-insensitively.
- -ModuleName String
- Optional module name to filter .csproj and .psd1 results.
- -Path String
- The root path to search for project files. Defaults to current directory.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.