windows 2008 r2 x64 离线升级PowerShell3.0 及打开WinRM模块
windows 2008 r2 x64离线升级PowerShell3.0 及打开WinRM模块bat脚本
1
2
3
4
5
6
7
8
9
10
11
12
13
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
非常感谢,最后几行"%apath%Powerl.bat\"应该是"%apath%\Powerl.bat\"
页:
[1]