Skip to content

Instantly share code, notes, and snippets.

View akrnmd's full-sized avatar
🌴
On vacation

kin arima akrnmd

🌴
On vacation
View GitHub Profile
# Parameters
# Example
# $user = "admin"
# $pass = "admin"
# $instansname = "dev00000"
# $targettablename = "incident"
# $baselocalpath = "C:\snowapi\"
# $outfilename = "incident.xls"
$user = "admin"
$pass = "admin"
# https://arm-lab.blogspot.com/2021/03/servicenowpowershell.html
# Parameters
$user = "admin"
$pass = "admin"
$instansname = "dev00000"
$SysID = "8180046a2fba601033e449e72799b680"
$BasePath = "C:\"
# Build auth header
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $user, $pass)))
@akrnmd
akrnmd / SwipeUpUntilTargetimage.script
Last active March 11, 2021 14:19
Procedure to repeat swipe up until targetimage is found. #SenseTalk #eggplant
function SwipeUpToTarget targetimage
//call example:
//get myfunctions.SwipeUpToTarget("[targetimage]")
Repeat until ImageFound(Image: targetimage, WaitFor:1)
SwipeUp
wait 1
End repeat
return
end SwipeUpToTarget
# Params @ Local
$XLSXFileName = "xxxx.xls/xlsx"
$XLSXFilePath = "C:\"
# Params @ SNOW
$InstanceName = "dev00000"
$User = "admin"
$Pass = "admin"
$ImportTableName = 'u_inport_incident_by_xls/xlsx'
@akrnmd
akrnmd / import_table_by_csv.ps1
Last active March 9, 2021 14:40
https://arm-lab.blogspot.com/2021/03/powershellrest-apicsvservicenow.html Import to Servicenow table from csv file. Support multi byte character.
# Params @ Local
$CSVFileName = "xxxx.csv"
$CSVFilePath = "C:\"
# Params @ SNOW
$InstanceName = "dev00000"
$User = "admin"
$Pass = "admin"
$ImportTableName = 'u_inport_incident_by_csv'
@akrnmd
akrnmd / Proc_L1ConnectionController.py
Last active October 9, 2020 14:08
Connect/Disconnect All L1 Routes. #python #orchestrationscript #CloudShell
import cloudshell.helpers.scripts.cloudshell_scripts_helpers as helpers
# How to use this file
#
# from Proc_L1ConnectionController import L1ConnectionController
# L1CC = L1ConnectionController()
# L1CC.ChangeStateOfAllL1Routes("Connect")
class L1ConnectionController:
def __init__(self):
self.reservation_id = helpers.get_reservation_context_details().id
self.session = helpers.get_api_session()
@akrnmd
akrnmd / TripleClick.script
Last active October 3, 2020 00:03
TripleClick. #SenseTalk #eggplant
put the RemoteWorkInterval into defaultRWI
put the MouseDoubleClickDelay into clickTime
set the RemoteWorkInterval to clickTime
MoveTo "[TargetImage]"
click
click
click
set the RemoteWorkInterval to defaultRWI
@akrnmd
akrnmd / ButtonCounterByImage.script
Last active October 3, 2020 00:03
Use the tab key to move the focus and count the number of buttons on the web's continuous form. #SenseTalk #eggplant
put 0 into MyCounter
TypeText tab
repeat while ImageFound(3, "[target image name on focus]")
TypeText tab
put 1 + MyCounter into MyCounter
end repeat
log MyCounter
@akrnmd
akrnmd / ReadTextFile.script
Last active October 3, 2020 00:03
Example of reading a text file line by line and repeating processing until the last line. #SenseTalk #eggplant
set MyFile to resourcepath("textfile.txt")
repeat with MyLine = each line of file MyFile
typetext MyLine, returnKey
end repeat
@akrnmd
akrnmd / ForEachOfImageCollection.script
Last active October 3, 2020 00:03
Click all the images in the image collection one by one. #SenseTalk #eggplant
repeat with CurrentImage = each item of ImageInfo("[collection name]")
Click (Image:CurrentImage.imagepath, WaitFor:5)
end repeat