参考
ざっくり PowerShell ざっくり解説シリーズ
分かりやすくてGood!
考え方ポイント
- PowerShellはオブジェクトを操作してオブジェクトを返す
- PowerShellはオブジェクトを扱うので、結果として得られるオブジェクトのクラスを確認し、そのプロパティやメソッドを使って必要とするオブジェクトを造っていくことが肝
- オブジェクトの内容は" | get-member"でメソッド・プロパティが確認可能
操作ポイント
カーソル移動
- HOMEキーで先頭、ENDキーで末尾へ移動。CTRLキー同時押下でクリア。
- CTRL + 左右キーで単語単位で移動
クリア
- ESCで入力内容を全クリア
入力保管
- CTRL + スペースで候補選択 or 一覧出力 ※コマンドだけでなくオプションも。
履歴
- F8、Shift + F8
コマンドポイント
- リダイレクトは従来通り使える
- catはget-content
- grepはselect-stringかwhere-object
select-string ファイル名 -Pattern "XXXXXX"
grepのようにパイプでは受けられない
| where-object {$_.Name -match "XXXXXX"}
- wcはmeasure-objectで-character、-line、-wordで出せる。
- diffはcompare-object
compare-object (get-content ファイル名1) (get-content ファイル名2)
- head、tailはget-content
get-content ファイル名 -Head/Tail 行数
プロファイル
変数$PROFILEのパスにスクリプト(.ps1)配置すると、PowerShell起動時に読み込まれる。
変数
- 環境編集、シェル変数、一般変数の3種類あり。
- シェル変数は、自動変数とユーザー定義変数があり。
- シェル変数として以下があり。※一部のみ記載。他は参考書籍を参照)
変数 | 説明 |
---|---|
$_ | 現在のパイプラインオブジェクト |
$Args | 関数/スクリプトのパラメータ配列 |
$? | 実行結果。成功True、失敗false |
$Error | 発生したエラーオブジェクト |
ヘルプ
- get-helpでヘルプ出力
- 以下オプションあり。
-Name トピック名
-Full 完全ヘルプ
-Detailed 使用例なども表示
-Examples 使用例のみ表示
-Online ブラウザ表示
-ShowWindow ウィンドウで表示
grepのように使いたい時
コマンド | out-string -stream | select-string "パラーン"
grep -v はselect-stringに-nomatchオプション付ける。
オブジェクトを調べる場合
gettype()メソッド
> (1,2).gettype() IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True Object[] System.Array
get-memberコマンドレット
> (1,"2") | Get-Member TypeName: System.Int32 Name MemberType Definition ---- ---------- ---------- CompareTo Method int CompareTo(System.Object value), int CompareTo(int value), int IComparable.CompareTo(Syst... Equals Method bool Equals(System.Object obj), bool Equals(int obj), bool IEquatable[int].Equals(int other) GetHashCode Method int GetHashCode() GetType Method type GetType() GetTypeCode Method System.TypeCode GetTypeCode(), System.TypeCode IConvertible.GetTypeCode() ToBoolean Method bool IConvertible.ToBoolean(System.IFormatProvider provider) ToByte Method byte IConvertible.ToByte(System.IFormatProvider provider) ToChar Method char IConvertible.ToChar(System.IFormatProvider provider) ToDateTime Method datetime IConvertible.ToDateTime(System.IFormatProvider provider) ToDecimal Method decimal IConvertible.ToDecimal(System.IFormatProvider provider) ToDouble Method double IConvertible.ToDouble(System.IFormatProvider provider) ToInt16 Method int16 IConvertible.ToInt16(System.IFormatProvider provider) ToInt32 Method int IConvertible.ToInt32(System.IFormatProvider provider) ToInt64 Method long IConvertible.ToInt64(System.IFormatProvider provider) ToSByte Method sbyte IConvertible.ToSByte(System.IFormatProvider provider) ToSingle Method float IConvertible.ToSingle(System.IFormatProvider provider) ToString Method string ToString(), string ToString(string format), string ToString(System.IFormatProvider pr... ToType Method System.Object IConvertible.ToType(type conversionType, System.IFormatProvider provider) ToUInt16 Method uint16 IConvertible.ToUInt16(System.IFormatProvider provider) ToUInt32 Method uint32 IConvertible.ToUInt32(System.IFormatProvider provider) ToUInt64 Method uint64 IConvertible.ToUInt64(System.IFormatProvider provider) TypeName: System.String Name MemberType Definition ---- ---------- ---------- Clone Method System.Object Clone(), System.Object ICloneable.Clone() CompareTo Method int CompareTo(System.Object value), int CompareTo(string strB), int ICompara... Contains Method bool Contains(string value) CopyTo Method void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int c... EndsWith Method bool EndsWith(string value), bool EndsWith(string value, System.StringCompar... Equals Method bool Equals(System.Object obj), bool Equals(string value), bool Equals(strin... GetEnumerator Method System.CharEnumerator GetEnumerator(), System.Collections.IEnumerator IEnume... GetHashCode Method int GetHashCode() GetType Method type GetType() GetTypeCode Method System.TypeCode GetTypeCode(), System.TypeCode IConvertible.GetTypeCode() IndexOf Method int IndexOf(char value), int IndexOf(char value, int startIndex), int IndexO... IndexOfAny Method int IndexOfAny(char[] anyOf), int IndexOfAny(char[] anyOf, int startIndex), ... Insert Method string Insert(int startIndex, string value) IsNormalized Method bool IsNormalized(), bool IsNormalized(System.Text.NormalizationForm normali... LastIndexOf Method int LastIndexOf(char value), int LastIndexOf(char value, int startIndex), in... LastIndexOfAny Method int LastIndexOfAny(char[] anyOf), int LastIndexOfAny(char[] anyOf, int start... Normalize Method string Normalize(), string Normalize(System.Text.NormalizationForm normaliza... PadLeft Method string PadLeft(int totalWidth), string PadLeft(int totalWidth, char paddingC... PadRight Method string PadRight(int totalWidth), string PadRight(int totalWidth, char paddin... Remove Method string Remove(int startIndex, int count), string Remove(int startIndex) Replace Method string Replace(char oldChar, char newChar), string Replace(string oldValue, ... Split Method string[] Split(Params char[] separator), string[] Split(char[] separator, in... StartsWith Method bool StartsWith(string value), bool StartsWith(string value, System.StringCo... Substring Method string Substring(int startIndex), string Substring(int startIndex, int length) ToBoolean Method bool IConvertible.ToBoolean(System.IFormatProvider provider) ToByte Method byte IConvertible.ToByte(System.IFormatProvider provider) ToChar Method char IConvertible.ToChar(System.IFormatProvider provider) ToCharArray Method char[] ToCharArray(), char[] ToCharArray(int startIndex, int length) ToDateTime Method datetime IConvertible.ToDateTime(System.IFormatProvider provider) ToDecimal Method decimal IConvertible.ToDecimal(System.IFormatProvider provider) ToDouble Method double IConvertible.ToDouble(System.IFormatProvider provider) ToInt16 Method int16 IConvertible.ToInt16(System.IFormatProvider provider) ToInt32 Method int IConvertible.ToInt32(System.IFormatProvider provider) ToInt64 Method long IConvertible.ToInt64(System.IFormatProvider provider) ToLower Method string ToLower(), string ToLower(cultureinfo culture) ToLowerInvariant Method string ToLowerInvariant() ToSByte Method sbyte IConvertible.ToSByte(System.IFormatProvider provider) ToSingle Method float IConvertible.ToSingle(System.IFormatProvider provider) ToString Method string ToString(), string ToString(System.IFormatProvider provider), string ... ToType Method System.Object IConvertible.ToType(type conversionType, System.IFormatProvide... ToUInt16 Method uint16 IConvertible.ToUInt16(System.IFormatProvider provider) ToUInt32 Method uint32 IConvertible.ToUInt32(System.IFormatProvider provider) ToUInt64 Method uint64 IConvertible.ToUInt64(System.IFormatProvider provider) ToUpper Method string ToUpper(), string ToUpper(cultureinfo culture) ToUpperInvariant Method string ToUpperInvariant() Trim Method string Trim(Params char[] trimChars), string Trim() TrimEnd Method string TrimEnd(Params char[] trimChars) TrimStart Method string TrimStart(Params char[] trimChars) Chars ParameterizedProperty char Chars(int index) {get;} Length Property int Length {get;}
get-contentの出力オブジェクトを調べる
PS > Get-Content .\a.txt h1,h2,h3 a,b,c e,f,g
出力オブジェクトは配列
PS > (Get-Content .\a.txt).gettype() IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True Object[] System.Array
※「Object[]」は配列
配列の要素のオブジェクトタイプは文字列型
PS > Get-Content .\a.txt | ForEach-Object {$_.gettype()} IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True String System.Object True True String System.Object True True String System.Object
get-memberにパイプすると、要素のメンバーを出力する。全ての要素が文字列型なので、文字列型のメンバーを出力している。
PS > Get-Content .\a.txt | Get-Member TypeName: System.String Name MemberType Definition ---- ---------- ---------- Clone Method System.Object Clone(), System.Object ICloneable.Clone() CompareTo Method int CompareTo(System.Object value), int CompareTo(string strB), int IComparab... Contains Method bool Contains(string value) CopyTo Method void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int co... EndsWith Method bool EndsWith(string value), bool EndsWith(string value, System.StringCompari... Equals Method bool Equals(System.Object obj), bool Equals(string value), bool Equals(string... GetEnumerator Method System.CharEnumerator GetEnumerator(), System.Collections.IEnumerator IEnumer... GetHashCode Method int GetHashCode() GetType Method type GetType() GetTypeCode Method System.TypeCode GetTypeCode(), System.TypeCode IConvertible.GetTypeCode() IndexOf Method int IndexOf(char value), int IndexOf(char value, int startIndex), int IndexOf... IndexOfAny Method int IndexOfAny(char[] anyOf), int IndexOfAny(char[] anyOf, int startIndex), i... Insert Method string Insert(int startIndex, string value) IsNormalized Method bool IsNormalized(), bool IsNormalized(System.Text.NormalizationForm normaliz... LastIndexOf Method int LastIndexOf(char value), int LastIndexOf(char value, int startIndex), int... LastIndexOfAny Method int LastIndexOfAny(char[] anyOf), int LastIndexOfAny(char[] anyOf, int startI... Normalize Method string Normalize(), string Normalize(System.Text.NormalizationForm normalizat... PadLeft Method string PadLeft(int totalWidth), string PadLeft(int totalWidth, char paddingChar) PadRight Method string PadRight(int totalWidth), string PadRight(int totalWidth, char padding... Remove Method string Remove(int startIndex, int count), string Remove(int startIndex) Replace Method string Replace(char oldChar, char newChar), string Replace(string oldValue, s... Split Method string[] Split(Params char[] separator), string[] Split(char[] separator, int... StartsWith Method bool StartsWith(string value), bool StartsWith(string value, System.StringCom... Substring Method string Substring(int startIndex), string Substring(int startIndex, int length) ToBoolean Method bool IConvertible.ToBoolean(System.IFormatProvider provider) ToByte Method byte IConvertible.ToByte(System.IFormatProvider provider) ToChar Method char IConvertible.ToChar(System.IFormatProvider provider) ToCharArray Method char[] ToCharArray(), char[] ToCharArray(int startIndex, int length) ToDateTime Method datetime IConvertible.ToDateTime(System.IFormatProvider provider) ToDecimal Method decimal IConvertible.ToDecimal(System.IFormatProvider provider) ToDouble Method double IConvertible.ToDouble(System.IFormatProvider provider) ToInt16 Method int16 IConvertible.ToInt16(System.IFormatProvider provider) ToInt32 Method int IConvertible.ToInt32(System.IFormatProvider provider) ToInt64 Method long IConvertible.ToInt64(System.IFormatProvider provider) ToLower Method string ToLower(), string ToLower(cultureinfo culture) ToLowerInvariant Method string ToLowerInvariant() ToSByte Method sbyte IConvertible.ToSByte(System.IFormatProvider provider) ToSingle Method float IConvertible.ToSingle(System.IFormatProvider provider) ToString Method string ToString(), string ToString(System.IFormatProvider provider), string I... ToType Method System.Object IConvertible.ToType(type conversionType, System.IFormatProvider... ToUInt16 Method uint16 IConvertible.ToUInt16(System.IFormatProvider provider) ToUInt32 Method uint32 IConvertible.ToUInt32(System.IFormatProvider provider) ToUInt64 Method uint64 IConvertible.ToUInt64(System.IFormatProvider provider) ToUpper Method string ToUpper(), string ToUpper(cultureinfo culture) ToUpperInvariant Method string ToUpperInvariant() Trim Method string Trim(Params char[] trimChars), string Trim() TrimEnd Method string TrimEnd(Params char[] trimChars) TrimStart Method string TrimStart(Params char[] trimChars) PSChildName NoteProperty string PSChildName=a.txt PSDrive NoteProperty PSDriveInfo PSDrive=C PSParentPath NoteProperty string PSParentPath= PSPath NoteProperty string PSPath=\a.txt PSProvider NoteProperty ProviderInfo PSProvider=Microsoft.PowerShell.Core\FileSystem ReadCount NoteProperty long ReadCount=1 Chars ParameterizedProperty char Chars(int index) {get;} Length Property int Length {get;}
要素の一個づつにget-member実行すると、ヘッダは1行だが、要素ごとにget-memberが実行されていることが分かる。
PS > Get-Content .\a.txt | ForEach-Object {$_ | Get-Member} TypeName: System.String Name MemberType Definition ---- ---------- ---------- Clone Method System.Object Clone(), System.Object ICloneable.Clone() CompareTo Method int CompareTo(System.Object value), int CompareTo(string strB), int IComparab... Contains Method bool Contains(string value) CopyTo Method void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int co... EndsWith Method bool EndsWith(string value), bool EndsWith(string value, System.StringCompari... Equals Method bool Equals(System.Object obj), bool Equals(string value), bool Equals(string... GetEnumerator Method System.CharEnumerator GetEnumerator(), System.Collections.IEnumerator IEnumer... GetHashCode Method int GetHashCode() GetType Method type GetType() GetTypeCode Method System.TypeCode GetTypeCode(), System.TypeCode IConvertible.GetTypeCode() IndexOf Method int IndexOf(char value), int IndexOf(char value, int startIndex), int IndexOf... IndexOfAny Method int IndexOfAny(char[] anyOf), int IndexOfAny(char[] anyOf, int startIndex), i... Insert Method string Insert(int startIndex, string value) IsNormalized Method bool IsNormalized(), bool IsNormalized(System.Text.NormalizationForm normaliz... LastIndexOf Method int LastIndexOf(char value), int LastIndexOf(char value, int startIndex), int... LastIndexOfAny Method int LastIndexOfAny(char[] anyOf), int LastIndexOfAny(char[] anyOf, int startI... Normalize Method string Normalize(), string Normalize(System.Text.NormalizationForm normalizat... PadLeft Method string PadLeft(int totalWidth), string PadLeft(int totalWidth, char paddingChar) PadRight Method string PadRight(int totalWidth), string PadRight(int totalWidth, char padding... Remove Method string Remove(int startIndex, int count), string Remove(int startIndex) Replace Method string Replace(char oldChar, char newChar), string Replace(string oldValue, s... Split Method string[] Split(Params char[] separator), string[] Split(char[] separator, int... StartsWith Method bool StartsWith(string value), bool StartsWith(string value, System.StringCom... Substring Method string Substring(int startIndex), string Substring(int startIndex, int length) ToBoolean Method bool IConvertible.ToBoolean(System.IFormatProvider provider) ToByte Method byte IConvertible.ToByte(System.IFormatProvider provider) ToChar Method char IConvertible.ToChar(System.IFormatProvider provider) ToCharArray Method char[] ToCharArray(), char[] ToCharArray(int startIndex, int length) ToDateTime Method datetime IConvertible.ToDateTime(System.IFormatProvider provider) ToDecimal Method decimal IConvertible.ToDecimal(System.IFormatProvider provider) ToDouble Method double IConvertible.ToDouble(System.IFormatProvider provider) ToInt16 Method int16 IConvertible.ToInt16(System.IFormatProvider provider) ToInt32 Method int IConvertible.ToInt32(System.IFormatProvider provider) ToInt64 Method long IConvertible.ToInt64(System.IFormatProvider provider) ToLower Method string ToLower(), string ToLower(cultureinfo culture) ToLowerInvariant Method string ToLowerInvariant() ToSByte Method sbyte IConvertible.ToSByte(System.IFormatProvider provider) ToSingle Method float IConvertible.ToSingle(System.IFormatProvider provider) ToString Method string ToString(), string ToString(System.IFormatProvider provider), string I... ToType Method System.Object IConvertible.ToType(type conversionType, System.IFormatProvider... ToUInt16 Method uint16 IConvertible.ToUInt16(System.IFormatProvider provider) ToUInt32 Method uint32 IConvertible.ToUInt32(System.IFormatProvider provider) ToUInt64 Method uint64 IConvertible.ToUInt64(System.IFormatProvider provider) ToUpper Method string ToUpper(), string ToUpper(cultureinfo culture) ToUpperInvariant Method string ToUpperInvariant() Trim Method string Trim(Params char[] trimChars), string Trim() TrimEnd Method string TrimEnd(Params char[] trimChars) TrimStart Method string TrimStart(Params char[] trimChars) PSChildName NoteProperty string PSChildName=a.txt PSDrive NoteProperty PSDriveInfo PSDrive=C PSParentPath NoteProperty string PSParentPath= PSPath NoteProperty string PSPath=\a.txt PSProvider NoteProperty ProviderInfo PSProvider=Microsoft.PowerShell.Core\FileSystem ReadCount NoteProperty long ReadCount=1 Chars ParameterizedProperty char Chars(int index) {get;} Length Property int Length {get;} Clone Method System.Object Clone(), System.Object ICloneable.Clone() CompareTo Method int CompareTo(System.Object value), int CompareTo(string strB), int IComparab... Contains Method bool Contains(string value) CopyTo Method void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int co... EndsWith Method bool EndsWith(string value), bool EndsWith(string value, System.StringCompari... Equals Method bool Equals(System.Object obj), bool Equals(string value), bool Equals(string... GetEnumerator Method System.CharEnumerator GetEnumerator(), System.Collections.IEnumerator IEnumer... GetHashCode Method int GetHashCode() GetType Method type GetType() GetTypeCode Method System.TypeCode GetTypeCode(), System.TypeCode IConvertible.GetTypeCode() IndexOf Method int IndexOf(char value), int IndexOf(char value, int startIndex), int IndexOf... IndexOfAny Method int IndexOfAny(char[] anyOf), int IndexOfAny(char[] anyOf, int startIndex), i... Insert Method string Insert(int startIndex, string value) IsNormalized Method bool IsNormalized(), bool IsNormalized(System.Text.NormalizationForm normaliz... LastIndexOf Method int LastIndexOf(char value), int LastIndexOf(char value, int startIndex), int... LastIndexOfAny Method int LastIndexOfAny(char[] anyOf), int LastIndexOfAny(char[] anyOf, int startI... Normalize Method string Normalize(), string Normalize(System.Text.NormalizationForm normalizat... PadLeft Method string PadLeft(int totalWidth), string PadLeft(int totalWidth, char paddingChar) PadRight Method string PadRight(int totalWidth), string PadRight(int totalWidth, char padding... Remove Method string Remove(int startIndex, int count), string Remove(int startIndex) Replace Method string Replace(char oldChar, char newChar), string Replace(string oldValue, s... Split Method string[] Split(Params char[] separator), string[] Split(char[] separator, int... StartsWith Method bool StartsWith(string value), bool StartsWith(string value, System.StringCom... Substring Method string Substring(int startIndex), string Substring(int startIndex, int length) ToBoolean Method bool IConvertible.ToBoolean(System.IFormatProvider provider) ToByte Method byte IConvertible.ToByte(System.IFormatProvider provider) ToChar Method char IConvertible.ToChar(System.IFormatProvider provider) ToCharArray Method char[] ToCharArray(), char[] ToCharArray(int startIndex, int length) ToDateTime Method datetime IConvertible.ToDateTime(System.IFormatProvider provider) ToDecimal Method decimal IConvertible.ToDecimal(System.IFormatProvider provider) ToDouble Method double IConvertible.ToDouble(System.IFormatProvider provider) ToInt16 Method int16 IConvertible.ToInt16(System.IFormatProvider provider) ToInt32 Method int IConvertible.ToInt32(System.IFormatProvider provider) ToInt64 Method long IConvertible.ToInt64(System.IFormatProvider provider) ToLower Method string ToLower(), string ToLower(cultureinfo culture) ToLowerInvariant Method string ToLowerInvariant() ToSByte Method sbyte IConvertible.ToSByte(System.IFormatProvider provider) ToSingle Method float IConvertible.ToSingle(System.IFormatProvider provider) ToString Method string ToString(), string ToString(System.IFormatProvider provider), string I... ToType Method System.Object IConvertible.ToType(type conversionType, System.IFormatProvider... ToUInt16 Method uint16 IConvertible.ToUInt16(System.IFormatProvider provider) ToUInt32 Method uint32 IConvertible.ToUInt32(System.IFormatProvider provider) ToUInt64 Method uint64 IConvertible.ToUInt64(System.IFormatProvider provider) ToUpper Method string ToUpper(), string ToUpper(cultureinfo culture) ToUpperInvariant Method string ToUpperInvariant() Trim Method string Trim(Params char[] trimChars), string Trim() TrimEnd Method string TrimEnd(Params char[] trimChars) TrimStart Method string TrimStart(Params char[] trimChars) PSChildName NoteProperty string PSChildName=a.txt PSDrive NoteProperty PSDriveInfo PSDrive=C PSParentPath NoteProperty string PSParentPath= PSPath NoteProperty string PSPath=\a.txt PSProvider NoteProperty ProviderInfo PSProvider=Microsoft.PowerShell.Core\FileSystem ReadCount NoteProperty long ReadCount=2 Chars ParameterizedProperty char Chars(int index) {get;} Length Property int Length {get;} Clone Method System.Object Clone(), System.Object ICloneable.Clone() CompareTo Method int CompareTo(System.Object value), int CompareTo(string strB), int IComparab... Contains Method bool Contains(string value) CopyTo Method void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int co... EndsWith Method bool EndsWith(string value), bool EndsWith(string value, System.StringCompari... Equals Method bool Equals(System.Object obj), bool Equals(string value), bool Equals(string... GetEnumerator Method System.CharEnumerator GetEnumerator(), System.Collections.IEnumerator IEnumer... GetHashCode Method int GetHashCode() GetType Method type GetType() GetTypeCode Method System.TypeCode GetTypeCode(), System.TypeCode IConvertible.GetTypeCode() IndexOf Method int IndexOf(char value), int IndexOf(char value, int startIndex), int IndexOf... IndexOfAny Method int IndexOfAny(char[] anyOf), int IndexOfAny(char[] anyOf, int startIndex), i... Insert Method string Insert(int startIndex, string value) IsNormalized Method bool IsNormalized(), bool IsNormalized(System.Text.NormalizationForm normaliz... LastIndexOf Method int LastIndexOf(char value), int LastIndexOf(char value, int startIndex), int... LastIndexOfAny Method int LastIndexOfAny(char[] anyOf), int LastIndexOfAny(char[] anyOf, int startI... Normalize Method string Normalize(), string Normalize(System.Text.NormalizationForm normalizat... PadLeft Method string PadLeft(int totalWidth), string PadLeft(int totalWidth, char paddingChar) PadRight Method string PadRight(int totalWidth), string PadRight(int totalWidth, char padding... Remove Method string Remove(int startIndex, int count), string Remove(int startIndex) Replace Method string Replace(char oldChar, char newChar), string Replace(string oldValue, s... Split Method string[] Split(Params char[] separator), string[] Split(char[] separator, int... StartsWith Method bool StartsWith(string value), bool StartsWith(string value, System.StringCom... Substring Method string Substring(int startIndex), string Substring(int startIndex, int length) ToBoolean Method bool IConvertible.ToBoolean(System.IFormatProvider provider) ToByte Method byte IConvertible.ToByte(System.IFormatProvider provider) ToChar Method char IConvertible.ToChar(System.IFormatProvider provider) ToCharArray Method char[] ToCharArray(), char[] ToCharArray(int startIndex, int length) ToDateTime Method datetime IConvertible.ToDateTime(System.IFormatProvider provider) ToDecimal Method decimal IConvertible.ToDecimal(System.IFormatProvider provider) ToDouble Method double IConvertible.ToDouble(System.IFormatProvider provider) ToInt16 Method int16 IConvertible.ToInt16(System.IFormatProvider provider) ToInt32 Method int IConvertible.ToInt32(System.IFormatProvider provider) ToInt64 Method long IConvertible.ToInt64(System.IFormatProvider provider) ToLower Method string ToLower(), string ToLower(cultureinfo culture) ToLowerInvariant Method string ToLowerInvariant() ToSByte Method sbyte IConvertible.ToSByte(System.IFormatProvider provider) ToSingle Method float IConvertible.ToSingle(System.IFormatProvider provider) ToString Method string ToString(), string ToString(System.IFormatProvider provider), string I... ToType Method System.Object IConvertible.ToType(type conversionType, System.IFormatProvider... ToUInt16 Method uint16 IConvertible.ToUInt16(System.IFormatProvider provider) ToUInt32 Method uint32 IConvertible.ToUInt32(System.IFormatProvider provider) ToUInt64 Method uint64 IConvertible.ToUInt64(System.IFormatProvider provider) ToUpper Method string ToUpper(), string ToUpper(cultureinfo culture) ToUpperInvariant Method string ToUpperInvariant() Trim Method string Trim(Params char[] trimChars), string Trim() TrimEnd Method string TrimEnd(Params char[] trimChars) TrimStart Method string TrimStart(Params char[] trimChars) PSChildName NoteProperty string PSChildName=a.txt PSDrive NoteProperty PSDriveInfo PSDrive=C PSParentPath NoteProperty string PSParentPath= PSPath NoteProperty string PSPath=\a.txt PSProvider NoteProperty ProviderInfo PSProvider=Microsoft.PowerShell.Core\FileSystem ReadCount NoteProperty long ReadCount=3 Chars ParameterizedProperty char Chars(int index) {get;} Length Property int Length {get;}