PowerShell版本1.0.0.0不支持新的-eventlog [英] New -eventlog not supported in powershell version 1.0.0.0

查看:91
本文介绍了PowerShell版本1.0.0.0不支持新的-eventlog的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

当我尝试使用powershell版本2时,下面的命令运行良好但在powershell版本1.0中同样不起作用

New-EventLog -LogName Application -Source applicationlog



我尝试过:



我正在尝试它将这条线操纵成另一种方式,以便它可以在两个powershell版本上运行,但我错过了我猜的东西。



get-EventLog -LogName Application -newest applicationlog---这个命令行失败并出现错误



就像任何人告诉我如何使用powershell版本1.0到达保存在应用程序文件夹中的文件应用程序日志

Hello guys,
Below command when i try on powershell version 2 works well but the same doesnt works in powershell version 1.0
New-EventLog -LogName Application -Source "applicationlog"

What I have tried:

I am trying it to maniplulate this line into another way so that it can run on both powershell versions but i am missing out something i guess.

get-EventLog -LogName Application -newest "applicationlog" --- this command line fails with an error

like can any one tell me how to reach to file applicationlog kept in application folder using powershell version 1.0

推荐答案

首先......错误消息通常非常有用。当你在任何论坛上询问有关你的问题的问题时,提供错误信息是一个好的(不,真的......这是强制性的)。



Anywho,你我在谈论两个完全不同的命令。 New-EventLog和Get-EventLog。对于后者,参数-Newest需要整数而不是字符串。 applicationlog是一个字符串。



最后,PowerShell 1 ..真的吗?什么,何地,何时,如何,为什么? :)
First of all... Error messages are often quite informational. Supplying that error message is a good (no, really... it's mandatory) idea when you're asking questions about your problem on any forum.

Anywho, you're talking about two completely different commands. New-EventLog and Get-EventLog. For the latter, the parameter -Newest expects an integer and not a string. "applicationlog" is a string.

And finally, PowerShell 1.. really? What, where, when, how, why? :)


PowerShell的新版本具有比以前更多的功能。

升级到上一个PowerShell!
New versions of PowerShell habe more features than previous ones.
Upgrade to last PowerShell !


这篇关于PowerShell版本1.0.0.0不支持新的-eventlog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