简体   繁体   English

PowerShell脚本打包和WinNT执行?

[英]PowerShell script packaging and WinNT execution?

Is there any free software to package a powershell script into a standalone WIN32 executable?是否有任何免费软件可以将 package 和 powershell 脚本转换为独立的 WIN32 可执行文件?

It seems it was possible to get the powershell beta's to run on win2000 and winNT, is there any known way to get the final powershell to run on it?似乎有可能让 powershell 测试版在 win2000 和 winNT 上运行,有没有已知的方法可以让最终的 powershell 在其上运行?

I don't think there is any software that will package a PowerShell script into a stand-alone executable.我认为没有任何软件可以将 package 和 PowerShell 脚本转换为独立的可执行文件。 That would require bundling PowerShell itself with the script (no small feat).这需要将 PowerShell 本身与脚本捆绑在一起(不小的壮举)。

The oldest supported OS is Windows XP SP2, so there is not a supported way to get PowerShell to run on NT or 2000.受支持的最旧操作系统是 Windows XP SP2,因此没有一种受支持的方法可以让 PowerShell 在 NT 或 2000 上运行。

A easy step would be to create a .NET exe which embedded the script.一个简单的步骤是创建一个嵌入脚本的 .NET exe。

This would, of course, require PSH (and any non-standard snapins) installed when executed.当然,这需要在执行时安装 PSH(和任何非标准管理单元)。

To remove those dependencies you would need to be able to handle any cmdlets used, as noted @aphoria this would be reinventing PSH, and all the snapins.要删除这些依赖项,您需要能够处理使用的任何 cmdlet,如 @aphoria 所述,这将重新发明 PSH 和所有管理单元。

Not strictly the answer you are looking for (free software), but it may be useful to others.严格来说不是您正在寻找的答案(免费软件),但它可能对其他人有用。 Here are some commercial options for packaging scripts into single executables:以下是将脚本打包成单个可执行文件的一些商业选项:

Admin Script Editor管理脚本编辑器

PrimalScript OR PrimalPackager (just packaging portion of PrimalScript) PrimalScript OR PrimalPackager (只是 PrimalScript 的打包部分)

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM