BigSea'Blog

身体下地狱,眼睛上天堂,心灵回故乡。走在路上,那是痛苦的幸福;走过之后,是幸福的痛苦。

powershell速查和实战手册

2 Comments | 安全技术 | by bigsea | 3741 Views. | 2008, November 13, 10:34 AM

最近在学习powershell2,在查找命令和帮助的很麻烦,外事不决问google,感谢六翼刺猬提供批处理,找了一份html版的速查手册和powershell实战手册,希望对大家有用...


@echo off
echo.=======================================
echo......构造htm文件中,可能需要几分钟.....
echo.=======================================

echo ^<head^> >PowerShell命令速查手册.htm
echo ^<title^>PowerShell命令速查手册^</title^>    >>PowerShell命令速查手册.htm
echo ^<meta http-equiv="Content-Type" content="text/html^; charset=gb2312" ^/^>    >>PowerShell命令速查手册.htm
echo ^</head^>    >>PowerShell命令速查手册.htm
echo ^<A NAME="Top"^>    >>PowerShell命令速查手册.htm
echo ^<center^>    >>PowerShell命令速查手册.htm
echo ^<h1^>PowerShell命令速查手册^</h1^>??Written by ^<a href="
http://hi.baidu.com/dikex"^>dikex^</a^> >>PowerShell命令速查手册.htm
echo ^</center^>    >>PowerShell命令速查手册.htm
echo ^<br^>    >>PowerShell命令速查手册.htm

mode con cols=250 lines=40
echo.=======================================
echo......构造htm文件中,可能需要几分钟.....
echo.=======================================  

for /f "skip=3 tokens=1,2*" %%i in ('powershell -command "& {get-help *}"') do (
     if /i "%%j"=="Alias" (echo ^<a href="#%%k"^>%%i^</a^>??%%j??%%k >>PowerShell命令速查手册.htm) else (echo ^<a href="#%%i"^>%%i^</a^>??%%j??%%k >>PowerShell命令速查手册.htm)
     echo ^</br^> >>PowerShell命令速查手册.htm
)

mode con cols=140 lines=25
echo.=======================================
echo......构造htm文件中,可能需要几分钟.....
echo.=======================================

for /f "skip=3 tokens=1,2" %%i in ('powershell -command "& {get-help * | format-table name,Category}"') do (
     if /i not "%%j"=="Alias" (
        echo ^<a name="%%i"^> >>PowerShell命令速查手册.htm
        echo ^<h2^>%%i^</h2^> >>PowerShell命令速查手册.htm
        echo ^<xmp^> >>PowerShell命令速查手册.htm
        powershell -command "& {get-help %%i -full}" >>PowerShell命令速查手册.htm
        echo ^</xmp^> >>PowerShell命令速查手册.htm
        echo ^<a href="#top"^>返回页首^</a^> >>PowerShell命令速查手册.htm
     )
)

goto :EOF


上一篇: 由于执行权限导致PowerShell Script无法启动-ZT
下一篇: Postfix配置文件main.cf中常用参数介绍

访客评论

  1. #1 羽毛球场地 2009, March 20, 2:47 PM
    我只知道蜘蛛或者Robot的抓取。
  2. #2 离心机 2009, September 9, 5:17 PM
    Robot的抓取