[英]Anything needed beside .NET framework to run a native powershell script on a server?
I have written a PS script and I want to run the PS script on set of servers (Windows servers 2008/2003). 我已经编写了PS脚本,并且想在一组服务器(Windows服务器2008/2003)上运行PS脚本。 However, I have been told that, in Addition to the .Net framework, the servers needs some PowerShell-specific files and configuration to be able to run the script.
但是,有人告诉我,除了.Net框架之外,服务器还需要一些特定于PowerShell的文件和配置才能运行脚本。
Please consider the following : 请考虑以下几点 :
-Only native api was used in the script with no module or extrnal library reference: Get-Date, Get-ChildItem, Get-Service, Get-Content, [Environment]::ExpandEnvironmentVariables($XYZ) .. etc -脚本中仅使用本机api,没有模块或外部库引用:Get-Date,Get-ChildItem,Get-Service,Get-Content,[Environment] :: ExpandEnvironmentVariables($ XYZ)等。
-Do I need to install Windows Management Framework on each and every server in order to run PowerShell? -是否需要在每台服务器上安装Windows Management Framework才能运行PowerShell?
-What if the PS script was called from a C# Console application? -如果从C#控制台应用程序调用了PS脚本怎么办? Anything will be needed beside the .Net frame work?
.Net框架之外还需要什么?
Thank you 谢谢
Powershell is ebabled by default on Windows server 2008 R2, on 2008 PowerShell v1 is a feature to be enabled and v2 is a download. 默认情况下,Powershell在Windows Server 2008 R2上可用,在Windows PowerShell 2008中,PowerShell v1是要启用的功能,而v2是下载。 On 2003 both v1 and v2 are a separate download.
在2003年,v1和v2都是单独下载的。
It doesn't matter what calls the script it will still be executed by PowerShell. 无论调用什么脚本,PowerShell仍将执行该脚本。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.