Ambimind Posted September 29, 2015 Report Share Posted September 29, 2015 Motivation PSlang is overloaded, confounding and extremely verbose, however its well integrated .net: regex, http and file processing facilities - make it worthwhile in complex tasks. Such a complex task may involve sending post data with dynamically generated cookies and varying referrer-urls, across several http requests. Example A PS script file (FabsAB.ps1) is placed in the directory intended for a downloadable installer. The script is written so as to download and process files within its containing folder. It is assumed that Ketarin is aware of this folder via its "Download location"(Application tab) setting. Solution included below is the command to call this script, and its placement with other commands, part of the pre-download steps for the job : POWERSHELL -command ".\FabsAB.ps1" Problems If after running the command one finds Ketarin unable to finish it, it will be necessary to find "Powershell.exe" in "Windows Task Manager" and kill the process. This is likely related to PS security restrictions. To resolve this we need to set "PS execution policy" for both the "LocalMachine" and "CurrentUser": Within a PS terminal with admin-rights type one after the other: Set-ExecutionPolicy Unrestricted -Scope CurrentUser then type "Y" Set-ExecutionPolicy Unrestricted -Scope LocalMachine then type "Y" Get-ExecutionPolicy -List to check the current state of affairs Remarks It is also possible to run multiple Powershell commands, not written in a file : POWERSHELL -command "Get-Content a.txt -Raw; $fab='All done'; $fab" Link to comment Share on other sites More sharing options...
Etz Posted February 20, 2016 Report Share Posted February 20, 2016 Check out this: https://ketarin.org/forum/topic/3859-ketarin-183-beta/?p=10565 It means you can simply "dot source" your script or even better, implement it directly into Ketarin. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now