2020-02-10から1日間の記事一覧

powershell - Export-csv

sample code PS> Get-Service | Where-Object { $_.Status -match "^Run" } | Export-Csv -path "service.csv" -Encoding UTF8 -NoTypeInformation

powershell - excel

sample code # ファイルオープン $xl = New-Object -Com Excel.Application $xl.DisplayAlerts = $false $wb = $xl.Workbooks.Open(D:\xxxx\ps\myexcel.xlsx) # シートを取得 $sheet = $wb.Worksheets.Item("Sheet1") # セルの値を取得 Write-Output $sheet.…

powershell - Split-Path

sample code # ファイル名を取得 PS> Split-Path "D:\xxxx\ps\test.txt" -Leaf # test.txt # フォルダ名を取得 PS> Split-Path "D:\xxxx\ps\test.txt" -Parent # D:\xxxx\ps

powershell - .netクラスライブラリの活用

参考 www.atmarkit.co.jp