如何在批处理/ PowerShell的摆脱安全警告 [英] How to get rid of security warning in Batch/Powershell
问题描述
我试图通过批处理文件来执行PowerShell脚本并不断得到以下警告
I am trying to execute a powershell script via batch file and constantly getting the following warning;
- >执行策略设置为远程签署;我也无限制测试,相同的错误显示出来;如何摆脱这种?
-> the execution policy is set to remote signed ; i also tested with Unrestricted, the same error shows up; how to get rid of this?
推荐答案
是您的PS1脚本驻留在网络共享?您可以通过在管理PowerShell控制台中输入设置executionpolicy旁路
跳过所有的安全流程
Is your ps1 script reside in a network share ? You can skip all the security process by typing set-executionpolicy bypass
in a admin powershell console
或者您可以通过调用你的脚本 powershell.exe -ExecutionPolicy旁路-file \\\\服务器\\共享\\ script.ps1
or you can invoke your script by powershell.exe -executionpolicy bypass -file \\servername\share\script.ps1
这篇关于如何在批处理/ PowerShell的摆脱安全警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!