powershell - 为 Windows 7 开发的 PowerShell 脚本能否在 Win Server 2008 R2 上运行?

标签 powershell windows-7 windows-server-2008-r2

我开发了一个大型 PowerShell 脚本,该脚本已在 Windows 7 64 位机器上进行了改进,现在我打算在 Windows Server 2008 r2 上运行它。假设 PowerShell 版本相同,Win 7 和 WS 2008 R2 之间的语法是否会存在重大问题?

该脚本检查大量 WMI 和注册表项,例如 GWmi Win32_NetworkLoginProfileGet-Itemproperty -Path Registry::HKLM\Software\Microsoft\"Windows NT"\CurrentVersion\winlogon\

大多数 PowerShell 信息都是关于管理服务器的,所以我想我会很安全,但我想看看你们是否能在我开始撞墙之前帮助我吸取一些教训。 谢谢

最佳答案

Windows 7 上的 PowerShell 和 Windows Server 2008 R2 上的 PowerShell 之间没有语法差异。不过,您可能会遇到现有服务、WMI 类和注册表项的差异。

关于powershell - 为 Windows 7 开发的 PowerShell 脚本能否在 Win Server 2008 R2 上运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34323977/

相关文章:

c# - mscorwks.dll出现异常代码c0000005的原因及解决方法是什么?

powershell - 使用 powershell 命令获取磁盘使用情况

list - Powershell 列出串行端口 + 说明

java - System.out 字符编码

video - Windows Media Foundation 使用 IMFTransform 将 mp4 电影帧解码为 2D 纹理

mysql - 没有可用的缓冲区空间(达到最大连接数?

Php exec Powershell 脚本 Azure AZ 命令不运行,所有其他功能都运行

powershell - 如何使用Powershell在CSV中导出文件属性

css - Chrome 中 @font-face 的可怕渲染

azure - Windows 2008 R2 SP1 核心上的服务总线 1.1 安装失败