Is there a Unix Expect Binary / Utility equivalent for Windows Batch or Powershell for interactive scripts? - linux

I am trying mirror a process on Windows that I use on linux for creating an automated build of an application web server. The only way to have full automation is to have some sort of EXPECT utility for the interactions on the CLI.
We use a script to setup all the configuration and settings for our applications web servers that is easily portable to batch since the web server is windows compatible as well with the same commands.
I've basically got it down for Linux, however the flip side to this is that the windows doesn't seem to have a clear expect alternative.
Any suggestions to allow it to send a response when prompted and continue the rest of the scripted process would be most helpful.

Related

Problems running large command line program (Inkscape) in Azure Function app or App Service

I wasn't sure whether to ask this in an Inkscape specific forum or here in Azure. I tagged both.
My goal is to run a windows build of Inkscape in a cloud function preferably or in an App Service to open up different vector files and send them back to the user as a plain SVG.
I've downloaded the binary archive (https://inkscape.org/en/release/0.92.2/windows/32-bit/) and extracted it in Kudu on both a paid App Service and in a Function App.
When I run inkview.com it seems to be working. It outputs info to cmd
But when I run inkscape.com it just stays open for a couple of seconds and quits. (Just outputs a blank line and exits) I've tried -V and -? and many other commands (also using the -Z without GUI command).
Does anybody have an idea of what's going on here? Is Azure perhaps missing some dependencies that Inkscape needs to run? Any ideas on how to troubleshoot?
Thanks in advance.
Azure Functions, like WebApps and Mobile Apps, run in an App Service. The App Service runs in a secure environment called a sandbox which imposes certain limitation. Amongst them, is the use of GDI+.
With Inkspace being a graphics program, I can only imagine that it is making use of GDI+, so it would be blocked.
You can see the list of limitation https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox#unsupported-frameworks
In order to be able to run inkspace in Azure, you need to host in something other than App Service, such as a VM, Cloud Service, Service Fabric, Containers... etc.

Connect to multiple remote machines to run automation scripts

I am an automation engineer where I need to run 450 CodedUI scripts on multiple machines. I have 15 machines on which I run these scripts.
To resolve my trouble I am using Microsoft's tool Remote Desktop Connection Manager to login to these machines. But I am getting the error on failed scripts that "Either the window is locked or minimized", but when I used to directly login to these machines and run the scripts there were no such issues.
I am unable to find any resolution. I tried one more tool to connect to 15 machines , i.e. AppVision tool as well. Even with that tool I am facing the errors on all my scripts that Some control is blocking the control to be clicked in.
I need to know if I can have any other tool or way where I would be able to login to the machines in one go and run automation scripts without any errors.
Any help is appreciated.
Thanks in adavance.
Coded UI requires that the screen saver is disabled on the remote machines.
Coded UI interacts with the desktop of the machine running the tests. When the screen saver is active it controls the desktop and, effectively, prevents Coded UI from interacting with the application under test.
The question refers to "Microsoft's tool Remote Desktop Connection Manager" so perhaps you are not using test agent software to run the test. Check this Microsoft web page and this Microsoft forum question for more details on how to set up remote computers to run Coded UI.

run sharepoint powershell from c# on another PC?

If the C# application is on the same server as sharepoint, I know we can use RunSpace to run the pwoershell script, but what if the C# app. and sharepoint server are on different PCs?
Is this possible?
thanks
yes, its possible, though messy. In Powershell 2.0+, there's a feature called remote powershell, so you can effectively, via c# code, send Powershell commands to your local powershell instance, and use that to log into the remote instance.
A slightly less insane idea would be to simply create a web service on the remote machine, and have that run the remote powershell commands, from the web service.
And even less crazy idea is just to write a web service, and have that run code on the remote server. : )
Good luck!
If you are administrator on the remote box, you can try combining PsExec and PowerShell.

creating a performance tool for web based GUI

I want to create an automated performance metric gathering tool, to get various metrics for page load times for a flash based web application. I am doing the web automation using a batch script, and then I want to collect the various metrics using browsermob-proxy (http://opensource.webmetrics.com/browsermob-proxy/), it exports the metrics in a HAR file. I've never done this before so I was wondering if this approach is okay? What are the steps to using browswermob-proxy for windows (firefox). There is no information about windows in the documentation, just linux. I know I run the proxy from the /bin directory, then what do I need to do?
I had downloaded the copy from the browsermob zip from here..http://opensource.webmetrics.com/browsermob-proxy/ Unzip and refer the readme.md
The readme file in the browsemob zip, specifies the instructions to start the proxy server. Once the server is started, you would need to specify the server port and machine ip in your firefox proxy settings (from options->advanced->network>settings. Then trigger your urls on this browser.

Web frontend to my Powershell scripts for helpdesk

I'd like to have a web frontend to my powershell scripts for helpdesk.
These scripts would typically be user-creation scripts and scripts to restart a specific service on a specific server.
Where should I start? What would I need?
There is no problem for me to set up a IIS for this purpose if needed. We also have Sharepoint on a dedicated server.
Hoping for some startup-tips:)
You can consider Powershell Web Access feature on Powershell V3.0
http://technet.microsoft.com/en-us/library/hh831611.aspx
This is a robust solution, factoring in IIS, security and shell access.
You can use PowerShell Remoting. You can open a PS session that would look like a local PS console to you but it would be running on the remote machine. You can type PS code to be executed remotely and launch a buch of ready-to-run ps1 scripts for SP administration there too. Have a look at those links, for example:
http://www.computerperformance.co.uk/powershell/powershell_remote.htm,
http://blogs.technet.com/b/heyscriptingguy/archive/2011/11/17/learn-how-to-manage-remote-powershell-sessions.aspx
--- Ferda

Resources