我一直在尝试为IIS本地托管的所有站点自动创建托管处理程序和脚本映射。我一直在努力寻找通过powershell附加'Executable(Option)'的变量。
到目前为止,我的脚本看起来像这样:
Remove-WebHandler -Name sm1 -PSPath "IIS:\Sites";
Remove-WebHandler -Name sm2 -PSPath "IIS:\Sites";
Remove-WebHandler -Name mh1 -PSPath "IIS:\Sites";
Remove-WebHandler -Name mh2 -PSPath "IIS:\Sites";
New-WebHandler -Path "*.svc" -Name "mh1" -Verb 'GET,POST,DEBUG,HEAD' -Type "System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" -PSPath "IIS:\sites";
New-WebHandler -Path "*.xamlx" -Name "mh2" -Verb 'GET,POST,DEBUG,HEAD' -Type "System.Xaml.Hosting.XamlHttpHandlerFactory, System.Xaml.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" -PSPath "IIS:\sites";
New-WebHandler -Path "*.svc" -Name "sm1" -Verb 'GET,POST,DEBUG,HEAD' -Location "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" -PSPath "IIS:\sites";
New-WebHandler -Path "*.xamlx" -Name "sm2" -Verb 'GET,POST,DEBUG,HEAD' -Location "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" -PSPath "IIS:\sites";
我设法成功删除并添加了所有脚本,但是仍然遇到以下错误: https://www.progress.com/documentation/sitefinity-cms/configure-the-iis-to-host-sitefinity-projects
我发现我需要设置添加新脚本映射下文章中提到的'Executable'属性。但是,我无法在https://docs.microsoft.com/en-us/powershell/module/webadministration/new-webhandler?view=win10-ps下找到与此有关的任何文档。
在此方面的任何帮助将不胜感激。
答案 0 :(得分:0)
将其添加到-ScriptProcessor下,如下所示:
New-WebHandler -Name YOUR_HANDLER_NAME -Path * -Verb * -Modules FastCgiModule -PSPath "IIS:\Sites\YOUR_SITE_NAME" -ScriptProcessor "c:\BLAH\BLAH-cgi.exe"