:確認powershell有沒有開啟
@echo off
@for /f %%a IN ('powershell -command "get-executionpolicy"') do set CheckPS=%%a
echo %CheckPS%
@IF %CheckPS% == RemoteSigned (
echo "PowerSell is remotesigned"
) ELSE (
echo "PowerSell not's remotesigned"
powershell -command "set-executionpolicy remotesigned"
)
:執行PowerShell Script
powershell -command "& .\AlertMail.ps1 -Param1 %List%"
沒有留言:
張貼留言