请教各位老师,我要做一个自动化工具,在winPE系统下修改了开机启动命令,我修改以后的开机命令如下:
” wpeinit`r`n c:`r`n powershell -command . set-executionpolicy remotesigned; C:\wcstest\scripts\wcsscripts.ps1; ” 。
但是现在开机后执行到
“powershell -command . set-executionpolicy remotesigned; C:\wcstest\scripts\wcsscripts.ps1;”
这条语句后会出现红色错误信息如下:File X:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1 cannot be loaded because running scripts is disabled on this system.并且没有进入powershell里面。
请问这个问题该怎么解决呢?
如果我不修改开机启动命令,正常开机以后我手动输入powershell,然后回车,是可以进入PS开头的powershell环境的。但是仍然会报错:File X:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1 cannot be loaded because running scripts is disabled on this system.
PS:“C:\wcstest\scripts\wcsscripts.ps1” 这个目录下的wcsscripts.ps1文件是我要执行的一个脚本文件。
时间很紧急,在这先谢谢各位!希望大家能给我一个可行的方法!