简体   繁体   English

RemoteSigned可以运行在同一域上创建的脚本吗?

[英]Can RemoteSigned run scripts created on same domain?

I'm creating and testing some powershell scripts to do some basic file copying. 我正在创建和测试一些Powershell脚本以进行一些基本的文件复制。 I've set my executionpolicy to RemoteSigned. 我已将我的执行策略设置为RemoteSigned。 According to the help, this should allow me to run scripts that were not downloaded from the internet. 根据帮助,这应该允许我运行未从Internet下载的脚本。 However, my observations seem to indicate that this will run only scripts created on the local machine. 但是,我的观察似乎表明这将仅运行在本地计算机上创建的脚本。

For instance, if I create a script on my development machine and try to copy to my server (on my same domain), the script will not run. 例如,如果我在开发计算机上创建脚本并尝试复制到我的服务器(在同一域中),该脚本将无法运行。 However, if I open up the Powershell ISE on the server and open my script, copy the code and paste it into a new file window and save it to the server, the script then runs. 但是,如果我在服务器上打开Powershell ISE并打开脚本,然后复制代码并将其粘贴到新的文件窗口中,然后将其保存到服务器,则脚本将运行。 Further, if I want to create a self-signed certificate, it will not run on other computers (per the help). 此外,如果我要创建自签名证书,则该证书将无法在其他计算机上运行(根据帮助)。

So, this all seems a bit cumbersome that I have to develop my scripts on the machine they are to be run or go through the copy/paste routine mentioned above to get them to run on my server. 因此,这一切似乎有点麻烦,我必须在要运行它们的机器上开发脚本或通过上面提到的复制/粘贴例程使它们在我的服务器上运行。 I just want to know that I've understood all of this correctly and there is no other way to create a script within the same domain and run it under the remotesigned execution policy without paying the fee for a certificate. 我只想知道我已经正确理解了所有这些内容,并且没有其他方法可以在同一域中创建脚本并在remotesigned执行策略下运行该脚本,而无需支付证书费用。

this post here provide the method for executing script from shared folder. 这篇文章在这里提供了从共享文件夹执行脚本的方法。 hope this could help you :-) 希望这可以帮助您:-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我的本地创建的脚本不允许在 RemoteSigned 执行策略下运行? - Why is my locally-created script not allowed to run under the RemoteSigned execution policy? Powershell远程签名策略不适用于SQL Agent Job,但在“手动”运行时有效 - Powershell remotesigned policy not working with SQL agent Job, but working if run “manually” 如何同时运行多个Powershell脚本? - How to run multiple Powershell Scripts at the same time? 我可以在Silverlight应用程序中运行PowerShell脚本吗? - Can I run PowerShell scripts in an Silverlight application? 无法在 Windows EC2 上运行 Powershell 用户数据脚本 - Can't run Powershell user data scripts on Windows EC2 如何在 package.json 脚本中运行多个命令? - How can I run multiple commands in package.json scripts? *.ps1 脚本能否作为后台作业运行,自己执行 *.ps1 脚本? - Can *.ps1 scripts run as background jobs themselves execute *.ps1 scripts? Powershell执行策略remotesigned矛盾? - Powershell execution policy remotesigned contradiction? 您可以针对不同的框架版本在VSCode中运行PowerShell脚本吗? - Can you run PowerShell scripts in VSCode against different framework versions? 如何从 powershell 运行 AutoIT 脚本 - How can I run AutoIT scripts from powershell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM