使用 PowerShell 解除 BizTalk 业务流程的绑定

发布于 2024-12-28 20:12:31 字数 340 浏览 2 评论 0原文

使用 PowerShell 解除编排绑定的最简洁方法是什么?

我想要一个可以在 32 位和 64 位平台上运行的东西。

我知道我可以加载和使用 Microsoft.BizTalk.ExplorerOM 程序集(使用“Start-Job -RunAs32”之类的内容强制使用 32 位模式)并执行类似于此处解释的操作: microsoft.com/en-us/library/dd792703%28v=bts.10%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/dd792703(v=bts.10).aspx

但我想找到更好的东西。

What is the cleanest way to unbind an orchestration using PowerShell?

I'd like to have something that works on both 32bit and 64bit platform.

I know I can load and use the Microsoft.BizTalk.ExplorerOM assembly (forcing 32bit mode with something like "Start-Job -RunAs32") and do something similar to what is explained here: http://msdn.microsoft.com/en-us/library/dd792703(v=bts.10).aspx

But I'd like to find something better.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不弃不离 2025-01-04 20:12:31

我看到您链接的示例脚本正在从 GAC 加载此 DLL:

[System.reflection.Assembly]::LoadWithPartialName("Microsoft.BizTalk.ExplorerOM")

我不熟悉此程序集,但如果它在 GAC 中预编译为 x86,那么您需要使用 32 位 PowerShell 加载它(在 64 位上时) Windows系统)。在您的脚本中,您可以检查 PowerShell 进程位数:

if ( [IntPtr]::Size -eq 4 ) { # x86 } else { # x64  }

如果您的脚本未以正确的位数运行,我可以想到三件事:

  1. 按照您的说明启动 32 位后台作业
  2. 重新启动您的脚本使用 32 位 PowerShell 的脚本(如果您的脚本有参数则无法正常工作):

    if (-not $ CorrectBitness) { 
        启动进程“C:\ WINDOWS \ syswow64 \ windowspowershell \ v1.0 \ powershell.exe”-ArgumentList“-file”,$ Inspiration.MyCommand.Path
        出口 
    } 
    
  3. 告诉用户他们需要使用 32 位 PowerShell 重新启动脚本并退出。

I see the sample script you linked is loading this DLL from the GAC:

[System.reflection.Assembly]::LoadWithPartialName("Microsoft.BizTalk.ExplorerOM")

I'm not familiar with this assembly but if it's pre-compiled to x86 in the GAC then you'll need to load it with 32bit PowerShell (when on a 64bit Windows system). In your script you can do a check to see what PowerShell process bitness is:

if ( [IntPtr]::Size -eq 4 ) { # x86 } else { # x64  }

If your script is not running in the right bitness there's three things I can think of:

  1. Start a 32 bit background job as you noted
  2. Re-launch your script using 32 bit PowerShell (doesn't work well if your script has params):

    if (-not $correctBitness) { 
        Start-Process "C:\WINDOWS\syswow64\windowspowershell\v1.0\powershell.exe" -ArgumentList "-file", $Invocation.MyCommand.Path
        exit 
    } 
    
  3. Tell the user they need to re-launch the script using the 32 bit PowerShell and exit.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文