我的团队开发了一个带有多个服务的ServiceFabric应用程序。这些服务在应用程序中相互使用,但出于管理目的,我想直接从PowerShell调用其中一个服务。
从服务中创建并使用代理对象:
var myServiceProxy = ServiceProxyFactory.CreateServiceProxy<IMyServiceInterface>("fabric://Application/MyService") var result = await myServiceProxy.SendSomeData(bytearrayHere);
我希望能够通过PowerShell将文件发送到同一个服务。这有可能吗?我该怎么做?这在我的盒子里,所以我有可能需要的所有证书/秘密。
您应该能够创建 ServiceProxy 通过使用 PowerShell New-Object 直接打电话 SendSomeData .
ServiceProxy
New-Object
SendSomeData
作为解决方案,您可以创建一个托管 web api ,并使用 PowerShell Invoke-RestMethod .
Invoke-RestMethod