2021-11-06から1日間の記事一覧

powershell - モジュールの読み込み

qiita.com 基本的にはドットソース演算子を利用ですかね。

powershell - vscodeデバッグ

blog.janjan.net

powershell - 関数の戻り値

winscript.jp

powershell - カスタムオブジェクト

www.vwnet.jp function CreateCustomObject() { $data = New-Object PSObject | Select-Object one, two, three; return $data } $datas = @() $o1 = CreateCustomObject $o1.one = "a1" $o1.two= "b1" $o1.three= "c1" $datas += $o1; $o2 = CreateCustomOb…

powershell - Read-Host

soma-engineering.com [ValidateSet("y","n")] $res= Read-Host "ok?(y or n)" Write-Host $res

powershell - help

> Get-Help Get-ChildItem -detailed #> help Get-ChildItem 名前 Get-ChildItem 構文 Get-ChildItem [[-Path] <string[]>] [[-Filter] <string>] [<CommonParameters>] Get-ChildItem [[-Filter] <string>] [<CommonParameters>] パラメーター -Attributes <FlagsExpression[FileAttributes]> -Depth <uint32> -Directory -Exclude <…</uint32></flagsexpression[fileattributes]></commonparameters></string></commonparameters></string></string[]>

powershell - Format-Table 出力の改善(AutoSize,Wrap)

Get-Service -Name win* | Format-Table -Property Name,Status,StartType,DisplayName,DependentServices -Wrap Name Status StartType DisplayName DependentServices ---- ------ --------- ----------- ----------------- WinDefend Stopped Manual Micr…

powershell - 詳細情報

docs.microsoft.com Get-Process -Name explorer | Where-Object{$_.id -eq 9964} | Format-List -Property * Name : explorer Id : 9964 PriorityClass : Normal FileVersion : 10.0.22000.258 (WinBuild.160101.0800) HandleCount : 4724 WorkingSet : 381…

powershell - フォーマット

docs.microsoft.com

powershell - オブジェクトの構造

docs.microsoft.com