This document explains how to package and install the PowerShell Localization extension for development and testing purposes.
Note
Tasks are split between psake and yarn. This is due to the fact that psake can setup more robust dependencies. Several tasks can only be called via Node so those calls stay in the package.json
To install all the necessary dependencies ensure that you bootstrap your environment.
.\build.ps1 -Bootstrap# To run through the compile, lint, and test
.\build.ps1 -Task Test
# To run all the tests + Install
.\build.ps1 -Task Install
# To see all the possible tasks
.\build.ps1 -HelpThis will configure the environment and perform a clean build, compile, lint, package, and install the extension.
# Package (calls psake)
yarn package
# Get a list of packages
yarn runThe build.ps1 script provides the following functionality (via psake.ps1):
- ✅ Dependency Check: Automatically installs
vsceif not present - 🧹 Clean Build: Removes previous builds and packages
- 🔨 Compilation: Compiles TypeScript source code
- 🔍 Linting: Runs ESLint for code quality
- 📦 Packaging: Creates a
.vsixextension package - 🚀 Installation: Installs the extension in VS Code
See Parameters & Properties for a more detailed explanation. It is highly unlikely you'll need to modify any of the properties.
# Test (default)
.\build.ps1
# Package only to a different output directory
.\build.ps1 -Task Package -Parameters @{ OutDir = '/path/to/dir' }
# Force installation even if already installed
.\build.ps1 -Parameters @{ Force = $true }
# Combine parameters
.\build.ps1 -Parameters @{ SkipInstall = $true; Force = $true }If you prefer to run the steps manually:
-
Install vsce (if not already installed):
npm install -g @vscode/vsce
-
Install dependencies:
yarn install
-
Compile TypeScript:
yarn run compile
-
Package extension:
vsce package --allow-missing-repository --out $script:outDir -
Install extension:
code --install-extension powershelllocalization-*.vsix
If vsce installation fails, try:
npm install -g @vscode/vsce --forceIf you get execution policy errors, run:
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUserAfter installation:
- Reload VS Code (
Ctrl+Shift+P→ "Developer: Reload Window") - Open a PowerShell file (
.ps1,.psm1, or.psd1) - Check that the extension is active in the Extensions panel
- You should see logs in the Output panel.
For GitHub Actions or other CI systems, use the CI task to output build/package information:
.\build.ps1 -Task CIThis will output the VSIX path, name, and Changelog information to
$env:GITHUB_OUTPUT for use in workflows.
For active development, you can use the watch mode:
# Start TypeScript compiler in watch mode
yarn run watchThen use F5 in VS Code to launch the Extension Development Host for testing.
powershelllocalization-*.vsix- The packaged extension fileout/- Compiled JavaScript output- Extension logs in VS Code Developer Tools
After successful installation:
- Open a PowerShell module with localization files
- Verify that localization variables show inline values
- Test the extension configuration in VS Code settings