zoukankan      html  css  js  c++  java
  • PowerShell常用的属性

    get-location | get-member  -membertype  property

    -------获取对象的属性----------

    获取对象特定的成员, 湖区.Net Framwork 的原始属性和方法


    PS C:Usersvol_20120330> get-location | get-member -view base


    TypeName: System.Management.Automation.PathInfo

    Name MemberType Definition
    ---- ---------- ----------
    Equals Method bool Equals(System.Object obj)
    GetHashCode Method int GetHashCode()
    GetType Method type GetType()
    ToString Method string ToString()
    Drive Property System.Management.Automation.PSDriveInfo Drive {get;}
    Path Property System.String Path {get;}
    Provider Property System.Management.Automation.ProviderInfo Provider {...
    ProviderPath Property System.String ProviderPath {get;}

    格式化输出

      前面的文章中提到过部分关于格式化的内容,这里进一步进行介绍。

      PS支持4个格式化cmdlet:  format-wide、 format-list、format-table、format-custom; 这里仅介绍前面三个。

      四个命令均需要管道输出对象作为输入;四个cmdlet均有默认的输出属性,如果不进行指定,则输出默认的属性。

    3、1  format-wide  

      格式化命令默认输出不同数量的属性,format-wide默认仅输出一个默认属性。

    Exp:


    PS C:Usersvol_20120330> get-command | format-wide

  • 相关阅读:
    开始学习C#
    关于串口数据读取的几个问题
    Joel测试
    VC查找内存泄漏技巧【转】
    思考题一
    自我介绍
    2020面向对象程序设计寒假作业1 题解
    思考题二
    题解 洛谷P2158 【[SDOI2008]仪仗队】
    深入浅出InfoPath系列
  • 原文地址:https://www.cnblogs.com/micro-chen/p/5775830.html
Copyright © 2011-2022 走看看