기본적으로 cmdlets 사용법을 보고싶으면
get-command -noun sp*
get-help get-spsite (이거는 get-spsite 커멘렛 사용법을 예시와함께 보여줌.)
write-host "hello" (이거는 메세지출력)
커멘렛과 파라미터 둘다 tab completion가능.
| measure-object -line (결과가 몇줄인지 출력)
| more (이거는 한페이지만 우선 출력후 한줄씩 출력)
| export -csv (이거는 결과를 csv파일에 출력)
alias | more (이거는 사용가능 alias를 보여줌. 예로, '%'는 '/ForEach-Object' 이다)
예시로
Get-spsite
Get-SPSite | get-member (이거는 spsite object를 get한후 모든 property를 출력)
Get-spsite | select url.owner (select는 spsite object에서 url.owner property를 출력
get-spsite http://... | ForEach-Object { New-SPWeb -url ....
# getting all workflows
get-spweb 'http://myspsite.com' | select -expand workflowtemplates | select name, associationcategories
# getting docuemnt libraries
#get-spweb 'http://myspsite.com' | select -expand lists | where {_.basetype -eq "DocumentLibrary"}
'|' (pipe) can be used to pass the output from one cmdlet to another.
script를 파일로 작성해서 실행시키고싶으면
test.ps1 을 만들어서
실행할때는 powershell을 열어서 type ".\test.ps1" and enter.
workflow가 어디에 쓰였는지
사이트와 리스트를 loop thru하면서 체크하는 스크립트 예시 파일추가함.wf.ps1
