The XPS Bootstrap framework is a modular and extensible system designed to streamline PowerShell configuration and enhance user experience. It provides a structured approach to loading scripts, managing dependencies, and customizing the shell environment.
- Automatically loads all
*.ps1
scripts from thexeyth/bootstrap
directory. - Supports deterministic execution order using numeric prefixes (e.g.,
1.0.Git.ps1
,3.0.DotNet.ps1
). - Prevents duplicate loading within a session using a global cache (
$global:XeythLoadedScripts
).
- Includes
XPSRequire
andXPSRequireCommand
functions to validate the presence of required tools and modules. - Provides clear error messages and installation instructions for missing dependencies.
- Implements a consistent and user-friendly status output system:
[✓]
for success (green).[✗]
for errors (red).[⚠]
for warnings (yellow).
- Centralized output styling using
Write-StatusMessage
andWrite-StatusError
functions.
- Ensures the execution policy is set to
RemoteSigned
for the current user. - Automatically unblocks downloaded scripts using
Unblock-File
.
- Configures PSReadLine with a shared
$TokenColors
map for syntax highlighting. - Aligns token colors with Visual Studio’s default C# theme.
- Integrates Oh My Posh for a visually appealing and informative prompt.
- Includes a custom theme file.
- Encapsulates functions within script blocks to prevent global namespace pollution.
- Validates .NET SDK versions using a helper function that strips pre-release suffixes.
- Provides clear error messages and installation links for outdated or missing SDKs.
- Located in
xeyth/bootstrap/
. - Organized into categories:
1.*
- Core tools (e.g., Git, editor configuration).2.*
- SDKs and completions (e.g., .NET, PSReadLine).3.*
- UI/UX enhancements (e.g., bat, Oh My Posh).
- Located in
xeyth/bootstrap/tests/
. - Includes scripts for verifying bootstrap functionality and load order.
- Located in
xeyth/modules/
. - Provides additional functionality and configuration options.
For detailed information about the XPS modules, refer to the XPS Modules Documentation.