IIS
을 설치하려고 Octopus deploy를 사용하여 대상 컴퓨터에서 PowerShell 스크립트를 실행하고 있습니다. 아래 스크립트를 사용하고 필요한 매개 변수를 전달합니다. 어떤 차종이 전화가 제대로 이루어지고 있다고 생각 될 기록됩니다, 그러나 그것은 단순히 응답 :Chocolatey가 창을 찾을 수 없습니다.
Chocolatey
패키지 저장소에서 패키지
IIS-WebServerRole
설치
...
17:11:48Info
Installing the following packages:
17:11:48Info
IIS-WebServerRole
17:11:48Info
By installing you accept licenses for the packages.
17:11:48Info
IIS-WebServerRole not installed. The package was not found with the source(s) listed.
17:11:48Info
If you specified a particular version and are receiving this message, it is possible that the package name exists but the version does not.
17:11:48Info
Version: ""
17:11:48Info
Source(s): "windowsFeatures"
코드 :
$chocolateyBin = [Environment]::GetEnvironmentVariable("ChocolateyInstall", "Machine") + "\bin"
if(-not (Test-Path $chocolateyBin)) {
Write-Output "Environment variable 'ChocolateyInstall' was not found in the system variables. Attempting to find it in the user variables..."
$chocolateyBin = [Environment]::GetEnvironmentVariable("ChocolateyInstall", "User") + "\bin"
}
$cinst = "$chocolateyBin\cinst.exe"
$choco = "$chocolateyBin\choco.exe"
if (-not (Test-Path $cinst) -or -not (Test-Path $choco)) {
throw "Chocolatey was not found at $chocolateyBin."
}
if (-not $ChocolateyPackageId) {
throw "Please specify the ID of an application package to install."
}
$chocoVersion = & $choco --version
Write-Output "Running Chocolatey version $chocoVersion"
$chocoArgs = @()
if([System.Version]::Parse($chocoVersion) -ge [System.Version]::Parse("0.9.8.33")) {
Write-Output "Adding --confirm to arguments passed to Chocolatey"
$chocoArgs += @("-y", "")
}
if($ChocolateyPackageSource) {
Write-Output "Adding --source to arguments passed to Chocolatey"
$chocoArgs += @("-source", $ChocolateyPackageSource)
}
if (-not $ChocolateyPackageVersion) {
Write-Output "Installing package $ChocolateyPackageId from the Chocolatey package repository..."
& $cinst $ChocolateyPackageId $($chocoArgs)
} else {
Write-Output "Installing package $ChocolateyPackageId version $ChocolateyPackageVersion from the Chocolatey package repository..."
& $cinst $ChocolateyPackageId -version $ChocolateyPackageVersion $($chocoArgs)
}
내가 찾을 수있는 가장 최근의 Chocolatey 문서를 기반으로하면 이것이 효과가있다. 왜 그런 생각을 못하니? Azure Windows 2012 R2 VM에 대해 언급해야합니다.
촉수가 실행되는 사용자로 수동 실행되는 상자에서 powershell 스크립트를 실행할 수 있습니까? –
@AlexM - 예. 관리자로 컴퓨터에 로그온해도 똑같은 메시지가 표시됩니다. 창 기능이 작동하지 않는 것 같습니다. 나는 심지어 작동하지 않는 호출의 일부 오래된 버전을 시도했다. 나는 Chocoly를 사용하는 것에 익숙하다. 그래서 내가 분명히 잘못된 것을하고 있다고 생각했다. – swannee