[英]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执行策略下运行该脚本,而无需支付证书费用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.