powershell에서 원격데스크탑 방화벽 활성화 > Set-NetfirewallRule -DisplayName "원격 데스크톱 - 사용자 모드(TCP-In)" -Enabled True > Set-NetfirewallRule -DisplayName "원격 데스크톱 - 사용자 모드(UDP-In)" -Enabled True 개발/Window 2020. 7. 28. 09:10
powershell 에서 파일 내용 치환하기 > $[변수명] = Get-Content [작업대상파일] | %{$_ -replace('[기존내용]','[변경내용]')}> $[변수명] > [신규대상파일] ex)> $admin = Get-Content c:\admin.cfg | %{$_ -replace('abcd','xyz')}> $admin > c:\test.cfg 개발/Window 2020. 6. 4. 17:44
powershell 에서 파일 인코딩 바꾸기 > Get-Content [기존파일] | Set-Content -Encoding [변경할 언어셋] [신규파일] ex) Get-Content C:\test.cfg | Set-Content -Encoding utf-8 C:\new.cfg cf. 커맨드(cmd)창에서 실행하기- 파워쉘에서는 일반 커맨드창의 bat 파일을 실행할 수 없음.ps1 파일로 저장해준 다음 command 에서 아래의 명령어로 실행 > Powershell.exe -noprofile -executionpolicy bypass -file "[파워셸파일].ps1" 개발/Window 2020. 6. 4. 14:37