Skip to content

Commit 5d5db10

Browse files
committed
note for executionPolicy
1 parent 083e464 commit 5d5db10

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

windows_setup.ps1

+12
Original file line numberDiff line numberDiff line change
@@ -284,5 +284,17 @@ Write-Host "2. Navigate to the installation directory:"
284284
Write-Host " cd `"$installPath`""
285285
Write-Host "3. Run the script:"
286286
Write-Host " .\customcode-analyzer-generator.ps1"
287+
288+
if ($executionPolicy -eq "Restricted" -or $executionPolicy -eq "AllSigned") {
289+
Write-Host "`nPowerShell is currently blocking script execution!" -ForegroundColor Yellow
290+
Write-Host "Detected Execution Policy: $executionPolicy"
291+
Write-Host "`nTo allow the script to run, choose one of these two options:"
292+
Write-Host " - (Recommended) Change policy to allow local scripts:"
293+
Write-Host " Set-ExecutionPolicy RemoteSigned -Scope CurrentUser"
294+
Write-Host " - (One-time use) Run the script with temporary permission:"
295+
Write-Host " powershell -ExecutionPolicy Bypass -File .\customcode-analyzer-generator.ps1"
296+
Write-Host "`nAfter fixing the execution policy, return to Step 3 and run the script."
297+
}
298+
287299
Write-Host "`nPress any key to exit..."
288300
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')

0 commit comments

Comments
 (0)