Pscript
Pscript is a small interpreted language with a Windows x64 command-line runtime and a Visual Studio Code extension.
Install the VS Code extension and runtime
The extension includes the language analyzer. The program runtime is distributed separately as pscript-runtime-win32-x64.zip because the runtime executable is much larger than the extension.
- Install the Pscript VS Code extension (
pyscr-<version>.vsix) using Extensions: Install from VSIX....
- Download
pscript-runtime-win32-x64.zip from the same release as the extension.
- Extract the ZIP into
%LOCALAPPDATA%\PscriptExe. The expected path is %LOCALAPPDATA%\PscriptExe\pscript.exe.
- Open a
.ps file and use the Pscript run button or the ps.runFile command.
The extension also searches for pscript.exe on PATH, in %LOCALAPPDATA%\PscriptExe, in %ProgramFiles%\PscriptExe, and in %USERPROFILE%\.pscript.
To select a custom executable, set Pscript: Runtime Path (pscript.runtimePath) to the absolute path of pscript.exe in VS Code settings. A configured path takes precedence over automatic discovery.
Build release artifacts (Windows x64)
Prerequisites: Windows x64, Python 3.11 or newer, Node.js/npm, PyInstaller, and vsce. Install the Python runtime dependencies and build tools first:
python -m pip install -e . pyinstaller
npm install --global @vscode/vsce
Run ./rebuild.ps1 and choose [8] Build ALL. This builds:
dist\pscript-runtime-win32-x64.zip — runtime executable for the user to install separately.
pyscr-<version>-win32-x64.vsix — VS Code extension with its analyzer executable.
The extension is deliberately packaged for Windows x64; its analyzer and runtime are Windows executables. Keep the VSIX version in package.json and the runtime/package version in pyproject.toml aligned for each release.
Install the Python package from source
From the project directory:
python -m pip install .
pscript --version
pscript path/to/program.ps
The package declares its Python runtime dependencies in pyproject.toml. OCR commands also need the external Tesseract OCR application installed. Pscript finds tesseract.exe on PATH or at the standard Windows install path; set the TESSERACT_CMD environment variable if it is installed elsewhere.
Run from source
python main_pscript.py path/to/program.ps
Run automated tests
The scanner, parser, and analyzer tests use Python's standard library unittest:
python -B -m unittest discover -s tests -v