File tree 1 file changed +23
-1
lines changed
1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 8
8
9
9
$WAC_Online = " http://aka.ms/WACDownload"
10
10
$WAC_Installer = " C:\windows\Temp\wac.msi"
11
+ $Port = 443
12
+
13
+ $IsAdminCenterInstalled = [bool ] (Get-WmiObject - class win32_product | Where-Object {$_.Name -eq " Windows Admin Center" })
14
+
15
+ If ($IsAdminCenterInstalled ){
16
+ $ReInstall = Read-Host " Admin Center is already installed do you want to re-install or upgrade it? [Y/N]"
17
+ If ( (" N" , " n" ) -contains $ReInstall ){
18
+ Write-Warning " Windows Admin Center is already installed and no further action is required."
19
+ Exit 0
20
+ }
21
+ }
22
+
11
23
Invoke-WebRequest - Uri $WAC_Online - OutFile $WAC_Installer
12
- msiexec / i $WAC_Installer / qn SME_PORT= 443 SSL_CERTIFICATE_OPTION= generate
24
+ msiexec / i $WAC_Installer / qn SME_PORT= $Port SSL_CERTIFICATE_OPTION= generate
25
+
26
+ # Post Installation Checks
27
+ do {
28
+ if ((Get-Service ServerManagementGateway).status -ne " Running" ){
29
+ Write-Output " Starting for Windows Admin Center"
30
+ Start-Service ServerManagementGateway
31
+ }
32
+ Start-sleep - Seconds 5
33
+ } until ((Test-NetConnection - ComputerName " localhost" - port $Port ).TcpTestSucceeded)
34
+ Write-Output " Installation completed and Windows Admin Center is running as expected."
You can’t perform that action at this time.
0 commit comments