2013년 1월 15일 화요일

QTP Shortcut Key


QTP Shortcut Keys

Ctrl + N- Creates a New Test
Ctrl+Shift+N- Creates a New Business Test
Ctrl+Alt+N- Creates a New Application Area
Shift+Alt+N- Creates a New Function Library
Ctrl+O- Opens an Existing Test
Ctrl+Shift+O- Opens an existing business component
Ctrl+Alt+O- Opens an existing Application Area
Shift+F2- Rename the Action name
Ctrl+M- Make the comment on current row
Ctrl+Shift+M- Remove the comment
Ctrl+Space- Completes the word if you are typing any VBScript method or object in Expert View
F12- For Standard Checkpoint
Ctrl+F12- For Standard Output Values
F7- Step Generator
F8- New Step in Keyword View
Shift+F8- New Step after block of statement
F3- Recording
F4- Stop the Recording
F5- Run the Script
Ctrl+F5- Run the selected step in the script
Ctrl+R- Open the object repository
Shift+Alt+F3- Analog Recording
Ctrl+Shift+F3- Low Level Recording
F11- Step Into
F10- Step Over
Shift+11- Step out
Ctrl+F10- Run to Step
Ctrl+T- Adds the selected item in the Watch tab
Ctrl+F7- Check the Syntax error in the script.
Ctrl+Page Up or Page Down- Toggles between the Keyword and Expert View.

You can add more if I’m missing some shortcut keys.

2013년 1월 8일 화요일

Powershell Shortcuts



(Alt) +(F7) Deletes the current command history
(PgUp) (PgDn) Display the first (PgUp) or last (PgDn) command you used in current session
(Enter) Send the entered lines to PowerShell for execution
(End) Moves the editing cursor to the end of the command line
(Del) Deletes the character to the right of the insertion point
(Esc) Deletes current command line
(F2) Moves in current command line to the next character corresponding to specified character
(F4) Deletes all characters to the right of the insertion point up to specified character
(F7) Displays last entered commands in a dialog box
(F8) Displays commands from command history beginning with the character that you already entered in the command line
(F9) Opens a dialog box in which you can enter the number of a command from your command history to return the command. (F7) displays numbers of commands in command history
(Left arrow) ,(Right arrow) Move one character to the left or right respectively
(Arrow up) (Arrow down) (F5) (F8) Repeat the last previously entered command
(Home) Moves editing cursor to beginning of command line
(Backspace) Deletes character to the left of the insertion point
(Ctrl) +(C) Cancels command execution
(Ctrl) +(End) Deletes all characters from current position to end of command line
(Ctrl) +(Arrow left) (Ctrl) +(Arrow right) Move insertion point one word to the left or right respectively
(Ctrl) +(Home) Deletes all characters of current position up to beginning of command line
(Tab) Automatically completes current entry, if possible

2013년 1월 4일 금요일

레지스트리읽기와 쓰기.


레지스트리 접근(레지스트리 내용은 디렉터리와 동일하게 접근)
HKEY_LOCAL_MACHINE : cd HKLM:
HKEY_CURRENT_USER : cd HKCU:

레스스트리 읽기, 쓰기
PS > Get-ItemProperty 키이름
PS > Set_ItemProperty 위치 -name 키이름 -value 키값

exe 실행하기


$xFilePath = "D:\nexusfile\"

$excute = $xFilePath + "x.exe"

&$excute

머 이렇게 하면 excute함수가 실행된다 & 붙여야되는것을 몰랐던것이다... ㅋㅋ


아 참고로 아귀먼트가 있으면

$excute = "notepad.exe"
$arg = "readme_ko.txt"

&$excute $arg

이런식으로 하면 된다... 바보 같이 

$excute = "noepad.exe readme_ko.txt" 이렇게 해서 실행하면 안된다.

레지스트리 조작 부팅시 start-up 프로그램 지정

################################################################## 
 
# 부팅시 Install2를 자동으로 실행한다.

