Get-ChildItem -Recurse . | ? { ! $_.PSIsContainer } | % { $_.FullName }(またはgci)
gci -r . | ? { $_.Name -match "hoge" } | % { $_.FullName }
Select-String pattern (dir -recurse -include *.c,*.h) | % { [string]::Format("{0}`t{1}`t{2}", $_.Path, $_.LineNumber, $_.Line) }(またはsls)
gci -r -i "*.bak" | rm
C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -NoExit -Command Set-Location $P
フォルダ作成 | New-Item <path> -Itemtype Directory |
ファイル・フォルダの存在確認 | Test-Path |
現在時刻の文字列 | (Get-Date).Tostring("yyyyMMdd_HHmmss") |
Read-Host | 入力した文字列を受け取る |
Write-Output | 文字列を出力(パイプで渡すことが可) |
Remove-Item | ファイルの削除 |
Set-Content | ファイルの新規作成または上書き |
Add-Content | ファイルに追記(ない場合は作成) |
$document.Close([ref] [Microsoft.Office.Interop.Word.WdSaveOptions]::wdDoNotSaveChanges)