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

powershell - database(insert)

sample code # 接続情報設定 $strServer = 'localhost'; # サーバーを指定 $strDatabase = 'MyTest'; # データベースを指定 $strUserId = 'xx'; # ユーザーIDを指定 $strPassword = 'xxxx'; # パスワードを指定 $cnnstr = "Data Source=$strServer;Initial C…

powershell - Where-Object

sample code Get-Service | Where-Object { $_.status -match "^Run"}

powershell - Select-String

sample code select-string -pattern "神様" -path "./*.*" select-string -pattern "神様" -path (Get-ChildItem -Recurse "*.*")

powershell - ファイル一覧

sample code Get-ChildItem -path "./" -Recurse | ForEach {$_.fullname }

powershell - 文字化け

参考 thinkami.hatenablog.com

powershell - 配列やリストのデータをファイルに保存

概要 配列やリストのデータをファイルに保存したい。 サンプルコード .Net Frameworkを利用 $list = New-Object System.Collections.Generic.List[string] Get-ChildItem -path ./ -Recurse | ForEach-Object { $list.Add($_.FullName) } $enc = New-Object S…