タグ
  Active Directory (51)
  ANSI (1)
  bash (1)
  BAT (14)
  bind (1)
  CentOS (3)
  CSharp (1)
  C言語 (4)
  DNS (3)
  Excel (1)
  Fedora (4)
  FreeBSD (3)
  iSCSI (1)
  Java (11)
  JavaScript (6)
  Link (4)
  Linux (15)
  Mail (1)
  Microsoft (4)
  NIS (1)
  OpenLDAP (2)
  OpenSolaris (4)
  PHP (2)
  PostgreSQL (2)
  PowerShell (33)
  RFC (3)
  Solaris (10)
  SQL Server (1)
  Ubuntu (3)
  VBScript (65)
  Visual Basic (1)
  VMware (2)
  Windows (14)
  WMI (16)
  WSF (5)
  WSH (10)
  作成中 (5)
  慣用句 (1)
  正規表現 (6)
PowerShell でオブジェクトの調査
はじめて使用するオブジェクトが何者なのか、どんな機能があるのか手っ取り早く調べる方法について
型を調べる
$obj.GetType()
プロパティ、メソッドを調べる
$obj | Get-Member
$obj.PSBase | Get-Member
プログラム、コマンドレットの検索
Get-Command コマンド名
プログラム、コマンドレットの曖昧検索
regexp は正規表現が使用できる。文字列はダブルクォートで囲む必要がある。
Get-Command | Where-Object { $_ -match regexp }
gcm | ? { $_ -match regexp }
囲まなかったらコマンドとして評価され、以下のエラーが表示される。
'-match' 演算子の右側に値の式を指定する必要があります。
発生場所 行:1 文字:39
+ get-command | where-object { $_ -match <<<<  nanikatekitouni }
    + CategoryInfo          : ParserError: (:) []、ParentContainsErrorRecordException
    + FullyQualifiedErrorId : ExpectedValueExpression
ヘルプの閲覧
Get-Help コマンド名
Get-Help コマンド名 -examples
Get-Help コマンド名 -detailed
Get-Help コマンド名 -full
タグ: PowerShell
[リロード] [記事修正] [新規作成] [使用方法]
©2004-2010 UPKEN