################################################################# 

param
(
[string]$ParamOption
)

Function StartUpInstall
{
param([string]$ParamOption )
$RegStartUp= "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" 
if ($ParamOption -eq "/u")
{
Remove-ItemProperty $RegStartUp -Name Install
}
else 
{
Set-ItemProperty $RegStartUp -Name Install -Value c:\setup\install2.bat
}
}

StartUPInstall $ParamOption



Remove-ItemProperty $RegStartUp -Name Install = regkey를 지우는것

Set-ItemProperty $RegStartUp -Name Install -Value c:\setup\install2.bat  = regkey 수정이나 추가할때 쓰인다.


startup 출처: http://blog.scorpiotek.com/2008/12/31/how-to-create-startup-items-on-server-core/

Powershell 에서 XML Encoding 관련.


-encoding UTF8 이거 앞에 붙여야 에러가 안난다 꼭 인코딩을 신경쓰자


[xml] $XmlContent = Get-Content "c:\web.config" -encoding UTF8

echo $XmlContent.configuration.'system.serviceModel'.services.service.host.baseAddresses.add

echo $XmlContent.configuration.'system.serviceModel'.services.service.endpoint.address

이렇게 xml을 불러올올수 있고 노드를 찾아가면 된다. 만약 " . "이 있을경우 ' '로 묶으면 된다...

저렇게 되면 해당 노드값을 출력할수 있다.

수정및 저장은
$XmlContent.configuration.'system.serviceModel'.services.service.host.baseAddresses.add.baseAddress = "http://172.16.10.99:21000/MessageService.svc"
$XmlContent.configuration.'system.serviceModel'.services.service.endpoint.address = "net.tcp://172.16.10.99:20000/MessageService.svc"
$xmlContent.Save("c:\web.config")

머 이렇게 save를 하니까 잘되었다 하지만 인코딩이 좀 이상하다 확인해보아야할 부분이다.

powershll xml control에 대한 정보는 여기서 많이 얻을수 있다.
http://powershell.com/cs/blogs/tobias/archive/2009/02/02/xml-part-2-write-add-and-change-xml-data.aspx

출처 : http://hackss.tistory.com/entry/ps-xml-file-control-%ED%95%98%EA%B8%B0

Powershell 관련 Site

powershell simple menu

http://www.blkmtn.org/powershell-a-simple-menu

dictionary 사용

http://devcentral.f5.com/weblogs/Joe/archive/2008/12/29/powershell-abcs---g-is-for-generics.aspx

array 사용

http://blogs.sybase.com/powerbuilder/2009/07/powerscript-array-enhancement/

또 다른 hashtable 사용법(serer core 버전에서 위의 dictionary가 안되서 이걸썼다)

http://mow001.blogspot.com/2006/09/powershell-learn-about-hashtable_07.html

http://blogs.technet.com/b/heyscriptingguy/
http://blogs.technet.com/b/heyscriptingguy/rss.aspx

1) http://get-scripting.blogspot.com/  (이것은 iTunes에서 Podcast로 제공하기도 한다;get-scripting)
여기서 올린 자료를 RSS로 구독할 수 있다.

다음은 PowerShell 전문 블로그이다.
2) http://csharpening.net/  (여기는 PowerShell 3.0에 대한 내용을 다루고 있다.)

powershel l관련 community.
http://powershellcommunity.org



Learning Resources For Learning PowerShell
See below for sections on Commercial training, free online traning and books.
Commercial Training
CBT Nuggets: On The Job Training Series: Windows PowerShell
http://www.cbtnuggets.com/webapp/product?id=456

K Alliance: Windows PowerShell Training Courses
http://www.kalliance.com/microsoft-it/windows-powershell.htm

