【发布时间】:2015-04-01 19:28:58
【问题描述】:
当我在 powershell 上一一运行以下命令时,我得到了预期的结果。但是,当我将它作为 PS 脚本运行时,我没有得到任何输出。
$StartDate = Get-Date
Write-EventLog -LogName Application -Source "MsiInstaller" -EventId 11707 -Message "Product: Installation operation completed successfully."
Get-EventLog Application -After "$StartDate" -Source "MsiInstaller"
缺少什么?
【问题讨论】:
-
是否允许powershell执行脚本? (试试
get-executionPolicy)
标签: powershell