문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
windows:powershell [2018/06/05 21:09] kwon37xi [curl] |
windows:powershell [2024/03/05 13:00] (현재) kwon37xi |
||
---|---|---|---|
줄 1: | 줄 1: | ||
====== Windows Powershell ====== | ====== Windows Powershell ====== | ||
* https:// | * https:// | ||
+ | * [[: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
===== 기본 개인 profile 파일 ===== | ===== 기본 개인 profile 파일 ===== | ||
- | * '' | + | |
+ | | ||
+ | New-Item $profile -force -itemtype file | ||
+ | </ | ||
* '' | * '' | ||
- | |||
- | |||
===== Powershell Core ===== | ===== Powershell Core ===== | ||
* [[https:// | * [[https:// | ||
줄 24: | 줄 27: | ||
Import-Module Get-ChildItemColor | Import-Module Get-ChildItemColor | ||
- | Set-Alias | + | Set-Alias |
- | Set-Alias | + | Set-Alias |
</ | </ | ||
줄 57: | 줄 60: | ||
$Env:path = $env:path + "; | $Env:path = $env:path + "; | ||
Set-Item -Path Env:Path -Value ($Env:Path + "; | Set-Item -Path Env:Path -Value ($Env:Path + "; | ||
+ | |||
+ | # 환경변수 목록 | ||
+ | Get-ChildItem Env: | ||
</ | </ | ||
줄 68: | 줄 74: | ||
New-Item -ItemType SymbolicLink -Path C: | New-Item -ItemType SymbolicLink -Path C: | ||
</ | </ | ||
+ | * grep 대체 [[https:// | ||
+ | # 문자열 filter | ||
+ | " | ||
+ | # *.xml 파일들에서 문자열 탐색 | ||
+ | Select-String -Path " | ||
+ | # 매칭이 안되는 부분 찾기 | ||
+ | Select-String -Path " | ||
+ | </ | ||
+ | * rename - [[https:// | ||
+ | Rename-Item -Path old_name -NewName new_name [-Force] | ||
+ | </ | ||
===== curl ===== | ===== curl ===== | ||
* [[linux: | * [[linux: | ||
줄 74: | 줄 91: | ||
remove-item alias:curl | remove-item alias:curl | ||
</ | </ | ||
+ | |||
+ | ===== wget ===== | ||
+ | * '' | ||
+ | |||
+ | <code sh> | ||
+ | wget http:// | ||
+ | </ | ||
+ | |||
+ | ===== Powershell script from remote ===== | ||
+ | * [[https:// | ||
+ | |||
+ | <code sh> | ||
+ | Invoke-WebRequest -Uri https:// | ||
+ | </ | ||
+ | * [[https:// | ||
+ | <code sh> | ||
+ | # Created by Daniel Jean Schmidt | ||
+ | [Net.ServicePointManager]:: | ||
+ | |||
+ | $Script = Invoke-RestMethod https:// | ||
+ | |||
+ | Invoke-Expression $Script | ||
+ | </ | ||
+ | * [[https:// | ||
+ | |||
+ | < | ||
+ | # script 주소는 올바르게 변경할 것. | ||
+ | $ScriptFromGitHub = Invoke-WebRequest https:// | ||
+ | Invoke-Expression $($ScriptFromGitHub.Content) | ||
+ | </ | ||
+ | ===== tail ===== | ||
+ | 마지막 1000 줄 보여주면서 계속 출력하기 | ||
+ | |||
+ | <code sh> | ||
+ | Get-Content 파일경로 -Wait -Tail 1000 | ||
+ | </ | ||
+ | |||
+ | ===== alias ===== | ||
+ | < | ||
+ | # vi 를 vim.exe 실행하는 것으로 alias 걸기 | ||
+ | set-alias -name vi -value vim.exe | ||
+ | </ | ||
+ | |||
+ | ===== Timezone ===== | ||
+ | * [[https:// | ||
+ | |||
+ | < | ||
+ | Set-TimeZone -Id "Korea Standard Time" | ||
+ | </ | ||
+ | |||
+ | =====언어 변경 ===== | ||
+ | * 언어팩은 설정을 통해서만 다운로드 가능하다. 명령행으로 현재까지는 불가함. | ||
+ | * [[https:// | ||
+ | < | ||
+ | # 가능할수도? | ||
+ | Get-WindowsCapability -Online | ? Name -like ' | ||
+ | |||
+ | Add-WindowsCapability -Online -Name ' | ||
+ | Add-WindowsCapability -Online -Name ' | ||
+ | </ | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | < | ||
+ | Set-WinUILanguageOverride -Language ko-KR | ||
+ | Set-WinSystemLocale -SystemLocale ko-KR # 재부팅 후 적용 | ||
+ | </ | ||
+ | |||
+ | ===== Location 변경 ===== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * 한국 : '' | ||
+ | |||
+ | < | ||
+ | Set-WinHomeLocation -GeoId 0x86 | ||
+ | </ | ||
+ | |||
+ | ===== Reboot ===== | ||
+ | * https:// | ||
+ | |||
+ | <code sh> | ||
+ | Restart-Computer | ||
+ | </ | ||
+ | |||
+ | ===== Linux PowerShell ===== | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
===== 참조 ===== | ===== 참조 ===== | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||