PowerShell为什么强大

  1. [容量]  3GB > 3145726KB吗  ?
    1
    2
    PS> 3gb  -gt 3145726kb
    True
  2. [ID]能产生一个GUID吗?
    1
    2
    3
    4
    5
    PS>  [guid] ::NewGuid()
     
    Guid
    ----
    0f283ab4-f402-400c-98ce-359442f11f1a
  3. [文件] Windows目录下所有可执行文件exe的大小是多少?
    1
    dir  $env:windir -Filter *.exe | measure -Sum Length
  4. [注册表]  注册表路径HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework 下  ‘Enable64Bit’的值是多少?
    1
    ( Get-ItemProperty -Path hklm:SOFTWARE\Microsoft\.NETFramework ).Enable64Bit
  5. [证书]  指纹为[28DE15612AFF1CD69596AB17AF06AE86CB9C003B]的证书在证书存储区吗?
    1
    2
    ls Cert:\LocalMachine\My\ |
      where {  $_ .Thumbprint  -eq '28DE15612AFF1CD69596AB17AF06AE86CB9C003B' }
  6. [服务]  打印机服务有没有启动呢?
    1
    Get-Service spooler
  7. [进程]  当前运行了多少个IE进程?
    1
    ( Get-Process iexplore ).count
  8. [报表]  将所有运行的进程信息导出为HTML报表?
    1
    Get-Process ConvertTo-Html Out-File a.html

猜你喜欢

转载自www.cnblogs.com/zhoading/p/9287089.html