사용자 도구

사이트 도구


windows:powershell

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
다음 판 양쪽 다음 판
windows:powershell [2018/06/05 21:37]
kwon37xi
windows:powershell [2018/06/14 14:08]
kwon37xi [기본명령]
줄 6: 줄 6:
  
 ===== 기본 개인 profile 파일 ===== ===== 기본 개인 profile 파일 =====
 +  * [[https://technet.microsoft.com/en-us/library/bb613488(v=vs.85).aspx|Understanding profile]]
   * ''$PROFILE'' 환경변수 값으로 프로필 파일 생성<code>   * ''$PROFILE'' 환경변수 값으로 프로필 파일 생성<code>
 New-Item $profile -force -itemtype file New-Item $profile -force -itemtype file
줄 24: 줄 25:
 Import-Module Get-ChildItemColor Import-Module Get-ChildItemColor
  
-Set-Alias Get-ChildItemColor -option AllScope +Set-Alias ls Get-ChildItemColor -option AllScope 
-Set-Alias ls Get-ChildItemColorFormatWide -option AllScope+Set-Alias ll Get-ChildItemColorFormatWide -option AllScope
 </code> </code>
  
줄 68: 줄 69:
 New-Item -ItemType SymbolicLink -Path C:\Temp\MySymLinkFile.txt -Value $pshome\profile.ps1 New-Item -ItemType SymbolicLink -Path C:\Temp\MySymLinkFile.txt -Value $pshome\profile.ps1
 </code> </code>
 +  * grep 대체 [[https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/select-string?view=powershell-6|Select-String]]<code>
 +# 문자열 filter
 +"Hello","HELLO" | Select-String -Pattern "HELLO" -CaseSensitive
 +# *.xml 파일들에서 문자열 탐색
 +Select-String -Path "*.xml" -Pattern "the the"
  
 +# 매칭이 안되는 부분 찾기
 +Select-String -Path "process.txt" -Pattern "idle, svchost" -NotMatch
 +</code>
 +  * rename - [[https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/rename-item?view=powershell-6|Rename-Item]]<code>
 +Rename-Item -Path old_name -NewName new_name [-Force]
 +</code>
 ===== curl ===== ===== curl =====
   * [[linux:curl|Curl]] 을 사용하려면 ''cinst curl''로 설치하고   * [[linux:curl|Curl]] 을 사용하려면 ''cinst curl''로 설치하고
windows/powershell.txt · 마지막으로 수정됨: 2024/03/05 13:00 저자 kwon37xi