windows8吧 关注:414,313贴子:9,115,086
  • 8回复贴,共1

使用Window8自带的PowerShell维护系统

只看楼主收藏回复

##允许所有脚本运行,必须以管理员身份执行
Set-ExecutionPolicy Unrestricted
##获取环境变量Get-ChildItem env:\ | convertto-html -property Name,Value > f:\env.htm
##获取运行的进程信息 get-process | sort-object WorkingSet64 | convertto-html -property ProcessName,PrivateMemorySize64,WorkingSet64,CPU,ID,Path > f:\process.html
##获取运行的服务,并显示可停止的服务
Get-Service | where-object {$_.Status -eq "Running"} | Sort-Object CanStop -Descending | ConvertTo-Html -Property Name,ServiceName,CanStop,Status > f:\service.html
##获取系统错误的事件日志
get-eventlog -LogName System -EntryType Error | ConvertTo-Html -Property EventID,EntryType,Message,TimeGenerated > f:\eventlog_System.html
##获取程序错误的事件日志
get-eventlog -LogName Application -EntryType Error | ConvertTo-Html -Property EventID,EntryType,Message,TimeGenerated > f:\eventlog_App.html
##清空事件日志 clear-eventlog -log application, system -confirm





1楼2013-01-20 08:50回复
    马克学习一下


    IP属地:江苏来自手机贴吧2楼2013-01-20 09:08
    回复
      2026-09-08 05:11:55
      广告
      不感兴趣
      开通SVIP免广告
      没用过,Mark一下


      3楼2013-01-20 09:36
      回复
        干嘛用的?


        来自手机贴吧4楼2013-01-20 09:39
        收起回复
          好专业
          ——来自 Windows Phone 客户端(爱贴吧)


          IP属地:重庆来自WindowsPhone客户端7楼2013-01-20 16:33
          回复