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
# 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)))
# 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'
# Parameters
# Example
# $user = "admin"
# $pass = "admin"
# $instansname = "dev00000"
# $targettablename = "incident"
# $baselocalpath = "C:\snowapi\"
# $outfilename = "incident.xls"
$user = "admin"
$pass = "admin"
@akrnmd
akrnmd / SpecifyTheDragAndDropPointByScreenRatio.script
Last active October 3, 2020 00:01
Specify The Drag and Drop (Swipe) Point By Screen Ratio. #SenseTalk #eggplant
drag (remotescreensize().x*0.5,remotescreensize().y-1)
wait 1
moveto (remotescreensize()*0.5)
wait 1
drag (remotescreensize().x,remotescreensize().y*0.5)
drop
wait 10
typetext homebutton
@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 / CaptureAndCompareTwoImages.script
Last active October 3, 2020 00:01
Capture and compare two images. #SenseTalk #eggplant
set CaptureArea to (0, 0, 100, 100) -- Set Capture Area.
CaptureScreen "C:\Users\[UserName]\Image-Before.png", CaptureArea
//Your Actions
CaptureScreen "C:\Users\[UserName]\Image-After.png", CaptureArea
if file "C:\Users\[UserName]\Image-Before.png" as data is equal to file "C:\Users\[UserName]\Image-After.png" as data then
log "Image-Before and Image-After are same images."
@akrnmd
akrnmd / UseUserInputData.script
Last active October 3, 2020 00:01
Use User Input Data. #SenseTalk #eggplant
ask "Enter your name:"
log it
@akrnmd
akrnmd / UseGherkinSample.script
Last active October 3, 2020 00:00
UseGherkinSample. #SenseTalk #eggplant
(* add to file of "UseGherkinSample.feature" *)
//Feature: Get Screen Capture
// Scenario: Get Screen Capture
// Given connect "localhost"
// When get screenshot
// Then disconnect "localhost"
(* UseGherkinSample.script *)
to handle connect_STR
params str1
@akrnmd
akrnmd / ReadTheMatrix.script
Last active October 3, 2020 00:00
Read The Matrix. #SenseTalk #eggplant
Put Imagelocation("X-ImageName").x into LocationX
Put Imagelocation("Y-ImageName").y into LocationY
Log ReadText(LocationX, LocationY)