简体   繁体   English

除了.NET框架之外,在服务器上运行本机Powershell脚本还需要什么?

[英]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.

相关问题 是否需要安装.NET Framework? - Is installing .NET Framework needed? SignalR Server是否可以在.NET Compact Framework上运行? - Does SignalR Server run on .NET Compact Framework? 在.Net 4框架中编译的应用程序将无法在Server 2012上运行 - Application compiled in .Net 4 framework will not run on Server 2012 Unable to run powershell script in IIS hosted .net web api project - Unable to run powershell script in IIS hosted .net web api project 有关如何运行 PowerShell 脚本以在 Exchange 服务器上创建邮箱的说明 - Direction on how to run PowerShell script to create email box on Exchange server 如何在.NET Core 1.0中使用Entity Framework运行sql脚本? - How to run sql script with Entity Framework in .NET Core 1.0? 如何使用通过 a.Net PowerShell object 运行的 PowerShell 脚本获取 windows 注册表属性值? - How do I get windows registry property values using a PowerShell script run through a .Net PowerShell object? 需要 ASP.Net Smple function,脚本调用任何东西,以在所有 cpu 内核上生成服务器负载 - need ASP .Net Smple function, script call anything, to generate load on server on all cpu cores 使用WIX安装程序安装.NET Framework 4.7.2(如果需要) - Install .NET Framework 4.7.2 (if needed) with WIX installer 为C#/ VB.net应用程序制作纯本机Exe [不需要.net框架来运行Exe] - Make pure native Exe for C#/VB.net Application [No need .net framework to run Exe]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM