DevPossible.PwshProject.Sdk
0.1.0
dotnet add package DevPossible.PwshProject.Sdk --version 0.1.0
NuGet\Install-Package DevPossible.PwshProject.Sdk -Version 0.1.0
<PackageReference Include="DevPossible.PwshProject.Sdk" Version="0.1.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="DevPossible.PwshProject.Sdk" Version="0.1.0" />
<PackageReference Include="DevPossible.PwshProject.Sdk"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add DevPossible.PwshProject.Sdk --version 0.1.0
#r "nuget: DevPossible.PwshProject.Sdk, 0.1.0"
#:package DevPossible.PwshProject.Sdk@0.1.0
#addin nuget:?package=DevPossible.PwshProject.Sdk&version=0.1.0
#tool nuget:?package=DevPossible.PwshProject.Sdk&version=0.1.0
DevPossible.PwshProject.Sdk
An MSBuild SDK that enables PowerShell-driven builds for .NET projects. Instead of compiling code, projects using this SDK execute PowerShell scripts (build.ps1, clean.ps1, publish.ps1) with all MSBuild properties exposed as environment variables.
Quick Start
Create a .psproj file:
<Project Sdk="DevPossible.PwshProject.Sdk/1.0.0">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</Project>
Create a build.ps1 in the same directory:
#Requires -Version 7.0
$ErrorActionPreference = 'Stop'
Write-Host "Building $env:MBLD_PROJECT_NAME ($env:MBLD_CONFIGURATION)..."
Write-Host "Output: $env:MBLD_OUT_DIR"
# Your build logic here
Run:
dotnet build
dotnet clean
dotnet publish
Environment Variables
All MSBuild properties are exposed with the MBLD_ prefix:
| Variable | Description |
|---|---|
MBLD_PROJECT_DIR |
Project directory path |
MBLD_PROJECT_NAME |
Project name |
MBLD_CONFIGURATION |
Build configuration (Debug/Release) |
MBLD_PLATFORM |
Target platform |
MBLD_TARGET_FRAMEWORK |
Target framework |
MBLD_OUT_DIR |
Output directory path |
MBLD_OUTPUT_PATH |
Output path (same as OUT_DIR) |
MBLD_BASE_OUTPUT_PATH |
Base output path (bin/) |
MBLD_INTERMEDIATE_OUTPUT_PATH |
Intermediate path (obj/) |
MBLD_PUBLISH_DIR |
Publish directory (publish target only) |
MBLD_VERSION |
Version number |
MBLD_ASSEMBLY_NAME |
Assembly name |
MBLD_SOLUTION_DIR |
Solution directory |
| ... | And many more! |
Scripts
| Script | Target | Description |
|---|---|---|
build.ps1 |
dotnet build |
Main build logic |
clean.ps1 |
dotnet clean |
Clean outputs |
publish.ps1 |
dotnet publish |
Publish artifacts |
restore.ps1 |
Before build | Optional restore step |
Configuration
Override defaults in your project file:
<PropertyGroup>
<PwshBuildScript>my-build.ps1</PwshBuildScript>
<PwshCleanScript>my-clean.ps1</PwshCleanScript>
<PwshCleanEnabled>false</PwshCleanEnabled>
<PwshExecutable>pwsh.exe</PwshExecutable>
</PropertyGroup>
Use Cases
- TypeScript/JavaScript compilation
- Static site generation
- Asset bundling and optimization
- Multi-step build pipelines
- Custom deployment processes
- Any build process that benefits from PowerShell scripting
License
MIT
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 326 | 1/15/2026 |