【发布时间】:2018-11-21 01:14:55
【问题描述】:
我最近被分配了一项任务,将我们所有平台上的 power-shell 更新到版本 5。我已经能够检测到哪些服务器需要更新,但目前我一直在实际更新它。我可以运行静默安装程序,但它什么也没做。
If($PSVersionTable.PSVersion.Major -lt 5){
LogError "The following **** shall be updated: $($Global:setupConfiguration["GENERAL SETTINGS"]["CASINO_LOCATOR_NAME"])"
$fileName = "Win8.1AndW2K12R2-KB3191564-x64.msu"
$filePath = "C:\Temp\"
$remoteFilePath = "$($Global:globalVariables.executionPath)\$fileName"
LogMessage $filePath
LogMessage $remoteFilePath
if(!(Test-Path -Path $filePath )){
New-Item -ItemType directory -Path $filePath
}
Copy-Item -Path $remoteFilePath -Destination $filePath
Start-Process "C:\Temp\Win8.1AndW2K12R2-KB3191564-x64.msu" "/q /norestart" -Wait
}
注意我尝试使用 dism.exe。
Invoke-Command{
dism.exe /online /add-package /PackagePath:C:\Temp\KB3191564-x64.cab /norestart
#Remove-Item c:\temp\KB3191564-x64.cab
}
这是我得到的错误:
Deployment Image Servicing and Management tool Version: 6.3.9600.17031
Error: 11
You cannot service a running 64-bit operating system with a 32-bit version of DISM.
Please use the version of DISM that corresponds to your computer's architecture.
【问题讨论】:
-
使用 WSUS 并正确部署补丁。
-
@TheIncorrigible1 服务器不在域中。
-
那么他们不应该在环境中????
-
@TheIncorrigible1 我的公司使用 rAG(Rollout Automation Gear)是一种便于在一个或多个服务器中远程执行操作的工具,为此我需要部署一个 PS 脚本。
-
服务器是64位还是32位?错误表明它可能是 32。
标签: powershell powershell-remoting