powershell(2)

帮助系统(显示出来的参数语法要比Unix中help复杂)

  1. save-help -destinationpath c:\help
  2. update-help -force -sourcepath c:\help
  3. get-command -noun *log* -verb get -commandtype cmdlet|all|application
  4. [-arg] 为位置参数, 必须写在特定的位置
  5. [[-arg]] 可选又位置, 可以不写, 但是写了就要在特定的位置
  6. -arg 不是位置参数, 一定要写, 但是对位置没有要求
  7. (get-content C:\demp.txt) ()中的优先级高, 强制限制性, 与Unix不同, Unix中是打开一个子shell执行
  8. 在每一个帮助信息中的参数都有[]选项, 可以通过get-help *common*, 结果返回一个about_commonparameter的帮助文档, 里面记录的那些是通用的选项
    • -verbose
    • -debug
    • -confirm
    • -whatif

注意

  • 在windows中为了统一filesystem, wsman, registry等, 通过交item, 文件和文件夹叫item

其他命令

  • out-file

    • -append
    • -width
    • -path
  • write-eventlog
  • write-output
  • convertTo-html
  • new-alias
    • export-alias
    • import-alias
  • show-command 图形显示, 并且可以执行命令
  • test-connection: ping
  • get-netfirewallrule
    • -direct inbound|outbound
  • get-psprovider|get-psdrive: 显示所有的提供程序, wsman, filesystem, register, alias, environment
  • get-childitem
    • new-item
    • remove-item
    • set-item
    • set-itemproperty: 设置属性, 一般配置get-itemproperty使用
    • get-item
      • -filter: 过滤掉指定的项
  • -literakpath: 不支持通配符
  • out-gridview: 将输入发送到图形界面上显示
  • export-cvs:
    • export-clixml

      • -delimiter
  • format-custom: 展开层级

实验(1)

  • get-process | sort-object -property vm -decending | select-obejct -index 0,1,2,3,4 消耗内存前五名
  • get-services | select-object -property name, status | sort-object -property status -descending | export-csv services.csv
  • set-service -name bits -startiuptype manual
  • get-history -id 5 | invoke-history
  • new-eventlog -logname game -source cs 添加应用日志

最新文章

  1. Object是什么
  2. Socket桥(转载)
  3. ORA-16179: incremental changes to "log_archive_dest_1" not allowed with SPFILE
  4. 慕课网-安卓工程师初养成-2-9 Java中的自动类型转换
  5. 事件对象event和计时器
  6. python - 回溯继承树 - 自己实现
  7. WinDbg调试DMP格式文件
  8. windows下载安装MariaDB5.5.32 绿色版
  9. PHP中用PDO方法打开连接关闭mysql数据库
  10. MAC地址格式小结
  11. Dlib Python 检测人脸特征点 Face Landmark Detection
  12. Bellman-Ford算法(在边权可正可负时求最短路)
  13. Mycat实现mysql主从复制(读写分离)
  14. jenkins 常见问题汇总
  15. Mysql SQL优化系列之——执行计划连接方式浅释
  16. sql培训
  17. python——简单爬虫
  18. docker部署nginx,并实现负载均衡。
  19. 单例模式在生产环境jedis集群中的应用
  20. 微服务架构eureka集群高可用配置

热门文章

  1. AutoResetEvent的使用介绍(用AutoResetEvent实现同步)
  2. c# 创建XML文档,解析XML文档
  3. docker网络模式----入门docker的难点
  4. 哈雷监控设备的操作及升级NSG9k6G
  5. Django之博客系统邮件分享博客
  6. 树形DP--求树上任意两点间距离和
  7. go语言实战教程之 后台管理页面统计功能开发(1)
  8. [51nod1239] 欧拉函数之和(杜教筛)
  9. windows mysql导入sql文件
  10. Mineweep(扫雷)