logo

NJP

Triggering Python using Powershell and a MID Server - Live Coding Happy Hour 2022/07/29

Import · Jul 27, 2022 · video

[Music] do [Music] hello and welcome to live coding happy hour this is the show that uh shows you how the sausage is made we're on a mission to do something and we're not really sure how we're going to get there but we know the tools we've got at our disposal and we're going to show you and the reason we do this is because there's a lot of thought process and discussion that goes in there so we're kind of taking you through the process and helping you with the technology to show how it's really done i like to call this the antithesis of a well-polished demo this is not scripted most of the time this is not rehearsed the only preparation we do is hopefully read the api docs before we get here because that wouldn't make very exciting stuff let's get on with our introductions starting with this man right over here hi everyone i am earl ducay i am a developer advocate here at servicenow on the developer relations team uh i've been i'm about to com come across my one year anniversary here at servicenow but before that i was with higher ed in a bunch of different uh university customers doing servicenow development and i'll kick it off to lauren who is this is her first appearance on the live coding happy hour show so everyone welcome lauren um that's her first time as a developer advocate here on the show thank you earl i appreciate it um hey everybody my name is laura mcmanaman i just joined the developer advocacy team which is very exciting i've been at servicenow at the company level for past four years but doing servicenow stuff around seven uh so it's very exciting to kind of get back in the trenches moving from sales back to kind of the developer life that i was part of as a customer so i'm really pumped to be here and excited to join my first uh live coding happy hour and i'll kick it off to dhruv i put it the right way hello everyone my name is thro i work at accenture as a technical architect and five years is five six six years into servicenow ecosystem and i'm a servicenow developer mvp and a stockpiler of servicenow swags and on my [Laughter] ashitosh go to you man hey thanks i am ashutosh munoz i work at national netherlands in netherlands as a solution architect and i'm with servicenow from last nine years almost i'm also a community as well as dev mvp thanks show off my name is chuck tomasi senior developer advocate at service now i've been here since mid-2010 was a customer for a couple of years before that and there's a lot of other lines on my resume that go back into the late 70s early 80s that i won't get into here would be a show unto itself uh there is a podcast where we discussed some of that recently called uh offline with the radio brothers so check it out it just released this morning whatever their july episode was so shameless plug for that i'll be putting that on social media as well but uh we we talked about all kinds of stuff but before we do our next thing let's do our next thing and let's talk about what we're drinking all right so we try to relax on a friday here on this show so what i am drinking uh i'm back to my usual uh whiskey instead of beer uh this is a hide uh scene what is this hide single mall irish whiskey uh number seven six-year-old whiskey so excited to try i've never tried it before so this one my first step lauren so i am really excited for tokyo selfishly because i'm also on the path to becoming a sake sommelier so i picked up one of my newer bottles called kingoro which is named after the rather dry demeanor of the founder of the brewing company uh so it's a rather dry sake he looks like the guy from moving up he does he does look like carl i think from up so i'm excited to give it a go from my side there's no there are no prizes for guessing so from my side i think uh chuck you might have tried this rattler 4.0 um acetron flavor let's see how it tests i drank quite a few of those when i was in germany for a certain developer meet up a few years ago and i am hooked those are a great summertime drink and i have i think i had something similar if not the same thing i'm still working through a pack of kona brewing beer this is the longboard island lager so it is a uh i think this one's not quite crystal clear no maybe and i'm putting this into my brew ops glass from creator oh it is clear from cratercon 19. so with the drinks out of the way it's over to the main event cheers cheers good luck ashitosh we'll be uh back and watching you flail yeah what have you got for us today buddy so today we have an exciting topic basically triggering a power shell triggering a python script via powershell and that too from our mid servers well you know the first words not in my mouth are going to be earl can you predict what i'm going to tell ask them uh you need to increase your text size buddy that is correct can you see it think of the poor person watching this on their mobile device a bigger screen is that fine i'm gonna let the majority rule on this one that'll do yeah that's good 150 is usually what we aim for depends on the resolution of your screen but yeah um so today what we are going to do is actually trigger a python script which is stored on a mid server using integration of capability and that is powershell so the powershell script is used because we don't have node.js capability to do it using integration hub or an edge in grid library because that's an authentication mechanism which we have which can be used by some integration so i came up with this idea that i was searching how can we trigger a python script using service now and then one of the solution was by using our mid server and the integration of capability so there are some prerequisites before we start uh coding so we will directly go on to the prerequisites and that is on the mid server so we need a mid server which has powershell capabilities that is one important part when we have that what we need is to install power python so basically we have to download dot exe and we need to install the python for this demo purpose i have already installed a python and i can show you have to do how on did you have to do anything special to make that mid server work with powershell uh no because this is a lap version uh mid server which i got from one of the laps okay which i was trying and it already had that powershell capability okay straight out of the box does is that if i were to download the mid server onto one of my windows machines would that be a given that it's going to have that capability or i don't think it was set up from this image i believe um even in legacy workflow um the orchestration has powershell i mean i've used mid-servers for discovery i've used them for export sets i've used it for a number of things but this is all new territory for me yeah so powershell was by default available and and i think this is 2012 server yeah you can see it was there already on this so i did not explain what a mid server is sorry did we explain to the viewer what a mid server people that are watching this for the first time we have no idea what that means so basically the mid server is nothing but a stepping stone server which we have within a client's environment which allows the communication to our servicenow instance to the client's environment so within a vpn we have this server it's a java application which we need to install on a windows server on a linux server which facilitates the communication between the service now instance and the client network so if we have some applications or tools running within a client environment and if you want to do an integration with them for example discovery event management service mapping and this kind of integration which we will see today in that case this server acts as a stepping stone server and communication channel one thing which is very important to keep in mind with respect to the mid server is servicenow instance never talk with the mid server it is mid server who talks with the instance and keeps pulling and checking for the job which he needs to do so most of the times i have seen many people get confused with it so this is an important point to note on that yeah the the customers always freak out they go what i had am i gonna have to poke holes in my firewall the answer is no the mid server initiates the conversations it checks in with the instance he goes is there any work for me is there any work for me is there any work for me on part 43 and if your firewall doesn't have outbound 443 you have other issues yeah indeed um then the another prerequisite is we need to do something with respect to pythons because python has its own libraries which are used uh by python when we need to do let's say a concatenation of a string if you want to do a rest call if you want to build adjacent response back from that python script to our flow designer code we have to install some libraries so what i'm going to do is first check if python is installed and how we are going to do that is basically let's say i'm going to open a powershell like this i know this is very small but the resolution of the mid server itself is very small so please bear with me um i'm going to zoom this a bit let's see if this works no but i have a script here which says uh which first checks if the python is installed or not and to do that what i'm going to do is i'm just going to run this locate python script basically i can do it in two ways either i can do it in the environment which python gives or i can also trigger the script using the powershell command line within the mid server if i run it from here you can already see that i get the path where the python is installed and you will see the significance of this when we actually create the spoke because this is very important when we want to run a python script from powershell and we will come to that point now the next thing which we need to do is see if do we have a pick so pp is very important when it comes to python we need to see if that is with the latest version on or not and to do that what we are going to do is simply go here in the powershell and i am going to type py dash um okay that i can't yeah indeed so this is like i said uh i don't know it's it's the resolution i can change the screen resolution of the mid server maybe if i am kind of done that one window the powershell window doesn't ex allow you to do the font at all no um i tried that before the demo as well but no success so you can use ide you can use yeah i was gonna wonder if we could put in an editor and then paste it in here yeah i'm going to show you what i'm doing basically so if this works i have this script you can already use so much of an upgrade sorry it's not much of an upgrade when you put so if i go here and if i do this great pip if i do this you will see that it is checking for the packages so now it says that there is uh nothing to be upgraded basically when you get this because when i was trying when i was doing few things it was already upgraded and i upgraded it because the code won't run because without the upgrade then the next thing which which we need to do is we need to import the libraries which are needed for our code so let's say for example we need to pass arguments from servicenow to this python script for that there is and there is a library called as os.cis so i'm just going to show you this and that is this one this library because this library will then allow you to pass the arguments how we pass the arguments to powershell it is same way to pass the arguments in python so if i paste it i don't know if i can paste it i'm just going to do this so ashley tash we have a question from phil he said why would i want to oh my god me and chuck just go earl we're hitting the same key at the same time like three times in a row like having two light switches in the house and you're both playing with them right exactly what we were doing okay what's the use case here exactly so i i think i started with it right when so i i got this idea basically when i was doing an integration with a tool called as akamai and that tool supports an authentication mechanism which needs edge grid libraries okay and within service now we tried many things and that library was not supported and that's the reason we came up with this solution uh we saw that okay if we have a python script and the python script supports the edge grid library so what we did was we downloaded the edge grid library on a mid server we installed python on it and then we are doing the rest calls from that python script to that akamai tool which allows you to block some ips uh and whitelist some ips it's same like set scatter it's a different tool so that was the use case you're uploading that that actual work to the mid server to do the python work is that what i understand exactly and the second advantage was that the python script our devops team said okay we want to own the python script we want to own the major logic what the script is doing and using the ci cd pipeline at their end they are deploying the script to a particular location on the mid server and we are pointing there so there are two advantages here which i just explained and that's the best part of service now if you will always find a way to do things and the most secure ones this one this is similar to like if if you're running a client script and you can't get the work done you can always farm it off to the server side via glide ajax or something okay yeah and uh we also know that crypto js sometimes it's tricky to do crypto js uh use crypto just library also in service now so we have multiple examples and one more example if i want to give you is with respect to ansible towers i know we have integration capabilities like rest which can trigger that but in some cases within financial institutes it's very sensitive information there and there is an isolated remote server where all the logic lies also for your ad dns some python scripts and the team want to own it they don't want to expose it to service now because the credentials used by those are also in some safe i know we can do cyber arc but we don't use cyber art we have some different external credential storage thing and to accommodate all these use cases we do it using python i hope it was clear yeah moreover you have data analytics thing and penetration testing thing i use python and powershell for those things our shell has powers awesome so you guys might have seen i have just installed one library os dot sys which will allow me to pass arguments from service now to this python scripts okay one more important module which we really need is the request module because this is kind of a hard because it has the json part included in it it has some underlying modules inside it which will help us to do some array mechanisms json mechanisms so what i'm going to do is i'm just going to show you how we can do it requests and it shows that we don't have to install anything or upgrade anything because it it's already there and it is running in this mid server that been said so we are good to go to service now now because all the prerequisites are done on the mid server and to test that i have one demo file but i want to trigger it via from servicenow so i am not going to do it directly via the server so to start with as we are promoting built with a app engine studio i am going to quickly create one app using app engine studio because we are creating a spoke here and we want to promote uh more app engine studio to our audience as well so that's the best practice right when you if whenever you want to create some custom thing please create a scoped application and the scope and the spoke should also so basically this book is nothing but a scope application which consists of number of actions which you can perform so we are going to say lch iphone demo continue while you do this configuration i think this will be a good time to plug our current build with aes challenge so just a little bit ago i splash the link i'll bring that up again if you go to devlink.sn build with aes you will be brought to a post that will tell you all the details about a current uh effort on social media and with aes to showcase the capabilities of aes and you can get a t-shirt from servicenow so check it out and i can tell you t-shirt looks very good i got it from knowledge so yeah you're one of the very few people that were able to get the shirt at knowledge this past spring so if you didn't if you were at creatorcon and you missed out on the shirt this is a another way to get it great so we are going to jump into the flow designer thing and that's uh so you are in experience automation yes built from scratch but i don't want to build the flow immediately yet so what i'm going to do is first i'm going to go and create the actions and at the end we will create a flow and for that reason uh what i'm going to do is i'm going to go here and say let's see h locate my python path as i said the python path is an essential component which we need to trigger the script and that is the reason uh i'm creating this action first because if assume that you have multiple servers within your organization the path can differ right and i want to make this as generic as possible so people just need to use this action first before triggering any other python thing within their environment or within their flow so they can pass the path to the next action so if i submit this as a side note because of this show i have like 50 flows and sub flows and actions that all start with the letters lch [Laughter] mine has like part one part two part final final final final final final part two this is the real final part three they should go in production all of mine say dpmu do not use [Laughter] um just to tell our listeners if you want to use powershell or anything below i think integrations you need special subscription from integration up so it's not available out of the box so please keep that in mind okay an interesting part now so when we do this there are few options we need to see like right now i'm just going to define everything in line and we are not going to use any credentials because right now i am going to trigger the script on the mid server and it is going to use the mid server service account we all gained upon friend half last week because of this [Laughter] [Laughter] um as we are here i want to tell you one thing the service i have installed this mid server right and when you install a mid server you need to give a log on credentials and that user should have some special permissions and what i did is i added that user to a remote desktop group because if i do if i don't do that it was not able to initiate the or it was not allowing me to use the invoke command method which we are going to use in powershell so just a side note please keep in mind that you need to give a special write to the logon credential user so that it can invoke the command for you okay now if you see here we have to give the host name what i have done is so here i have the hostname this one is the mid server's hostname so i'm just going to use that uh eat oh sorry it's not your fault it's friday you should have one one eight seven it's not even drinking yet yeah uh i can leave the port blank but i am going to just say for three um auto select mid server yes because i want powershell capability and i want to drive this integration via powershell so i'm going to leave it like this but if you guys have any space so you can have multiple mid servers which has powershell capabilities and if you really want to use some specific one please select the uh this option and then please drag the cs id of that particular mid server here or you can put it here uh and return it from here when you're creating an action you wouldn't hard code the host in there liberties for demonstration purposes yes uh mainly i do it using a properties which are specific to the environments so i create like couple of property or properties one for broadband for non-pro and then in the pre-processing script i just fetch it uh by putting a pre-processing script here and then pass everything here um input and output like if you're creating action for selling or for store or someone to use might not want the default values but this is just to locate the path uh i'm not doing it but when we will create a next action which will actually pass the values to the script we definitely want to use the input variables and i will come there soon in this case we are going to use remoting type as it is this is the default value i don't want to use explicit remoting because we don't have any remote server in place at the moment same goes with implicit remoting i don't want to import any modules on this mid server and i don't want to run the script on the remote server so these two options i'm not going to use i'm just going to run the whole script the powershell script as well as the python script on the mid server and that is this and that's the reason i'm using this option uh it's always confusing with these three options when to use what but uh yeah we can have a separate discussion on that later on next thing is we are going to use inline script uh because i i have to pass parameters later on to the script so that's the reason we are going to use inline script right now i'm just going to keep this input variable thing uh as it is i'm not going to pass any input variable but i will start with the script directly and it is so i have it at one place i'm just going to take a reference quickly out of it to save the time so basically i have this i'm going to explain what parameters are important in this script quickly so if you see we are going to use invoke command because that is the way how we can run a powershell script on the server it can be the mid server on or the remote mid server the computer name this is the parameter i am passing and this dollar computer is actually nothing but a computer name which is the host so it will automatically resolve when the script run it will automatically resolve it to the uh ip of that particular host which i have mentioned at the top then the the feature of powershell basically which allows us to pass the path of the script and that is script block which can be used to pass also the arguments to the script it can also be used to pass the whole json and the credentials to that particular script here i am using this script block i am quickly going to do this so if you guys see this is the path uh where my python is python is actually stored now one thing is here anyways we are going to locate that particular path right and that is what i was struggling with that how can i get this without running the python uh for why is one argument a path in the other one's uh string uh in here yeah yeah so because that's after doing some investigation in past this is the way how we need to run uh the python script so basically what this part will do the first part will do is it will initiate a python station in the back end and once it initiates the python station it will go to this particular uh location on that particular mid server to see if we have a script called as demon uh file underscore one dot py and if yes it will just so same like this uh if i go to the ui here earl the first one is the run time and the second one is what the run time is going to do is the script or the runtime the the main reason the first one does not have quotes on is because it didn't have any spaces or other special characters in it so you could just oh you're right i just noticed that at the very end when you said the final name second one is the space in it so you gotta quote it yeah uh and that's oh [Laughter] and that is what uh we do basically to store the script anywhere on that particular mid server and then pass arguments we are going to see that and i want to take the script name for myself from my server so if i go and take uh remember i'm just going to do this one thing i'm like i said this should also come from the mid server and for that we need to do something else which we need to which i will be trying later on right now uh it's very hard to do it because we need to hard code this but i don't want to hardcore this in future and that is the reason we i have left it right now as it is there is no i don't have the solution yet for that um but if i do it like this save this hey the first save everyone take a drink yeah i'm a little late i'm almost done with one can so let's test this uh if this really works or not so if i run this yes see what happens running great complete so at least we have a success and then it gives us the path back but if you see this part is the same as i have mentioned in the code uh and this has to be automated using powershell itself one thing which is very important to mention and i faced the issue myself is when this particular code runs on this machine in the back end it does invoke some uh win rm uh operations uh and some other operations which your security team can find suspicious so you need to make sure that you convey everything to them before you do this script because they can then white list their commands so that it will go away from that and the monitoring system will not catch it as a suspicious activity on your files malware dot py and stuff like that [Music] but but that is not exe you will get a nomination notice yeah but the invoke operation does something in the back end and i got i have faced the issue and that's a tip to do that well in advance before you are sacked let's say um so as we have the location now let's proceed to see how we can trigger another script which can do a concatenation for us so basically let's again go back to uh yeah this file i'm just going to show you the code on the mid server so basically this is the code which we have and what it does is it will concatenate these two strings and pass the value to us right now at the end of this particular demo i'm going to show you how we use it with an integration i can't show you the python code because of some sensitive information in there but i can just show you how it works within the environment and how you can use powershell json parser and automate an integration but for the later end of the session so let's see how we can actually let me for now let me just comment this because that is the next part which we are going to see but first let's see how we can trigger this and how the output will come to service now and again i'm just going to copy the file name very simple you can pass the input values to this from the let's say if you have a record producer if you have a catalog item you can pass the values dynamically to that script and we will see that how we can do it so i did i think i have the script here already the only thing changing is this at the back now when we create a so let me first show you this how it runs and what output it gives so you will see that it's pretty much same as the first action which we created and you will get the output as high because i am printing oh wait i need to copy this we should not we should not get this as output we should get the output as linux host so if we go to the end yeah save [Music] great and if i show you this so you have linux hint as the output from the script everything's running too smoothly in this episode yeah now let's see how we can actually pass a value dynamically from this action to do that first we need to do some modification in the code and what i'm going to do is i'm just going to open this code quickly in the python code basically and here what we want to see is this so basically what happens is whenever we pass an argument we need to use this library and that is cis if you don't use this library you can't actually parse the argument which we are passing from this from service now so it's very important to use this library and then once you use that library we can fetch it like this or we can read the library like this and let me first print this at the top and i am going to show you guys how the output will come now to service now keep in mind i have not changed anything here yet i just want to show you that how this will get print uh and for that reason i'm just going to save and to pass the arguments to this particular script what we need to do is we can do it in two ways first i'm just going to do this like this and before the curly braces we need to give a space and then you can add let's say i'm just going to say and i'm going to save this what this library will do is basically it will just create an array of that particular input argument because we can pass multiple uh arguments you can also pass the json you can pass array and this will be if you pass a json then this will print as array and within that array it will be a json object we will see that now how it looks so just run i hope this runs yet great so if you see this yeah so we got this is the print from the end and this is the argument list which is an array like i said so if i pass uh okay one more thing when we use that sys library the first parameter the zero counter is always the script name and you can't change it and from 1 count to 1 you will have all your parameters which you are passing this is why testing and printing your logs before you do anything serious is helpful yeah and you can see it has created an array a comma separated list inside that array which can be parsed using a for loop within the python script and then it can be used i think i have something which needs which i can show at the end um okay let's now see how we can actually use this value here and how we can concatenate it i can do a simple thing and i can just add string three here and i can just say cis dot argb i'm not sure if it is like this often or i can quickly uh yeah that's how python's arrays work let's give it a try it should be let's give it a try let's save this and run it yes and i'm just going to see this like string three okay and then go here run so why does it take time like if it's showing it was completed uh no it was in progress and then it got it moved to computer because on the mid server it takes some time to process the code like i said it invokes the process on the mid server then it runs the code and then it gives output back to this particular uh execution or the processing of ecc queue that happens yes oh there you go that's exactly the ecc so here you can see it did work so we got lcsh back right now let's make it dynamic so to do that uh what i am going to do is simply add one parameter here let's say i am demo for now and i am going to go to the input parameters let's close create input um in this case let's say i'm going to pass main yeah and once i have that when i need to go back to the powershell and map this demo with the name so i'm just going to drag and drop now here is the interesting part which i think i should zoom in zoom in a bit now i am going to use some power shade here so i'm going to use first define a variable let's say name and then equal to um just to tell our audience there is a way how you can actually access this variable here because and that is defined by servicenow and it is like dollar e and v colon s n c underscore demo so this is the way how you actually initialize this variable with this value and i'm hoping that's documented somewhere yeah it's it is documented uh if you go to this link uh it's documented there so they say if i can show quickly it's very small but yeah it's documented definitely and if i show you yeah it's here you see this dollar env colon underscore so this is constant and after underscore everything is not constant so you can just use your variable names here and it is documented here great uh but now how can we use it in this code and that is by again another powershell capability that is dollar using colon name so what this will do is basically it will just take the value associated with the variable at the beginning which we have defined here and the using is a reserved keyword by powershell which helps us to basically get the value from name and put it in this execution code why wouldn't you just drop in the data pill in quotes uh this one like this right under the command section open the right pane the the data panel there and this drop name into the command yeah you got invoke command blah blah blah blah blah go go to the end where you put in uh using name i can but i think it's not possible uh i tried it but it does not allow end uh using i think i need to go it like this yeah and if you see i can't even do it because it does not support the data pill thing at the end i can show you here's your answer yeah if i show it because when we see here there is nothing to do that this icon is not here the data picker is just not gonna work yeah okay no i'm very educational i'm i'm learning all kinds of stuff i don't in powershell very often at all submit that into the idea portal so there may be a technical reason why it uses the environment variable so it stores the instance of the your script it will take the instance of your script to the server and then put your variables in its environment variables and then use it instead of passing on from the script yeah and i think powershell is very strict with this for with its formats and the way how we use this data pillar in the back end the mapping is it generates some its own uh id let's say a specific id right for that mapping and that can't be used and when you take uh when you look into the ecc queue how service now this thing works it converts into the format uh which will powershell will understand and that is stored instead of you know just passing on the script directly to server yeah so let's see if this works uh what i'm going to do is test again uh chuck what what so let's see yeah the execution is complete and it does work see so linux hint chuck so it did pass the parameters properly by using that particular uh library which is cis and by using the powershell command like this which i just showed now the advantage of doing this is like i said i got this idea to block an ip address in a particular tool and what we do is usually there are multiple ips right so we just create an array and pass it to this script and the rest of the thing is handled by the python code which is again managed by the other team um one thing i can show at the end is because we are approaching the end one thing i really want to show is how we did it and i will just invoke one script from the same action basically and that is also stored here you pre-baked one like on the baking show this is what the cake is going to look like when you're all done uh yes the idea was to you know showcase how to pass parameters it was a training lesson yep so much for the well-polished demo line i use um and here inside the name so let's say save and input now at this time i'm just going to give an ip address like this run the code fingers crossed let's see if it works how much we have to pay for like if you want that kind of ip address i don't know so yeah it did it did work and i got so my ip is blocked uh sorry i can't show this quickly i have closed it immediately but yes this code does work and it has done something for me in the back end uh and this is how we are using it and this is how i learned basically to trigger a python script from powershell using servicenow one last thing to end with uh is so we created two actions so basically the python script right now consists of two actions first to locate the location second to run the script uh by passing the parameters to this python script like at the beginning we started with app engine studio i can create a flow which can be triggered it can be a subflow or it can be a flow which can be triggered by any operations within servicenow we are doing a subflow but because we need to pass an extra parameter to this particular script i used subflow and it was on a different process it was not dependent on a record producer and a catalog item and that is the reason we use subfloor so using the subfloor you can pass the values to these actions and then the whole flow is done and of course once you get a json output back you can use json parser here to see if your code was successful and last but not least error handlers very important because if powershell encountered an error i want a notification saying that the integration or this particular action has failed that being said or chuck or to you nice um don't forget it hits news in about 10 seconds uh but anyways we had a question from the audience um it's python so life is life in python is using other a lot of libraries and someone asked could we install any library or are there any restrictions there are restrictions which your mid server follows so let's say if your mid server does not allow you to install libraries from py i i think there was a site and i can quickly show the audience which was the flight site which they need to white list basically and that is give me a minute yeah p y let me open it i'm just going to come to this screen yeah so what i did is i white listed the connection on the mid server to reach to this particular domain or this particular url so that i can download the package without any issues so the firewall and the proxy on your server should allow the connection to this if it is blocked you need to open it and then download the libraries my suggestion is don't copy paste the libraries from your machine to the mid server it is not going to work because it has many libraries or sub libraries i would say for example the request module it has many libraries attached to it so it's always better to install the libraries on the machine rather than copy pasting it from another machine libraries have interdependency so if some library is calling some other library then you need to install that as well so it's always better to install it will automatically install the prerequisites and one more thing like if you are whitelisting this site so be sure that control for this is in hands of some users because you can find some of the projects that are very harmful like crashing your whole environment breaking whole environment in one click so if someone is unhappy with you he can literally destroy your environment like i said right at the beginning we need to talk to the security team get the operation whitelisted because the monitoring teams within the organizations are very smart and they will catch you when you invoke these kind of commands and they will contact you that's a good thing [Laughter] i can see this easily being extendable pretty much everything you built except the python scripts which you already had available you could do the same stack of technology to take that python action and invoke instead of a python script you know where you had c colon app data whatever down to the python.exe then you call the script you that could easily have changed to a perl script or or any other executable because the python excuse me the the powershell command is going to launch a command on the mid server so whatever that happens to be could be very flexible it's just like detaching and reattaching the right executable and right script into that last p true but i tried also with node.js so instead of python it was not just so i was i wanted to do it initially with node.js because that is more friendly and it was about i did not have to do any whitelisting but that didn't work so from servicenow using powershell invoke your node.js environment and then run the script it didn't work and then we moved to python that is also one interesting maybe i was uh maybe the version i have tried node.js it works but with this it was very difficult to run the script and it was not invoking uh the environment for node.js it was not running how you say initializing the node.js server and it was not triggering our rest call maybe something was missing but yes chuck we can ideally trigger other types of crypt scripts using this i was literally hovering over the button pushing down on the i push down on the buttons and then you clicked it they're always like what just happened wow they incorporated some telepathic stuff in this that's awesome all right good job hey that's just that that's a glaring success um so if so everyone finish your drinks i'm just kidding don't do that too late i wouldn't be able to drive sweet let's go around and rate them then thank you ashitosh earl what's your i mean i mean it's powershell and scripting right like if you can't figure out how to do it inside servicenow a powershell script through mid server is basically going to do literally anything else that you need to do or or you may have some legacy you know script powershell script or perl script like we said that that needs to be run and feed that information back and somebody's gonna say hey can we get this into service now now you've got a clue as to where to start and go yeah i think i think we can uh i think for my drink so i had the hide a single mall irish whiskey number seven six-year-old um no it's good i would probably give it a four um not as good as the one i tried like a month ago or something um it's still pretty it's really it's still pretty solid yeah pretty good lauren i end up i don't usually like dry sake um i really liked this kangoro brand sake so i'd give it like definitely like a four or five out of five um unrelated to alcohol i wanted to give a quick little so chuck's bow tie reminded me of this so obviously navy blue being part of like the new servicenow brand is like pretty easy to find but that green is uh oftentimes very elusive just want to let especially all the women out there know uh aloe yoga of all things just did a new drop of an entirely new color called ultramint that looks eerily similar to servicenow green so if you want some things for upcoming conferences that's a good place to look often a lime green or as i discovered apple green is is a dimmer version but also works we are we are way off track but that's all right afternoon had to let people know i was like oh it's limited edition what did you learn out of life cody happy hour ultraman [Laughter] five man no doubt about that earl we're gonna have to come up with a static graphic for that guy you know right [Laughter] and the man of the hour ashitash the rattler is great um five out of five five four five very nice wow um i'm going to give the kona brewing longboard island logger i keep forgetting what the subtitle is uh yeah this is a good easy down beer i give it a solid four no nothing spectacular but washes down the pizza really good yeah that was lunch so with that again thank you ashitosh and drew for joining us yeah thank you earl and lauren for the commentary and watching the comments and posting the right ones up there we had a lively discussion so if you didn't get a chance to join us here watch our channel like and subscribe you don't do that we do live coding happy hours at 4 30 eastern time on fridays we're going into our tokyo season so it's going to be i'm not going to say hit and miss it's it's scheduled if you go to devlink.sn you can see that full schedule when is there a live coding happy hour when is there a creator toolbox when am i expecting podcasts and what are the topics on that we've got it broken down by topic we've got it broken down by calendar you can't miss that is your link you want to check out but if you just happen to be around on a friday afternoon or something and you weren't checking the schedule you didn't block off your calendar bing turn on those notifications and uh subscribe so i know there's a lot of people that are watchers that don't subscribe not sure why if you're interested in this material it's a good idea and then you don't miss anything so did i miss any other special announcements earl tech now coming up august 4th thank you [Laughter] it's like glance cue done august 4th 8 am go over to devlin.sn slash tech now episode 94 is going to spotlight all of our tokyo platform app engine and automation engine features specifically around developers and what you can build we're putting tools in your toolbox this is sort of the table of contents for the rest of august september october well into november all these things we're going to be covering lots of great content there i look forward to seeing you there devlin.sn slash tech now is where you can get that information then as always there's always more podcasts and more videos and more blogs coming out keep track of that on social media as well so with that i thank everybody for joining us much appreciated hope to see you on the next one if you missed it this time and uh everybody take care be safe until next time happy weekend [Music] foreign

View original source

https://www.youtube.com/watch?v=soqVfhi4ptM