简体   繁体   English

从IIS调用Powershell脚本

[英]Invoke a powershell script from IIS

The 3rd party git repository service I use provides post-commit hook where it will post the commit details in JSON to specified URL. 我使用的第3方git仓库服务提供了post-commit挂钩,它将在JSON中将提交详细信息发布到指定的URL。

Most of build automation is via powershell (pull from git repo, build, copy artifacts). 大多数构建自动化是通过powershell进行的(从git repo中拉出,构建,复制工件)。 What Id like to be able to do is somehow launch the powershell script when the specified URL is hit. Id想要做的是,当命中指定的URL时以某种方式启动powershell脚本。 Im struggling to think what the best way (and most secure) to accomplish this would be. 我正在努力思考实现此目标的最佳方法(最安全)。 A simple aspx page hosted in IIS that launches powershell buildproj.ps1 with suitable security permissions and IP lock down? IIS中托管的一个简单的aspx页可以启动具有适当的安全权限和IP锁定功能的powershell buildproj.ps1吗?

You can host the PowerShell engine within your ASPX code. 您可以将PowerShell引擎托管在ASPX代码中。 You would need to use IIS/ASPX mechanisms for IP lock down and authentication/authorization for the URL. 您将需要使用IIS / ASPX机制进行IP锁定和URL的身份验证/授权。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM