Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴
On vacation

kin arima akrnmd

🌴
On vacation
View GitHub Profile
View get_an_attachment_file_by_sysid.ps1
# 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)))
View import_table_by_xls-xlsx.ps1
# 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 Mar 9, 2021
https://arm-lab.blogspot.com/2021/03/powershellrest-apicsvservicenow.html Import to Servicenow table from csv file. Support multi byte character.
View import_table_by_csv.ps1
# Params @ Local
$CSVFileName = "xxxx.csv"
$CSVFilePath = "C:\"
# Params @ SNOW
$InstanceName = "dev00000"
$User = "admin"
$Pass = "admin"
$ImportTableName = 'u_inport_incident_by_csv'
View export_table_with_all_column.ps1
# 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 Oct 3, 2020
Specify The Drag and Drop (Swipe) Point By Screen Ratio. #SenseTalk #eggplant
View SpecifyTheDragAndDropPointByScreenRatio.script
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 Oct 9, 2020
Connect/Disconnect All L1 Routes. #python #orchestrationscript #CloudShell
View Proc_L1ConnectionController.py
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 Oct 3, 2020
Capture and compare two images. #SenseTalk #eggplant
View CaptureAndCompareTwoImages.script
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 Oct 3, 2020
Use User Input Data. #SenseTalk #eggplant
View UseUserInputData.script
ask "Enter your name:"
log it
@akrnmd
akrnmd / UseGherkinSample.script
Last active Oct 3, 2020
UseGherkinSample. #SenseTalk #eggplant
View UseGherkinSample.script
(* 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 Oct 3, 2020
Read The Matrix. #SenseTalk #eggplant
View ReadTheMatrix.script
Put Imagelocation("X-ImageName").x into LocationX
Put Imagelocation("Y-ImageName").y into LocationY
Log ReadText(LocationX, LocationY)