Skip to content

Commit

Permalink
win: add PowerShell verification in scripts #457
Browse files Browse the repository at this point in the history
This commit introduces a check at the start of the batch files. It
exists with a clear error message if PowerShell is missing or not in
PATH.

This way, it prevents repeated `'PowerShell' is not recognized'` errors
and provides a more user-friendly failure mode.
  • Loading branch information
undergroundwires committed Dec 16, 2024
1 parent 64feb66 commit 92ec138
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/application/collections/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ scripting:
startCode: |-
@echo off
:: {{ $homepage }} — v{{ $version }} — {{ $date }}
:: Ensure PowerShell is available
where PowerShell >nul 2>&1 || (
echo PowerShell is not available. Please install or enable PowerShell.
pause & exit 1
)
:: Ensure admin privileges
fltmc >nul 2>&1 || (
echo Administrator privileges are required.
Expand Down

0 comments on commit 92ec138

Please sign in to comment.