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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DevPossible.PwshProject.Sdk" Version="0.1.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DevPossible.PwshProject.Sdk" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="DevPossible.PwshProject.Sdk">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DevPossible.PwshProject.Sdk --version 0.1.0
                    
#r "nuget: DevPossible.PwshProject.Sdk, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DevPossible.PwshProject.Sdk@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DevPossible.PwshProject.Sdk&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=DevPossible.PwshProject.Sdk&version=0.1.0
                    
Install as a Cake Tool

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

There are no supported framework assets in this package.

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