사용자 도구

사이트 도구


tool:powershell

차이

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

차이 보기로 링크

다음 판
이전 판
tool:powershell [2012/06/01 10:37] – 바깥 편집 127.0.0.1tool:powershell [2024/04/23 22:43] (현재) – 바깥 편집 127.0.0.1
줄 1: 줄 1:
 +====== 파워쉘 스크립트 실행 권한 ======
  
 +파워쉘 스크립트를 현재 터미널(Process)에서만 실행 허용하고 이후에는 원래대로 두게 하고 싶은 경우,
 +
 +  * 파워쉘을 어드민 권한으로 실행
 +
 +  * 아래 커맨드 입력
 +
 +  Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
 +
 +스크립트 실행 권한을 현재 프로세스에서만 실행 가능하게 설정
 +
 +  * 상세내용은 [[https://docs.microsoft.com/ko-kr/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-7|여기, Set-ExecutionPolicy]]
 +
 +  * 파워쉘을 다시 열어 같은 스크립트를 실행해보면, 안되는 것을 확인 할 수 있다.
 +
 +====== 설정 변경 ======
 +
 +===== PowerShell을 기본 console로 설정 =====
 +
 +환경설정에서 , ComSpec 항목을 powershell로 변경하면 된다.
 +
 +기본 값 :
 +
 +  ComSpec --> %SystemRoot%\system32\cmd.exe
 +
 +변경하려는 값
 +
 +  ComSpec --> %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
 +
 +===== PowerShell ISE =====
 +
 +기본으로 깔리는 거였나..?
 +
 +http://technet.microsoft.com/en-us/library/dd315244.aspx
 +
 +===== 윈도우즈 콘솔 폰트 변경 =====
 +
 +[[http://www.keepitsimple.co.kr/entry/%EC%9C%88%EB%8F%84%EC%9A%B0-%EB%8F%84%EC%8A%A4%EC%B0%BD-%EB%AA%85%EB%A0%B9%ED%96%89-%EC%B0%BD-%EA%B8%80%EA%BC%B4-%EB%B3%80%EA%B2%BD|출처:www.keepitsimple.co.kr]]
 +
 +  - 레지스트리 편집기에서 아래 주소로 이동 <code>
 +\HEKY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont
 +</code>
 +  - 그 중 949 부분을 원하는 글꼴로 변경한다.
 +
 +===== Command here =====
 +
 +파워쉘의 팁은 아니지만, 탐색기에서 오른쪽 버튼 클릭해서 도스창 띄우기
 +
 +다음 파일을 설치하면 됨, 오래된 것이지만 비스타에서도 사용 가능
 +
 +{{:doshere.zip|Dos Command Here 설치용 inf 파일}}
 +
 +{{tag> powershell doscommandpromptHere}}
 +
 +===== chcp code =====
 +
 +  * korea : 949
 +  * japan : 932
 +  * english : 437
 +
 +====== 파워쉘 팁 모음 ======
 +[[http://msdnpopcon.com/tag/%EA%BC%AC%EC%95%8C%EB%9D%BC|꼬알라]]
 +
 +====== 웹에서 스크랩한 스크립트 ======
 +공부가 되지 않을까?
 +
 +===== 삭제하고 싶은 폴더만 전부 삭제 =====
 +
 +예를 들면 ".svn"와 같은 폴더. \\ 1번은 써봤는데 2번은 안써봐서 동작 흐름은 잘 모름.
 +출처 : [[http://stackoverflow.com/questions/2210193/powershell-how-to-recursivelly-delete-all-svn-files|powershell-how-to-recursivelly-delete-all-svn-files]]
 +
 +<code powershell>
 +gci c:\yourdirectory -include .svn -Recurse -Force | Remove-Item -Recurse -Force
 +</code>
 +
 +파일 중에, .svn 은 삭제하지 않도록 하는 추가 스크립트
 +
 +<code powershell>
 +Get-ChildItem $path -r -include .svn -force | Where {$_.PSIsContainer} | Remove-Item -r -force
 +</code>
 +
 +----
 +
 +{{tag>파워쉘 powershell}}