KOENIG: PowerShell for Windows Server 2008
http://www.koenig-solutions.com/training/Powershell_admin2008.asp?gclid=COy62pzC6JoCFQQ9ZgodHzZ2CA
Microsoft: Automating Administration with Windows PowerShell 2.0
Course 10325: Five days; Instructor led. Covers V2.
Official MOC
http://www.microsoft.com/learning/en/us/Course.aspx?ID=10325a
Microsoft: Automating Windows Server 2008 Administration with Windows PowerShell
Course 6434: Three days; Instructor-Led. Covers V1 only.
Official MOC
http://www.microsoft.com/learning/en/us/syllabi/6434afinal.mspx

Microsoft: Windows PowerShell for Administrators
Course 50025A: Three days; Instructor-Led. Covers V1 only.
Courseware Library
http://www.microsoft.com/learning/en/us/syllabi/50025afinal.mspx

PS Partnership
Custom PowerShell V1 and V2 Training on your site - world wide!
Contact: DoctorDNS@Gmail.Com
SAPIEN: Self-paced Training, Online Training, Classroom Training, and Private On-site Training
http://www.scriptinganswers.com/Training.asp

The SANS Institute PowerShell Training COurse
http://www.windowspowershelltraining.com/

TrainSiganl: Exchange Server 2007 PowerShell Course Outline
http://www.trainsignal.com/product_master_page_exchange_server_2007_powershell.aspx?ProductId=36

Verhoef Training: Windows PowerShell (UK)
http://www.verhoef-training.co.uk/outlines/WNPS.htm
Winstructor: Windows PowerShell Training
http://www.winstructor.com/products/Windows-PowerShell-Training.html

Free Online Training
ExclusivelyExchange provides excellent free online resources for learning more about PowerShell and Exchange.
Books
Mastering PowerShell - a free e-book by Dr Tobias Weltner
http://powershell.com/Mastering-PowerShell.pdf
Windows PowerShell in Action (1st Edition)
http://www.manning.com/payette/
Windows PowerShell in Action (2nd Edition)
http://www.manning.com/payette2/ (in progress currently - MEAP)
Windows PowerShell™ v2.0:TFM
http://www.sapienpress.com/powershell3.asp
The first edition is available for free at:
http://www.primaltools.com/downloads/communitytools/ under the PowerShell TFM V1 ebook section.
Windows PowerShell Pocket Reference:
http://oreilly.com/catalog/9780596521783/
Windows PowerShell(TM) 2.0 Administrator's Pocket Consultant:
http://www.microsoft.com/learning/en/us/Book.aspx?ID=12789&locale=en-us
PowerShell in Practice:
http://www.manning.com/siddaway/ (in progress currently - MEAP)
Effective Windows PowerShell:
http://keithhill.spaces.live.com/blog/cns!5A8D2641E0963A97!6930.entry
 (free ebook)

Windows PowerShell tips (Don Jones):
http://www.concentratedtech.com/upload/2/21powershelltips.pdf
www.concentratedtech.com/upload/2/21powershelltips.pdf
Topic Specific Books
Managing Active Directory with Windows PowerShell: TFM®:
http://www.sapienpress.com/ad.asp 
Managing VMWare Infrastructure with Windows PowerShell: TFM®:
http://www.sapienpress.com/vmware.aspMicrosoft SQL Server 2008 
Professional Windows PowerShell for Exchange Server 2007 Service =Pack 1:
http://www.wrox.com/WileyCDA/WroxTitle/Professional-Windows-PowerShell-for-Exchange-Server-2007-Service-Pack-1.productCd-0470226447.html
www.wrox.com/WileyCDA/WroxTitle/Professional-Windows-PowerShell-for-Exchange-Server-2007-Service-Pack-1.productCd-0470226447.html
Scripting SQL Management Objects in Windows PowerShell:
http://www.wrox.com/WileyCDA/WroxTitle/Scripting-SQL-Management-Objects-in-Windows-PowerShell.productCd-0470279354.html 
Microsoft PowerShell, VBScript & JScript Bible:
http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470386800,descCd-description.html
eu.wiley.com/WileyCDA/WileyTitle/productCd-0470386800,descCd-description.html