我认为无论您使用什么操作系统,如果您安装了 Powershell,您都可以访问相同的默认 cmdlet。
所以我想在我的 Windows 7 机器上使用Get-ScheduledTask 。我安装了 Powershell 4。但是,当我运行它时,我得到了错误:
Get-ScheduledTask : The term 'Get-ScheduledTask' is not recognized as the name
of a cmdlet, function, script file, or operable program. Check the spelling of
the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Get-ScheduledTask
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-ScheduledTask:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
如果我在我的 Windows 8.1 上运行,并且已经与操作系统一起预装了 Powershell 4,它就可以工作。
我可以在我的 Windows 7 机器上获取 cmdlet 吗?Microsoft Get-ScheduledTask 页面上没有关于 Windows 7 的内容,所以我猜不是。
如果不是,那么是否是使用命令行的情况:
毫无疑问,有人会指出我这个问题,但那是针对 Powershell 2 的。我在 Powershell 4 上。
现在我非常喜欢不重新发明轮子,但是这些家伙的脚本看起来是一个不错的选择。