본문 바로가기

PowerShell3

[Windows] PowerShell > http 링크된 파일 다운로드 후 리네임 및 버전 비교 http 링크된 파일 다운로드 후 파일명에 버전 정보 추가하는 스크립트 (PowerShell 2.0 기준) 이렇게 만들고 보니 웹브라우저 띄우지 않고 버전 확인까지 가능해서 개이득 한결 편해졌다 $source = "http://~~~test.exe" $destination = "c:\~~~\test.exe" $client = new-object System.Net.WebClient $client.DownloadFile($source, $destination) $version = (Get-Item $destination).VersionInfo.FileVersion Rename-Item $destination test_$version.exe + 추가) 로컬에 설치된 버전과 비교하기 $source = "htt.. 2015. 5. 29.
[Windows] *.ps1 스크립트 실행하기 ps1 확장자를 가진 파워쉘 스크립트를 실행하려면 아래와 같이 진행한다 1. powershell 을 관리자 권한으로 실행 2. Set-ExecutionPolicy Unrestricted 명령어 실행 > Y 입력 3. 탐색기에서 *.ps1 파일 우클릭 > PowerShell에서 실행 (또는 배치파일로 실행) * bat command Powershell.exe -noprofile -executionpolicy bypass -file "C:\~\~.ps1" 2015. 5. 28.
윈도우 창 핸들링 셀레늄에서 새 탭이나 팝업창 컨트롤하는 방법 단, 핸들링 정보 얻는데 2초, 포커스 전환시 2초 딜레이가 생긴다 http://santoshsarmajv.blogspot.kr/2012/04/how-to-switch-control-to-pop-up-window.html http://seleniumparadise.blogspot.kr/2012/10/selenium-web-driver-code.html //클릭 전 핸들링 Set beforePopup = driver.getWindowHandles(); //클릭 driver.findElement(by).click(); //클릭 후 핸들링 Set afterPopup = driver.getWindowHandles(); //포커스 변경 afterPopup.removeA.. 2013. 7. 31.