I have been using the excellent BizTalk Provider for PowerShell from Codeplex for a while now. However in my new company the build team are not comfortable using it so I need to rewrite all my handy configuration scripts to not use it.
I have re-done most of them but am having some problems finding examples of how to do the following two things:
- Create host instances
- Create send/receive adapter handers
Can anyone point me to examples of how to do these things WITHOUT the PowerShell provider for BizTalk please? I have done some looking and it seems like everyone uses this now.
Many thanks in advance.
Even if you can't use the Powershell library itself, nothing is stopping you from examining its source to see what it does to perform those functions, which is to interact with the Microsoft.BizTalk.ExplorerOM assembly.
There is also a very useful blog by Sandro Pereira with functions for handling hosts, host instances and adapter handlers
And also Tomas Restrepo set on GitHub
The one they didn't seem to cover was deleting a BizTalk host ...
OK here are my finished hacky powershell functions if anyone else needs them:
Looks like you borrowed from Santhosh Benjamin's scripts to submit the PutOptions using reflection:
I tested this with several scripts I am currently working at, and found out (through sheer stubbernness) that you can simply use the Put method on the object, just as you were used to in C#:
Cheers, Charles.
For 2) you should look into Microsoft.BizTalk.ExplorerOM
Using ReceiveHandler and SendHandler should give you what you need.
However there seems to be no way to control host instances, only hosts, using ExplorerOM.