TOP PowerShell



Assembly 一覧表示

function Get-Assembly {
[Appdomain]::CurrentDomain.GetAssemblies() | %$_.GetName().Name}
}

#using < System.Drawing.dll>

[void][System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")

Fullname 表示

$a = [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
$a.FullName

Fullnameでの読み込み

[System.Reflection.Assembly]::Load("System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")

Assembly ファイル名指定での読み込み

[System.Reflection.Assembly]::LoadFrom("C:\Hello\World.dll")

gcnew/member,property access

$sr = New-Object System.IO.StreamReader("makefile")
while (!$sr.EndOfStream){
$line = $sr.ReadLine()
Write-Host($line)
}
$sr.Close()

static member の表示

[Math] | Get-Member -static

static member access

[Math]::Pow(2,3)

管理人/副管理人のみ編集できます