파워쉘 유용한 명령어 정리. 모두 파워쉘 프롬프트에서 실행 필요
Network drive 로그인 정보 확인
gwmi -Query 'Select LocalName, RemoteName, UserName from Win32_NetworkConnection'
환경 변수 사용
환경 변수 출력
echo 나 print 를 사용하지 않고 출력할 환경 변수 값(Ex: Path 일 경우 $env:Path) 을 적어줌.
$env:Path ;C:\Python38\Scripts\;C:\Python38\;C:\Program Files (x86)...
모든 환경 변수 목록 출력
Get-ChildItem env: Name Value ---- ----- ALLUSERSPROFILE C:\ProgramData APPDATA C:\Users\lesstif\AppData\Roaming ChocolateyInstall C:\ProgramData\chocolatey HOME C:\Users\lesstif ... USERPROFILE C:\Users\lesstif windir C:\WINDOWS ...
PATH 환경 변수 변경
bash 의 PATH 에 새로운 경로를 추가하는 것과 비슷한 문법
export PATH=/add/some/path/:$PATH
powershell 은 SET 으로 환경 변수를 설정하지 않고 $env: 밑에 설정할 변수명을 바로 지정
$env:Path="C:\devel\php\php-7.3.14-nts-Win32-VC15-x64\;" + $env:Path