windows 2008 r2 x64 离线升级PowerShell3.0 及打开WinRM模块
bat脚本
echo off
set apath=%~dp0
:: 如果运行提示找不到文件apath 写完整路径
echo "install net4.0"
%apath%\dotNetFx45_Full_x86_x64.exe /quiet /norestart
start /w pkgmgr /iu:PowerShell
echo y|powershell set-executionpolicy remotesigned
echo "PowerShell 3.0"
%apath%\Windows6.1-KB2506143-x64.msu -ArgumentList /quiet
REG add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "ansible" /t REG_SZ /d "\"%apath%Powerl.bat\"" /f
echo PowerShell %apath%\ConfigureRemotingForAnsible.ps1>%apath%Powerl.bat
echo REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "ansible" /f >>%apath%Powerl.bat
pause
离线升级包下载地址:
链接:http://pan.baidu.com/s/1dE2h9aL 密码:jd7j