Powershell and automation – QA

I automate task with moving information between systems interfaces that require additional information from me that neither system provides, but the other requires.

After an update one of these systems was moved to a new server do to system requirements and the other stayed on server it was at because it has not been update to run on new windows server. The process for manipulating what was going through interfaces was pretty straight forward. Its when the interfaces are on two different servers things become interesting or head ache causing.

There are 2 data sets that travel through the interface, only one of them requires any manipulation. The manipulation adds a value based on zip code. A very poorly written C# console application takes care of this it works and is very easy to maintain. Power shell scripts are used in a few places, one gets al of the file names to be manipulated for the console application. The second moves the first data set to the other server. There was a third to move the second data set to the other server, this was replaced with another console application to move what was process.

Found the second power shell script which is a basically a move-item command would occasionally decide a network drive was not mapped when it ran in the schedule task, but if it was ran from bat file the schedule task used the it was fine. The network drive did not lose connection. the question is why is it doing this just with the schedule task.
It could be a quirky issue with task scheduler in Windows 2012.

After a tweet to the script to use UNC path instead of the network drive mapping, which works with executing bat file that contains the script. will have to wait for next schedule task to run to see, if it errors out or some other strange condition occurs.

The bottom line is testing and some more testing. The process steps are very straight forward. However you do not know when something will throw you a curve ball in production and operate very differently than what it has been. It looks like the scheduled task is not always running clean – the only error in event log of any uses was concerning the mapped drive that was being used. So make sure you can test every condition you can think of and then test some more.