"윈도우 PowerShell 버전 확인"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-==참고 자료== +==참고==))
58번째 줄: 58번째 줄:


[[분류: PowerShell]]
[[분류: PowerShell]]
[[분류: 버전]]
[[분류:버전 확인]]

2018년 1월 11일 (목) 21:10 판

Check Version of PowerShell
Determine installed PowerShell version
파워쉘 버전 확인

1 방법 1: host

PS C:\Users\jmnote> host | findstr ^Version
Version          : 2.0
→ 2.0
host 대신 $host 또는 get-host를 써도 됨
PS C:\Users\jmnote> (host|findstr Version).substring(19)
2.0

2 방법 2: $PSVersionTable

PS C:\Users\jmnote> $PSVersionTable | findstr ^PSVersion
PSVersion                      2.0
PS C:\Users\jmnote> ($PSVersionTable|findstr PSVersion).substring(31)
2.0
PS C:\Users\jmnote> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
2      0      -1     -1

3 방법 3: $host.version

PS C:\Users\jmnote> $host.version

Major  Minor  Build  Revision
-----  -----  -----  --------
2      0      -1     -1
$host.version 대신 (get-host).version을 써도 됨
PS C:\Users\jmnote> ""+$host.version.major+"."+$host.version.minor
2.0
PS C:\Users\jmnote> $a=$host.version;""+$a.major+"."+$a.minor
2.0

4 같이 보기

5 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}