tools4powershell is a collection of some useful functions for powershell :)
Usage: pscat [-h|--help] [-n] [input ...]
Concatenate input(s), or standard input, to standard output.
-e encoding encoding for get-content called internally
-n number all output lines
Usage: psgrep [-h|--help] [-v] [-i] regex [input ...]
Search for regex in each input or standard input.
-v select non-matching lines
-i ignore case distinctions
-e encoding encoding for get-content called internally
Usage: pswcl [-h|--help] [input ...]
Print newline counts for each input, and a total line if more than one input is specified.
-e encoding encoding for get-content called internally
Usage: pssed [-h|--help] regex string [input ...]
For each substring matching regex in each lines from input, substitute the string.
-e encoding encoding for get-content called internally
Usage: pshead [-h|--help] [-l line_number] [input ...]
Print the first 10 lines of each input to standard output.
With no input, read standard input.
-l line_number print the first line_number lines instead of the first 10
-e encoding encoding for get-content called internally
Usage: pstail [-h|--help] [-l line_number] [input ...]
Print the last 10 lines of each input to standard output.
With no input, read standard input.
-l line_number print the last line_number lines instead of the last 10
-e encoding encoding for get-content called internally
Usage: pscut [-h|--help] [-d "delimiter"] -i "index,..." [input ...]
Print selected parts of lines from each input to standard output.
With no input, read standard input.
-d "delimiter" use "delimiter" instead of "," for field delimiter
-i "index,..." select only these fields(0 origin)
-e encoding encoding for get-content called internally
Usage: pstee [-h|--help] [output ...]
Copy standard input to each output, and also to standard output.
Usage: psuniq [-h|--help] [-d|-c] [input ...]
Filter adjacent matching lines from input (or standard input),
writing to standard output.
With no options, matching lines are merged to the first occurrence.
-d only print duplicate lines
-c prefix lines by the number of occurrences
-e encoding encoding for get-content called internally
Usage: psjoin [-h|--help] [-d "delimiter"] [-1 "index,..."] [-2 "index,..."] [-a [m|1|2|12|21]] [-m [1|2]] [-e1 encoding] [-e2 encoding] input1 input2
For each pair of input lines with identical join fields, write a line to
standard output. The default join field is the first, delimited by ",".
-d "delimiter" use "delimiter" as input and output field separator instead of ","
-1 "index,..." join on this index(s) of file 1 (default 0)
-2 "index,..." join on this index(s) of file 2 (default 0)
-a m write only matching lines (default)
1 write only unpairable lines from input1
2 write only unpairable lines from input2
12 write all lines from input1 and matching lines from input2
21 write all lines from input2 and matching lines from input1
-m [1|2] specify input which has multiple join fields
-e1 encoding encoding for file 1(default 0 means Default)
-e2 encoding encoding for file 2(default 0 means Default)
Usage: psxls2csv [-h|--help] [-i input] [-s sheet] [-o [output|-]]
Convert specified excel sheet to csv.
If input is not specified, all excel files in current directory will be converted.
If output is not specified, input will be converted into same filename, but with extention ".csv".
If "-" is specified for "-o" option, input will be converted into stdout.
-e encoding encoding for get-content called internally
BUGS
If input is not specified and output is specified, only last excel sheet in current directory will remain in output file.
Usage: psxls2sheetname [-h|--help] [-i input] [-s sheet]
Print sheet name identified by sheet.
If sheet is omitted, print all sheet names.
Usage: psprint [-h|--help] [arg ...]
Print arguments to standard output.
Usage: pstmpfile [-h|--help]
Print temporary file path to standard output.
Usage: psabspath [-h|--help] file
Print absolute file path for file to standard output.
Usage: psreadpassword [-h|--help]
Get password safely from console and decrypt and print it to console.
Usage: psconwrite [-h|--help] [arg ...]
Print arguments to console without newline.
Usage: psconwriteline [-h|--help] [arg ...]
Print arguments to console with newline.
Usage: psconreadline [-h|--help]
Read line and print it to console with newline.
Usage: psopen [-h|--help] [[-r|-w|-a] [inputfile|output]] [-e encoding]
Open IO.Stream and get object.
ex. Handle as text
$inObj = psopen -r "input.txt"
$outObj = psopen -w "output.txt"
while (($rec = $inObj.readLine()) -ne $null){
$outObj.writeLine($rec)
}
$inObj.close()
$outObj.close()
ex. Handle data as binary
$arrayByte = New-Object byte[] (1024)
$inObj = psopen -r "input.txt"
$outObj = psopen -w "output.txt"
$read_length = $inObj.BaseStream.Read($arrayByte, 0, $arrayByte.length)
while ($read_length -gt 0){
$outObj.BaseStream.Write($arrayByte, 0, $read_length)
$read_length = $inObj.BaseStream.Read($arrayByte, 0, $arrayByte.length)
}
$inObj.close()
$outObj.close()
Usage: psconvenc -i inputfile -ie encoding -o outputfile -oe encoding
Usage: psexcel_open excel_file
Open excel_file and get excel_object for it.
ex.
$xls = psexcel_open "Foo.xlsx"
Usage: psexcel_update excel_object
Save by overwrite.
ex.
psexcel_update $xls
Usage: psexcel_save excel_object excel_file
Save into excel_file.
ex.
psexcel_save $xls "Foo.xlsx"
Usage: psexcel_close excel_object
Close excel file by excel_object.
ex.
psexcel_close $xls
Usage: psexcel_getCell excel_object sheet range
Get value from range on sheet.
ex.
$val1 = psexcel_getCell $xls "Sheet1" "A1"
$val2 = psexcel_getCell $xls 2 "B2"
Usage: psexcel_setCell excel_object sheet range value
Set value on range on sheet.
ex.
psexcel_setCell $xls "Sheet1" "A1" "some text"
psexcel_setCell $xls 2 "C3" "=A1+B2"
Usage: psexcel_getFormula excel_object sheet range
Get formula from range on sheet.
ex.
$f1 = psexcel_getFormula $xls "Sheet1" "A1"
$f2 = psexcel_getFormula $xls 2 "B2"
Usage: psexcel_setFormula excel_object sheet range formula
Set formula on range on sheet.
ex.
psexcel_setFormula $xls "Sheet1" "A1" "=A1+B2"
psexcel_setFormula $xls 2 "B2" "=C3+D4"
Usage: psexcel_getBackgroundColor excel_object sheet range
Get index of background color from range on sheet.
ex.
$colIndex1 = psexcel_getBackgroundColor $xls "Sheet1" "A1"
$colIndex2 = psexcel_getBackgroundColor $xls 2 "B2"
Usage: psexcel_setBackgroundColor excel_object sheet range color_index
Set background color to color_index on range on sheet.
ex.
psexcel_setBackgroundColor $xls "Sheet1" "A1" 1
psexcel_setBackgroundColor $xls 2 "B2" 3
Usage: psexcel_getForegroundColor excel_object sheet range
Get index of foreground color from range on sheet.
ex.
$colIndex1 = psexcel_getForegroundColor $xls "Sheet1" "A1"
$colIndex2 = psexcel_getForegroundColor $xls 2 "B2"
Usage: psexcel_setForegroundColor excel_object sheet range color_index
Set foreground color to color_index on range on sheet.
ex.
psexcel_setForegroundColor $xls "Sheet1" "A1" 1
psexcel_setForegroundColor $xls 2 "B2" 3
Usage: psexcel_getBold excel_object sheet range
Get $true or $false about bold from range on sheet.
ex.
$boolean1 = psexcel_getBold $xls "Sheet1" "A1"
$boolean2 = psexcel_getBold $xls 2 "B2"
Usage: psexcel_turnonBold excel_object sheet range
Turn on bold on range on sheet.
ex.
psexcel_turnonBold $xls "Sheet1" "A1"
psexcel_turnonBold $xls 2 "B2"
Usage: psexcel_turnoffBold excel_object sheet range
Turn off bold on range on sheet.
ex.
psexcel_turnoffBold $xls "Sheet1" "A1
psexcel_turnoffBold $xls 2 "B2"
Usage: psexcel_toggleBold excel_object sheet range
Toggle bold on range on sheet.
ex.
psexcel_toggleBold $xls "Sheet1" "A1"
psexcel_toggleBold $xls 2 "B2"
Usage: psexcel_getSheetCount excel_object
Get count of sheets.
ex.
$sc = psexcel_getSheetCount $xls
Usage: psexcel_getSheetName excel_object sheet
Get name of sheet.
ex.
$sn = psexcel_getSheetName $xls 2
Usage: psexcel_setSheetName excel_object sheet name
Set name of sheet.
ex.
psexcel_setSheetName $xls "Sheet1" "SHEET1"
psexcel_setSheetName $xls 2 "SHEET2"
Usage: psexcel_getActiveSheetName excel_object
Get name of active sheet.
ex.
$sn = psexcel_getActiveSheetName $xls
Usage: psexcel_setActiveSheetName excel_object name
Set name of active sheet.
ex.
psexcel_setActiveSheetName $xls "SHEET1"
Usage: psexcel_copyCell excel_object source_sheet source_range dest_sheet dest_cell
Copy range of cell to another cell.
ex.
psexcel_copyCell $xls "Sheet1" "A1:C3" "sheet2" "D4"
psexcel_copyCell $xls 1 "A1:C3" 2 "D4"
Usage: psexcel_replaceString excel_object sheet range before_string after_string
Replace string to another string.
ex.
psexcel_replaceString $xls "Sheet1" "A1:C3" "#1#" "Hoge"
psexcel_replaceString $xls 1 "A1:C3" "#1#" "Hoge"
Usage: psexcel_preview excel_object sheet
Print preview sheet.
ex.
psexcel_preview $xls "Sheet1"
psexcel_preview $xls 2
Usage: psexcel_print excel_object sheet
Print sheet.
ex.
psexcel_print $xls "Sheet1"
psexcel_print $xls 2
Usage: psexcel_turnonVisible excel_object
Turn on visible.
ex.
psexcel_turnonVisible $xls
Usage: psexcel_turnoffVisible excel_object
Turn off visible.
ex.
psexcel_turnoffVisible $xls
Usage: psexcel_turnonAlert excel_object
Turn on displayAlerts.
ex.
psexcel_turnonAlert $xls
Usage: psexcel_turnoffAlert excel_object
Turn off displayAlerts.
ex.
psexcel_turnoffAlert $xls
Usage: psprov [-p] [-d "DELIMITER"] -o OVERLAY.XLS [-i INPUT.CSV] -f FORMAT.TXT
Print formatted data with overlay
-p preview mode.
-d "DELIMITER" use DELIMITER instead of comma for INPUT.CSV.
-o OVERLAY.XLS overlay definition by excel.
-i INPUT.CSV input data in csv format. If omitted then read stdin.
-f FORMAT.TXT format definition for INPUT.CSV.
each line should have like "A1=1"
"A1=1" means "A1" cell in OVERLAY.XLS should be setted to "1st column" in INPUT.CSV
Usage: psoracle_open oracle_ip_address username password
Connect to oracle.
ex.
$ocon = psoracle_open "127.0.0.1" "taro" "himitsu"
Usage: psoracle_close oracle_connection
Disconnect from oracle.
ex.
psoracle_close $ocon
Usage: psoracle_createsql oracle_connection sql_command
Create SQL object with bind parameter.
ex.
$ocmd = psoracle_createsql $ocon "select * from table where id=:id_value"
... something to do ...
psoracle_free $ocmd
Usage: psoracle_bindsql oracle_command name value
Bind real value to bind variable.
ex.
$id_value = psoracle_bindsql $ocmd "id_value" "12345"
Usage: psoracle_unbindsql oracle_command bind_object
Unbind bind variable.
ex.
psoracle_unbindsql $ocmd $id_value
Usage: psoracle_execupdatesql oracle_command
Exuceute SQL with update.
ex.
$count = psoracle_execupdatesql $ocmd
if ($count -lt 0){
write-output "Error: update SQL"
}
Usage: psoracle_execsql oracle_command
Exuceute SQL without update.
ex.
$ocr = psoracle_execsql $ocmd
... something to do ...
psoracle_free $ocr
Usage: psoracle_fetch ([Ref]oracle_reader)
Fetch row.
ex.
while (psoracle_fetch ([Ref]$ocr)){
write-output $ocr["id"]
}
Usage: psoracle_free oracle_object
Free object for oracle access.
ex.
psoracle_free $ocr
psoracle_free $ocmd
Usage: psoracle_begin oracle_connection
Begin transaction.
ex.
$otran = psoracle_begin $ocon
Usage: psoracle_settran oracle_command oracle_transaction
Set transaction for oracle command.
ex.
psoracle_settran $ocmd $otran
Usage: psoracle_rollback oracle_transaction
Rollback transaction.
ex.
psoracle_rollback $otran
Usage: psoracle_commit oracle_transaction
Commit transaction.
ex.
psoracle_commit $otran
Usage: pssock_open server_ip server_port [encoding]
Open socket for client.
ex.
$param = pssock_open "127.0.0.1" "12345" "UTF-8"
Usage: pssock_close socket_param
Close socket for client.
ex.
pssock_close $param
Usage: pssock_readline socket_param
Read a line from socket.
ex.
$line = pssock_readline $param
Usage: pssock_writeline socket_param string
Write a line to socket.
ex.
$stat = pssock_writeline $param $line
Usage: pssock_read socket_param array_byte length
Read data as binary from socket.
ex.
$arrayByte = New-Object byte[] (1024)
$read_length = pssock_read $param $arrayByte $arrayByte.length
Usage: pssock_write socket_param array_byte length
Write data as binary to socket.
ex.
$arrayByte = New-Object byte[] (1024)
$stat = pssock_write $param $arrayByte $arrayByte.length
Usage: pssock_start server_port
Start server.
ex.
$server = pssock_start "12345"
Usage: pssock_stop server
Stop server.
ex.
pssock_stop $server
Usage: pssock_accept server [encoding]
Accept connection from client.
ex.
$param = pssock_accept $server "UTF-8"
Usage: pssock_unaccept socket_param
Unaccept(disconnect) connection from client.
ex.
pssock_unaccept $param
Usage: pssock_getip socket_param
Get ip-address of client.
ex.
$ip = pssock_getip $param
Usage: pssock_getipstr socket_param
Get ip-address string of client.
ex.
$ip = pssock_getipstr $param
Usage: pssock_getport socket_param
Get port of client.
ex.
$ip = pssock_getport $param
Usage: pssock_getportstr socket_param
Get port string of client.
ex.
$ip = pssock_getportstr $param
Usage: psrunspc_getarraylist
Get System.Collections.ArrayList.
ex.
$refArray = psrunspc_getarraylist
$Array0 = $ref.Array.value[0]
Usage: psrunspc_open max_runspace
Create and Open RunSpacePool.
ex.
$rsp = psrunspc_open 10
... something to do ...
psrunspc_close $rsp
Usage: psrunspc_close run_space_pool
Close RunSpacePool.
ex.
$rsp = psrunspc_open 10
... something to do ...
psrunspc_close $rsp
Usage: psrunspc_createthread run_space_pool script_block
Create thread of powershell and add script to it.
ex.
$ps = psrunspc_createthread $rsp $script
Usage: psrunspc_addargument thread_of_powershellargument
Add argument to thread of powershell.
ex.
psrunspc_addargument $argument
Usage: psrunspc_begin thread_of_powershell arraylist_of_powershell arraylist_of_child
Begin script in thread.
ex.
$refAryps = psrunspc_getarraylist
$refArych = psrunspc_getarraylist
... something to do ...
psrunspc_begin $ps $refAryps.value $refArych.value
Usage: psrunspc_wait arraylist_of_powershell arraylist_of_child
Wait terminate of all child thread.
ex.
psrunspc_wait $refAryps.value $refArych.value
Usage: psrunspc_waitasync arraylist_of_powershell arraylist_of_child
Wait asynchronously terminate of all child thread.
ex.
psrunspc_waitasync $refAryps.value $refArych.value
Usage: psrpa_init
Initialize rpa environment.
ex.
$rpa = psrpa_init
Usage: psrpa_setBeforeWait rpa_object wait_time_ms
Set a time(ms) for waiting before functions(psrpa_*).
Usage: psrpa_setAfterWait rpa_object wait_time_ms
Set a time(ms) for waiting after functions(psrpa_*).
Usage: psrpa_showMouse rpa_object
Show current mouse position for debug purpose.
psrpa_showMouseByClick - Show current mouse position for psrpa_setMouse and psrpa_clickPoint by click
Usage: psrpa_showMouseByClick rpa_object [wait_sec]
Show current mouse position for psrpa_setMouse and psrpa_clickPoint by click.
Press any key to terminate.
wait_sec default 5
ex.
$wait_sec = 10
psrpa_showMouseByClick $rpa $wait_sec
Usage: psrpa_setMouse rpa_object x_position y_position
Set mouse position.
ex.
$x = 10
$y = 20
psrpa_setMouse $rpa $x $y
Usage: psrpa_click rpa_object mouse_button click_action
Click mouse button.
mouse_button left, LEFT, l, L
middle, MIDDLE, m, M
right, RIGHT, r, R
click_action click, CLICK, 1
2click, 2CLICK, 2
3click, 3CLICK, 3
down, DOWN, d, D
up, UP, u, U
ex.
psrpa_click $rpa "left" "click"
Usage: psrpa_clickPoint rpa_object x_position y_position mouse_button click_action
Set mouse position and click mouse button.
mouse_button left, LEFT, l, L
middle, MIDDLE, m, M
right, RIGHT, r, R
click_action click, CLICK, 1
2click, 2CLICK, 2
3click, 3CLICK, 3
down, DOWN, d, D
up, UP, u, U
ex.
$x = 10
$y = 20
psrpa_clickPoint $rpa $x $y "left" "click"
Usage: psrpa_showAppTitle rpa_object
Show application and title.
Usage: psrpa_activateWindow rpa_object application title
Activate specified window
application "" means "^$", $null means "^.*$"
title "" means "^$", $null means "^.*$"
ex.
$application = "notepad"
$title = "no title - memo pad"
psrpa_activateWindow $rpa $application $title
Usage: psrpa_setWindow application rpa_object title x_position y_position width height
Set window position and size
application "" means "^$", $null means "^.*$"
title "" means "^$", $null means "^.*$"
ex.
$application = "notepad"
$title = "no title - memo pad"
$x = 10
$y = 20
$width = 300
$height = 400
psrpa_setWindow $rpa $application $title $x $y $width $height
Usage: psrpa_sendKeys rpa_object string
Send keys(string, function, special keys etc)
string any-string
{BS} for backspace
{DEL} for delete
{PRTSC} for print screen
{ENTER} for enter
{LEFT} for left arrow
{F1} for F1
^a for CTRL-a
+a for SHIFT-a
%a for ALT-a
other keys - search by google :P
ex.
psrpa_sendKeys $rpa "any string"
psrpa_sendKeys $rpa "{BS}"
psrpa_sendKeys $rpa "^a"
Usage: psrpa_sendKeyEx rpa_object virtual_keycode action isExtended
Send a key(Both of normal key and extended key are acceptable)
virtual_keycode see https://msdn.microsoft.com/ja-jp/windows/desktop/dd375731
action "down", "DOWN", "d", "D"
"up", "UP", "u", "U"
isExtended $true or $false
see https://learn.microsoft.com/en-us/windows/win32/inputdev/about-keyboard-input#extended-key-flag
https://kusidate.blog.fc2.com/blog-entry-31.html
ex.
$right_ctrl = 0xa3
psrpa_sendKeyEx $rpa $right_ctrl "send" $true
Usage: psrpa_setClipboard rpa_object string
Set clipboard to string.
Caution!
powershell.exe have to be invoked with -sta option.
ex.
psrpa_setClipboard $rpa "any string"
Usage: psrpa_getClipboard rpa_object
Get string from clipboard.
Caution!
powershell.exe have to be invoked with -sta option.
ex.
$str = psrpa_getClipboard $rpa
Usage: psrpa_getBmp rpa_object left_x top_x right_x bottom_y output.bmp
Get image into file(BMP).
Output file name will be (left_x)_(top_y)_(right_x)_(bottom_y)_output.bmp.
ex.
psrpa_getBmp $rpa 10 10 200 100 "icon.bmp"
Usage: psrpa_getBmpByClick rpa_object output.bmp [wait_sec]
Get image into file(BMP) by click.
Output file name will be (left_x)_(top_y)_(right_x)_(bottom_y)_output.bmp.
Mouse cursor is CROSS for pointing (left_x, top_y).
HAND for pointing (right_x, bottom_y).
Press any key to terminate.
wait_sec default 5
ex.
$wait_sec = 10
psrpa_getBmpByClick $rpa "icon.bmp" $wait_sec
Usage: psrpa_compareBmp rpa_object left_x top_x right_x bottom_y input.bmp
Compare specifoed rectangle and bmpfile.
Return $true when specified rectangle and input.bmp are same.
ex.
$bool = psrpa_compareBmp $rpa 10 10 200 100 "icon.bmp"
if ($bool){
write-output "match"
}else{
write-output "not match"
}
Usage: psrpa_isSameBmp rpa_object left top input.bmp
Compare rectangle starts with specified point and bmpfile.
Return $true when same bmp.
ex.
$bool = psrpa_isSameBmp $rpa 10 10 "icon.bmp"
if ($bool){
write-output "match"
}else{
write-output "not match"
}
Usage: psrpa_searchBmp rpa_object left_x top_x right_x bottom_y input.bmp
Search bmpfile in screen.
Return @(left,top,right,bottom) when bmpfile is found in screen.
ex.
$pos = psrpa_searchBmp $rpa $null $null $null $null "icon.bmp"
if ($pos[0] -lt 0){
write-output "not found"
}else{
write-output "found"
$left = $pos[0]
$top = $pos[1]
$right = $pos[2]
$bottom = $pos[3]
}
Usage: psrpa_searchBmpPosition rpa_object input.bmp
Get position of bmpfile in whole screen.
Return @(left,top,width,height) when bmpfile is found in screen.
ex.
$pos = psrpa_searchBmpPosition $rpa "icon.bmp"
if ($pos[0] -lt 0){
write-output "not found"
}else{
write-output "found"
$left = $pos[0]
$top = $pos[1]
$width = $pos[2]
$height = $pos[3]
}
Usage: psrpa_waitBmp rpa_object bmp_file
Wait appearnce of specified bmp.
ex.
psrpa_waitBmp $rpa "icon.bmp"
Usage: psrpa_waitBmpVanished rpa_object bmp_file
Wait vanishing of specified bmp.
ex.
psrpa_waitBmpVanished $rpa "icon.bmp"
Usage: psrpa_clickBmp rpa_object bmp_file button click
Click specified bmp.
ex.
psrpa_clickBmp $rpa "icon.bmp" "left" "click"
Usage: psrpa_uia_show_element rpa_object element
Show child ui-automation element information in specified elemment.
element "" or $null mean root-window
ex.
psrpa_uia_show_element $rpa $element
psrpa_uia_show_element_recursive - Show recursively child ui-automation element information in specified elemment
Usage: psrpa_uia_show_element_recursive rpa_object element
Show recursively child ui-automation element information in specified elemment.
element "" or $null mean root-window
ex.
psrpa_uia_show_element_recursive $rpa $element
Usage: psrpa_uia_show_element_all rpa_object element
Show all ui-automation element information in specified elemment.
element "" or $null mean root-window
ex.
psrpa_uia_show_element_all $rpa $element
This is obsolete. Use psrpa_uia_show_element_recursive instead.
Usage: psrpa_uia_show rpa_object
Show all ui-automation element information in root-window.
ex.
psrpa_uia_show $rpa
This is obsolete. Use psrpa_uia_show_element_recursive instead.
Usage: psrpa_uia_get_element rpa_object parent_element class_name localized_controlname name
Get child ui-automation element.
parent_element "" or $null mean root-window
class_name "" means "^$", $null means "^.*$"
localized_controlname
name
ex.
$app = psrpa_uia_get_element $rpa $null "Notepad" "ウィンドウ" "無題 - メモ帳"
$help = psrpa_uia_get_element $rpa $app "" "メニュー項目" "ヘルプ\(H\)"
Usage: psrpa_uia_get_element_all rpa_object parent_element class_name localized_controlname name
Get all ui-automation element in specfied element.
parent_element "" or $null mean root-window
class_name "" means "^$", $null means "^.*$"
localized_controlname
name
ex.
$app = psrpa_uia_get_element_all $rpa $null "Notepad" "ウィンドウ" "無題 - メモ帳"
$help = psrpa_uia_get_element_all $rpa $app "" "メニュー項目" "ヘルプ\(H\)"
Usage: psrpa_uia_get rpa_object parent_element class_name localized_controlname name
Get all ui-automation element in root window.
class_name "" means "^$", $null means "^.*$"
localized_controlname
name
ex.
$app = psrpa_uia_get $rpa "Notepad" "ウィンドウ" "無題 - メモ帳"
$help = psrpa_uia_get $rpa "" "メニュー項目" "ヘルプ\(H\)"
Usage: psrpa_uia_getGeometry rpa_object element
Get geometry of ui-automation element(*Pattern).
ex.
$elm = psrpa_uia_get ...snip...
$geo = psrpa_uia_getGeometry $rpa $elm
$x = $geo[0]
$y = $geo[1]
$width = $geo[2]
$height = $geo[3]
Usage: psrpa_uia_invoke rpa_object element
Invoke ui-automation element(InvokePattern).
ex.
$elm = psrpa_uia_get ...snip...
psrpa_uia_invoke $rpa $elm
Usage: psrpa_uia_expand rpa_object element
Expand ui-automation element(ExpandCollapsePattern).
ex.
$elm = psrpa_uia_get ...snip...
psrpa_uia_expand $rpa $elm
Usage: psrpa_uia_close rpa_object element
Close ui-automation element(WindowPattern).
ex.
$elm = psrpa_uia_get ...snip...
psrpa_uia_close $rpa $elm
Usage: psrpa_uia_setValue rpa_object element value
Set value into ui-automation element(ValuePattern).
ex.
$elm = psrpa_uia_get ...snip...
psrpa_uia_setValue $rpa $elm "any-string"
Usage: psrpa_uia_getText rpa_object element
Get text from ui-automation element(TextPattern).
ex.
$elm = psrpa_uia_get ...snip...
$text = psrpa_uia_getText $rpa $elm
Usage: psrpa_uia_toggle rpa_object element
Toggle ui-automation element(TogglePattern).
ex.
$elm = psrpa_uia_get ...snip...
psrpa_uia_toggle $rpa $elm
Usage: psrpa_uia_select rpa_object element
Select ui-automation element(SelectionItem).
ex.
$elm = psrpa_uia_get ...snip...
psrpa_uia_select $rpa $elm
Usage: psrpa_uia_move rpa_object element x y
Move ui-automation element(TransformPattern).
ex.
$elm = psrpa_uia_get ...snip...
$x = 10
$y = 20
psrpa_uia_move $rpa $elm $x $y
Usage: psrpa_uia_resize rpa_object element width height
Resize ui-automation element(TransformPattern).
ex.
$elm = psrpa_uia_get ...snip...
$width = 100
$height = 200
psrpa_uia_resize $rpa $elm $width $height
Usage: psrpa_uia_getGridClassName rpa_object element row col
Get grid classname of ui-automation element(GridPattern).
ex.
$elm = psrpa_uia_get ...snip...
$row = 0
$col = 0
$classname = psrpa_uia_getGridClassName $rpa $elm $row $col
Usage: psrpa_uia_getGridControlType rpa_object element row col
Get grid controltype of ui-automation element(GridPattern).
ex.
$elm = psrpa_uia_get ...snip...
$row = 0
$col = 0
$controltype = psrpa_uia_getGridControlType $rpa $elm $row $col
Usage: psrpa_uia_getGridName rpa_object element row col
Get grid name of ui-automation element(GridPattern).
ex.
$elm = psrpa_uia_get ...snip...
$row = 0
$col = 0
$name = psrpa_uia_getGridName $rpa $elm $row $col
Usage: psrpa_uia_getGridColumn rpa_object element
Get grid column of ui-automation element(GridPattern).
ex.
$elm = psrpa_uia_get ...snip...
$col = psrpa_uia_getGridColumn $rpa $elm
Usage: psrpa_uia_getGridRow rpa_object element
Get grid row of ui-automation element(GridPattern).
ex.
$elm = psrpa_uia_get ...snip...
$row = psrpa_uia_getGridRow $rpa $elm
Usage: psrpa_uia_getGridItemColumn rpa_object element
Get griditem column of ui-automation element(GridItemPattern).
ex.
$elm = psrpa_uia_get ...snip...
$column = psrpa_uia_getGridItemColumn $rpa $elm
psrpa_uia_getGridItemColumnSpan - Get griditem column span of ui-automation element(GridItemPattern)
Usage: psrpa_uia_getGridItemColumnSpan rpa_object element
Get griditem column span of ui-automation element(GridItemPattern).
ex.
$elm = psrpa_uia_get ...snip...
$columnspan = psrpa_uia_getGridItemColumnSpan $rpa $elm
Usage: psrpa_uia_getGridItemRow rpa_object element
Get griditem row of ui-automation element(GridItemPattern).
ex.
$elm = psrpa_uia_get ...snip...
$row = psrpa_uia_getGridItemRow $rpa $elm
Usage: psrpa_uia_getGridItemRowSpan rpa_object element
Get griditem row span of ui-automation element(GridItemPattern).
ex.
$elm = psrpa_uia_get ...snip...
$rowspan = psrpa_uia_getGridItemRowSpan $rpa $elm
Usage: psrpa_uia_setRangeValue rpa_object element value
Set RangeValue of ui-automation element(RangeValuePattern).
ex.
$elm = psrpa_uia_get ...snip...
psrpa_uia_setRangeValue $rpa $elm 10
Usage: psrpa_uia_getRangeValue rpa_object element
Get RangeValue of ui-automation element(RangeValuePattern).
ex.
$elm = psrpa_uia_get ...snip...
$value = psrpa_uia_getRangeValue $rpa $elm
Usage: psrpa_uia_getRangeValueMax rpa_object element
Get Maximum RangeValue of ui-automation element(RangeValuePattern).
ex.
$elm = psrpa_uia_get ...snip...
$max = psrpa_uia_getRangeValueMax $rpa $elm
Usage: psrpa_uia_getRangeValueMin rpa_object element
Get Minimum RangeValue of ui-automation element(RangeValuePattern).
ex.
$elm = psrpa_uia_get ...snip...
$min = psrpa_uia_getRangeValueMin $rpa $elm
Usage: psrpa_uia_setScroll rpa_object element horizontal_percent vertical_percent
Set Scroll of ui-automation element(ScrollPattern).
ex.
$elm = psrpa_uia_get ...snip...
psrpa_uia_setScroll $rpa $elm 10 100
Usage: psrpa_uia_getScroll rpa_object element
Get Scroll of ui-automation element(ScrollPattern).
ex.
$elm = psrpa_uia_get ...snip...
$scroll = psrpa_uia_getScroll $rpa $elm
$scroll_horizontal = $scroll[0]
$scroll_vertical = $scroll[1]
psrpa_uia_getScrollHview - Get Horizontal view size(%) of Scroll of ui-automation element(ScrollPattern)
Usage: psrpa_uia_getScrollHview rpa_object element
Get Horizontal view size(%) of Scroll of ui-automation element(ScrollPattern).
ex.
$elm = psrpa_uia_get ...snip...
$horizontal_view_percent = psrpa_uia_getScrollHview $rpa $elm
psrpa_uia_getScrollVview - Get Vertical view size(%) of Scroll of ui-automation element(ScrollPattern)
Usage: psrpa_uia_getScrollVview rpa_object element
Get Vertical view size(%) of Scroll of ui-automation element(ScrollPattern).
ex.
$elm = psrpa_uia_get ...snip...
$vertical_view_percent = psrpa_uia_getScrollVview $rpa $elm
Usage: psrpa_uia_transformMove rpa_object element x y
Move ui-automation element(TransformPattern).
ex.
$elm = psrpa_uia_get ...snip...
psrpa_uia_transformMove $rpa $elm 10 20
Usage: psrpa_uia_transformResize rpa_object element width height
Resize ui-automation element(TransformPattern).
ex.
$elm = psrpa_uia_get ...snip...
psrpa_uia_transformResize $rpa $elm 100 200
Usage: psrpa_uia_getPattern rpa_object element pattern
Get pattern from ui-automation element.
pattern "Invoke"
"ExpandCollapse"
"Window"
"Value"
"Text"
"Toggle"
"SelectionItem"
"Grid"
"GridItem"
"Selection"
"RangeValue"
"Scroll"
"Transform"
"VirtualizedItem"
"ItemContainer"
"Selection"
"MultipleView"
"Table"
"TableItem"
"ScrollItem"
ex.
$elm = psrpa_uia_get ...snip...
$pattern = psrpa_uia_getPattern $rpa $elm "Invoke"
$pattern.Invoke()