株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

trueという文字列を代入

$a = "true"
$a.GetType()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     String                                   System.
                                    Object

[System.Convert]::ToBoolean($a)でBooloan型へ変換

$TrueorFalse = [System.Convert]::ToBoolean($a)
$TrueorFalse.GetType()

IsPublic IsSerial Name                                     BaseType
-------- -------- ----                                     --------
True     True     Boolean                                  System.
                                                           ValueType

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)