我有一个用于配置Web服务器的Power
shell DSC.我的服务器需要URL Rewrite模块,所以我从
Github gist中找到了代码:
https://gist.github.com/sheastrickland/646c42789ce2df35d5c8
我的问题是当DSC进入我的块时:
- Package UrlRewrite
- {
- #Install URL Rewrite module for IIS
- DependsOn = "[cNtfsPermissionEntry]AppPoolPermissionsSet"
- Ensure = "Present"
- Name = "IIS URL Rewrite Module 2"
- Path = "http://download.microsoft.com/download/6/7/D/67D80164-7DD0-48AF-86E3-DE7A182D6815/rewrite_2.0_rtw_x64.msi"
- Arguments = "/quiet"
- ProductId = "EB675D0A-2C95-405B-BEE8-B42A65D23E11"
- }
它抛出一个错误:
- PowerShell DSC resource MSFT_PackageResource Failed to execute Set-
- TargetResource functionality with error message: Could not get the http
- stream for file http://download.microsoft.com/download/6/7/D/67D80164-7DD0-
- 48AF-86E3-DE7A182D6815/rewrite_2.0_rtw_x64.msi
起初我以为我的服务器可能有一个糟糕的代理设置,所以我检查是否可以使用以下语句下载该文件:
- wget http://download.microsoft.com/download/6/7/D/
- 67D80164-7DD0-48AF-86E3-DE7A182D6815/rewrite_2.0_rtw_x64.msi
- -OutFile "C:\Users\Dald\Desktop\Mizzy.msi"
瞧,该文件出现在桌面上,正如预期的那样在6,12 MB处.
所以我不知所措,为什么我的DSC无法获得http流?我以管理员身份运行它,所以所有功能都应该可用,但也许我忘了设置一些东西.
任何帮助是极大的赞赏.