mirror of
https://github.com/yusufipk/RepoHub.git
synced 2026-09-11 10:36:07 +00:00
feat: add comprehensive Windows PowerShell script usage instructions
- Enhanced ScriptPreview with detailed Windows-specific installation steps including execution policy handling and winget availability checks - Added localization support for all script preview UI elements and Windows usage instructions - Improved script generator with automatic unblocking, admin privilege warnings, and winget validation
This commit is contained in:
@@ -140,6 +140,28 @@ function generateWindowsScript(packages: SelectedPackage[]): string {
|
||||
|
||||
Write-Host "Starting package installation for Windows..."
|
||||
|
||||
# Try to unblock this script (no-op if not needed)
|
||||
try { Unblock-File -Path $MyInvocation.MyCommand.Path -ErrorAction SilentlyContinue } catch {}
|
||||
|
||||
# Warn if not running as Administrator (some installs may require elevation)
|
||||
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
|
||||
if (-not $isAdmin) {
|
||||
Write-Warning "It's recommended to run this script as Administrator for best results."
|
||||
}
|
||||
|
||||
# Ensure winget is available
|
||||
if (-not (Get-Command winget -ErrorAction SilentlyContinue)) {
|
||||
Write-Warning "Windows Package Manager (winget) is not installed."
|
||||
Write-Host "We'll open the Microsoft Store page for 'App Installer' (includes winget)."
|
||||
Write-Host "After installation completes, please re-run this script."
|
||||
try {
|
||||
Start-Process "ms-windows-store://pdp/?productId=9NBLGGH4NNS1"
|
||||
} catch {
|
||||
Write-Host "If the Store didn't open, install 'App Installer' manually from: https://aka.ms/getwinget"
|
||||
}
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Install packages using winget
|
||||
Write-Host "Installing packages: ${packageNames}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user