사용자 도구

사이트 도구


windows:powershell

차이

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

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
windows:powershell [2019/11/27 10:00]
kwon37xi
windows:powershell [2024/03/05 13:00] (현재)
kwon37xi
줄 1: 줄 1:
 ====== Windows Powershell ====== ====== Windows Powershell ======
   * https://powershell.org/   * https://powershell.org/
 +  * [[:starship|Starship]]
   * [[https://github.com/PowerShell/PowerShell/tree/master/docs/learning-powershell|Learning Powershell]]   * [[https://github.com/PowerShell/PowerShell/tree/master/docs/learning-powershell|Learning Powershell]]
   * [[https://github.com/JanDeDobbeleer/oh-my-posh|oh-my-posh]]   * [[https://github.com/JanDeDobbeleer/oh-my-posh|oh-my-posh]]
   * [[https://mva.microsoft.com/en-us/training-courses/getting-started-with-powershell-3-0-jump-start-8276?l=r54IrOWy_2304984382|Microsoft PowerShell Tutorial & Training Course – Microsoft Virtual Academy]]   * [[https://mva.microsoft.com/en-us/training-courses/getting-started-with-powershell-3-0-jump-start-8276?l=r54IrOWy_2304984382|Microsoft PowerShell Tutorial & Training Course – Microsoft Virtual Academy]]
 +  * [[https://github.com/fleschutz/PowerShell|fleschutz/PowerShell: Mega collection of 250+ useful cross-platform PowerShell scripts.]]
  
 ===== 기본 개인 profile 파일 ===== ===== 기본 개인 profile 파일 =====
줄 97: 줄 99:
 </code> </code>
  
 +===== Powershell script from remote =====
 +  * [[https://www.thomasmaurer.ch/2021/07/powershell-download-script-or-file-from-github/|PowerShell: Download script or file from GitHub - Thomas Maurer]]
 +
 +<code sh>
 +Invoke-WebRequest -Uri https://raw.githubusercontent.com/thomasmaurer/demo-cloudshell/master/helloworld.ps1 -OutFile .\helloworld.ps1; .\helloworld.ps1 
 +</code>
 +  * [[https://www.youtube.com/watch?v=omm2YUkTkg0|How to run a Powershell script directly from Github private repository through Powershell - YouTube]] : github api 와 access token 으로 원격 스크립트 실행.
 +<code sh>
 +# Created by Daniel Jean Schmidt
 +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
 +
 +$Script = Invoke-RestMethod https://api.github.com/repos/Twikki/youtubetest/contents/Download_Files.ps1?access_token=yourtokenhere -Headers @{”Accept”= “application/vnd.github.v3.raw”}
 +
 +Invoke-Expression $Script
 +</code>
 +  * [[https://tomtalks.blog/run-powershell-scripts-directly-github-two-lines/|Run PowerShell Scripts Directly from GitHub with Two Lines - Tom Talks]]
 +
 +<code>
 +# script 주소는 올바르게 변경할 것.
 +$ScriptFromGitHub = Invoke-WebRequest https://raw.githubusercontent.com/tomarbuthnot/Run-PowerShell-Directly-From-GitHub/master/Run-FromGitHub-SamplePowerShell.ps1
 +Invoke-Expression $($ScriptFromGitHub.Content)
 +</code>
 ===== tail ===== ===== tail =====
 마지막 1000 줄 보여주면서 계속 출력하기 마지막 1000 줄 보여주면서 계속 출력하기
줄 118: 줄 142:
  
 =====언어 변경 ===== =====언어 변경 =====
 +  * 언어팩은 설정을 통해서만 다운로드 가능하다. 명령행으로 현재까지는 불가함.
 +    * [[https://docs.microsoft.com/ko-kr/windows-hardware/manufacture/desktop/add-language-packs-to-windows#get-languages|Add languages to Windows images | Microsoft Docs]] 언어팩을 다운로드 하려면 라이센스 가입을 통해 ISO 파일을 다운로드 받아야 함.
 +<code>
 +# 가능할수도? 테스트 필요.
 +Get-WindowsCapability -Online | ? Name -like '*ko*' # 한국어 관련 목록 버전을 정확히 확인해야함.
 +
 +Add-WindowsCapability -Online -Name 'Language.Basic~~~ko-KR~0.0.1.0'
 +Add-WindowsCapability -Online -Name 'Lnaguage.Fonts.Kore~~~und-KORE~0.0.1.0'
 +</code>
 +  * [[https://4sysops.com/archives/adding-and-removing-keyboard-languages-with-powershell/|Adding and removing keyboard languages with PowerShell – 4sysops]]
 +  * [[https://4sysops.com/archives/local-experience-packs-add-languages-to-windows-10-and-server-2019/|Local Experience Packs: Add languages to Windows 10 and Server 2019 – 4sysops]]
   * [[https://docs.microsoft.com/en-us/powershell/module/international/set-winuilanguageoverride?view=win10-ps|Set-WinUILanguageOverride]]   * [[https://docs.microsoft.com/en-us/powershell/module/international/set-winuilanguageoverride?view=win10-ps|Set-WinUILanguageOverride]]
   * [[https://docs.microsoft.com/en-us/powershell/module/international/set-winsystemlocale?view=win10-ps|Set-WinSystemLocale]]   * [[https://docs.microsoft.com/en-us/powershell/module/international/set-winsystemlocale?view=win10-ps|Set-WinSystemLocale]]
 <code> <code>
 Set-WinUILanguageOverride -Language ko-KR Set-WinUILanguageOverride -Language ko-KR
-Set-WinSystemLocale -SystemLocale ko-KR+Set-WinSystemLocale -SystemLocale ko-KR # 재부팅 후 적용
 </code> </code>
  
줄 134: 줄 169:
 Set-WinHomeLocation -GeoId 0x86 Set-WinHomeLocation -GeoId 0x86
 </code> </code>
 +
 +===== Reboot =====
 +  * https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/restart-computer?view=powershell-7
 +
 +<code sh>
 +Restart-Computer
 +</code>
 +
 +===== Linux PowerShell =====
 +  * [[https://learn.microsoft.com/ko-kr/powershell/scripting/install/installing-powershell-on-linux|Installing PowerShell on Linux]]
 +  * [[https://learn.microsoft.com/ko-kr/powershell/scripting/install/install-ubuntu|Ubuntu에 PowerShell 설치]]
  
 ===== 참조 ===== ===== 참조 =====
   * [[https://gist.github.com/jchandra74/5b0c94385175c7a8d1cb39bc5157365e|PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization]]   * [[https://gist.github.com/jchandra74/5b0c94385175c7a8d1cb39bc5157365e|PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization]]
 +  * [[https://www.tutorialspoint.com/powershell/index.htm|Powershell Tutorial]]
  
windows/powershell.1574816438.txt.gz · 마지막으로 수정됨: 2019/11/27 10:00 저자 kwon37xi