내용으로 건너뛰기
GaramX
사용자 도구
로그인
사이트 도구
검색
도구
문서 보기
이전 판
역링크
최근 바뀜
미디어 관리자
사이트맵
로그인
>
최근 바뀜
미디어 관리자
사이트맵
현재 위치:
home
»
windows
»
powershell
추적:
windows:powershell
이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요.
====== PowerShell ====== 파워쉘을 실행하기 위해서는 권한을 부여하여 주어야 한다. 기본적으로 script실행을 OS에서 비활성화 시켜 놓았다.(이것떄문에 많은 시간을 소비하였음) ===== Profile ===== ==== Profile이 존재하는지 확인 ==== <code sh> Test-Path $profile </code> - True : 존재 - False : 미존재 ==== 프로파일을 생성하려면 ==== <code sh> New-Item -Path $profile -type file -Force </code> ===== Powershell Console 을 실행하면 어떤 Profile 파일이 순서적으로 자동으로 실행되는가? ===== ==== 첫 번째, 모든 사용자에게 적용되는 프로파일인 다음 파일들이 순서대로 실행된다. ==== 1) $PROFILE.AllUsersAllHosts (Profile.ps1) 2) $PROFILE.AllUsersCurrentHost (Microsoft.PowerShell_profile.ps1) ==== 두번째, 현재 로그온 한 사용자에게 적용되는 프로파일인 다음 파일들이 순서대로 실행된다. ==== 3) $PROFILE.CurrentUserAllHosts (Profile.ps1) 4) $PROFILE.CurrentUserCurrentHost (Microsoft.PowerShell_profile.ps1) 그러므로 이 컴퓨터를 사용하는 모든 사용자에게 동일한 설정을 부여하기 위해서는 경로가 정해져 있는 C:\Windows\System32\WindowsPowershell\v1.0\ 2개의 파일(Microsoft.PowerShell_profile.ps1, Profile.ps1)을 수정하면 된다. 이 중에서 하나만 수정하여 사용해도 된다. Profile 파일 종류들을 확인하려면… <code sh> $PROFILE | Format-List * -Force $profile | select * # 위의 명력과 동일하게 실행됨 </code> <code sh> -- 결과 실행 순서별 AllUsersAllHosts : C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1 AllUsersCurrentHost : C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1 CurrentUserAllHosts : C:\Users\xxxxx\OneDrive\문서\WindowsPowerShell\profile.ps1 CurrentUserCurrentHost : C:\Users\xxxxx\OneDrive\문서\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 Length : 77 </code> 무슨실행권한을 관리하는 가? 어차피 실행할 수 있게 만들 것이면서 <code sh> Get-ExecutionPolicy -List Set-ExecutionPolicy RemoteSigned </code> ===== Touch 기능 ===== <code sh> Get-ChildItem D:\testFile1.txt | % {$_.LastWriteTime = '2005-11-01 06:01:36'} Get-ChildItem D:\testFile1.txt | % {$_.LastWriteTime = (Get-Date)} </code>
windows/powershell.txt
· 마지막으로 수정됨: 2025/04/15 10:05 저자
127.0.0.1
문서 도구
문서 보기
이전 판
역링크
맨 위로