Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Bob Tanner
packer-windows
Commits
45db7603
Commit
45db7603
authored
Nov 26, 2015
by
Stefan Scherer
Browse files
Switch to WinRM, cherry-picked from upstream
parent
a03f085b
Changes
4
Hide whitespace changes
Inline
Side-by-side
scripts/disable-winrm.ps1
0 → 100644
View file @
45db7603
netsh
advfirewall
firewall
set
rule
name
=
"Windows Remote Management (HTTP-In)"
new
enable
=
yes
action
=
block
netsh
advfirewall
firewall
set
rule
group
=
"Windows Remote Management"
new
enable
=
yes
$winrmService
=
Get-Service
-Name
WinRM
if
(
$winrmService
.
Status
-eq
"Running"
){
Disable-PSRemoting
-Force
}
Stop-Service
winrm
Set-Service
-Name
winrm
-StartupType
Disabled
scripts/enable-winrm.ps1
0 → 100644
View file @
45db7603
Enable-PSRemoting
-Force
winrm
quickconfig
-q
winrm
quickconfig
-transport
:
http
winrm
set
winrm/config
'@{MaxTimeoutms="1800000"}'
winrm
set
winrm/config/winrs
'@{MaxMemoryPerShellMB="800"}'
winrm
set
winrm/config/service
'@{AllowUnencrypted="true"}'
winrm
set
winrm/config/service/auth
'@{Basic="true"}'
winrm
set
winrm/config/client/auth
'@{Basic="true"}'
winrm
set
winrm/config/listener
?
Address
=*+
Transport
=
HTTP
'@{Port="5985"}'
netsh
advfirewall
firewall
set
rule
group
=
"Windows Remote Administration"
new
enable
=
yes
netsh
advfirewall
firewall
set
rule
name
=
"Windows Remote Management (HTTP-In)"
new
enable
=
yes
action
=
allow
Set-Service
winrm
-startuptype
"auto"
Restart-Service
winrm
scripts/vm-guest-tools.bat
View file @
45db7603
...
@@ -15,7 +15,7 @@ if exist "C:\Users\vagrant\windows.iso" (
...
@@ -15,7 +15,7 @@ if exist "C:\Users\vagrant\windows.iso" (
)
)
if
not
exist
"C:\Windows\Temp\windows.iso"
(
if
not
exist
"C:\Windows\Temp\windows.iso"
(
powershell
-Command
"(New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/12.0.
0/2985596
/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')"
<
NUL
powershell
-Command
"(New-Object System.Net.WebClient).DownloadFile('http://softwareupdate.vmware.com/cds/vmw-desktop/ws/12.0.
1/3160714
/windows/packages/tools-windows.tar', 'C:\Windows\Temp\vmware-tools.tar')"
<
NUL
cmd
/c
""
C
:\Program
Files
\7
-Zip
\7z.exe
" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
cmd
/c
""
C
:\Program
Files
\7
-Zip
\7z.exe
" x C:\Windows\Temp\vmware-tools.tar -oC:\Windows\Temp"
FOR
/r
"C:\Windows\Temp"
%%a
in
(
VMware
-tools-windows
-*
.iso
)
DO
REN
"
%%~a
"
"windows.iso"
FOR
/r
"C:\Windows\Temp"
%%a
in
(
VMware
-tools-windows
-*
.iso
)
DO
REN
"
%%~a
"
"windows.iso"
rd
/S /Q
"C:\Program Files (x86)\VMWare"
rd
/S /Q
"C:\Program Files (x86)\VMWare"
...
@@ -32,9 +32,17 @@ goto :done
...
@@ -32,9 +32,17 @@ goto :done
:: to prevent user intervention popups which will undermine a silent installation.
:: to prevent user intervention popups which will undermine a silent installation.
cmd
/c
certutil
-addstore -f
"TrustedPublisher"
A
:\oracle
-cert
.cer
cmd
/c
certutil
-addstore -f
"TrustedPublisher"
A
:\oracle
-cert
.cer
move
/Y
C
:\Users\vagrant\VBoxGuestAdditions.iso
C
:\Windows\Temp
if
exist
"C:\Users\vagrant\VBoxGuestAdditions.iso"
(
move
/Y
C
:\Users\vagrant\VBoxGuestAdditions.iso
C
:\Windows\Temp
)
if
not
exist
"C:\Windows\Temp\VBoxGuestAdditions.iso"
(
powershell
-Command
"(New-Object System.Net.WebClient).DownloadFile('http://download.virtualbox.org/virtualbox/5.0.6/VBoxGuestAdditions_5.0.6.iso', 'C:\Windows\Temp\VBoxGuestAdditions.iso')"
<
NUL
)
cmd
/c
""
C
:\Program
Files
\7
-Zip
\7z.exe
" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
cmd
/c
""
C
:\Program
Files
\7
-Zip
\7z.exe
" x C:\Windows\Temp\VBoxGuestAdditions.iso -oC:\Windows\Temp\virtualbox"
cmd
/c
C
:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe
/S
cmd
/c
C
:\Windows\Temp\virtualbox\VBoxWindowsAdditions.exe
/S
rd
/S /Q
"C:\Windows\Temp\virtualbox"
goto
:done
goto
:done
:parallels
:parallels
...
@@ -42,7 +50,7 @@ if exist "C:\Users\vagrant\prl-tools-win.iso" (
...
@@ -42,7 +50,7 @@ if exist "C:\Users\vagrant\prl-tools-win.iso" (
move
/Y
C
:\Users\vagrant\prl
-tools-win
.iso
C
:\Windows\Temp
move
/Y
C
:\Users\vagrant\prl
-tools-win
.iso
C
:\Windows\Temp
cmd
/C
"C:\Program Files\7-Zip\7z.exe"
x
C
:\Windows\Temp\prl
-tools-win
.iso
-oC
:\Windows\Temp\parallels
cmd
/C
"C:\Program Files\7-Zip\7z.exe"
x
C
:\Windows\Temp\prl
-tools-win
.iso
-oC
:\Windows\Temp\parallels
cmd
/C
C
:\Windows\Temp\parallels\PTAgent.exe
/install
_silent
cmd
/C
C
:\Windows\Temp\parallels\PTAgent.exe
/install
_silent
rd
/S /Q
"
c
:\Windows\Temp\parallels"
rd
/S /Q
"
C
:\Windows\Temp\parallels"
)
)
:done
:done
...
...
scripts/win-updates.ps1
View file @
45db7603
...
@@ -30,10 +30,10 @@ function Check-ContinueRestartOrEnd() {
...
@@ -30,10 +30,10 @@ function Check-ContinueRestartOrEnd() {
Install-WindowsUpdates
Install-WindowsUpdates
}
elseif
(
$
script
:
Cycles
-gt
$
global
:
MaxCycles
)
{
}
elseif
(
$
script
:
Cycles
-gt
$
global
:
MaxCycles
)
{
LogWrite
"Exceeded Cycle Count - Stopping"
LogWrite
"Exceeded Cycle Count - Stopping"
Invoke-Expression
"a:\
openssh.ps1 -AutoStart
"
Invoke-Expression
"a:\
enable-winrm.ps1
"
}
else
{
}
else
{
LogWrite
"Done Installing Windows Updates"
LogWrite
"Done Installing Windows Updates"
Invoke-Expression
"a:\
openssh.ps1 -AutoStart
"
Invoke-Expression
"a:\
enable-winrm.ps1
"
}
}
}
}
1
{
1
{
...
@@ -230,4 +230,3 @@ if ($global:MoreUpdates -eq 1) {
...
@@ -230,4 +230,3 @@ if ($global:MoreUpdates -eq 1) {
}
else
{
}
else
{
Check-ContinueRestartOrEnd
Check-ContinueRestartOrEnd
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment