Last active
June 26, 2023 06:36
-
-
Save jamesrcounts/7be19fd4030e7a5ca611 to your computer and use it in GitHub Desktop.
Scripted rabbitmq install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@powershell -ExecutionPolicy unrestricted .\bootmq.ps1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Update-Environment { | |
$locations = 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment', | |
'HKCU:\Environment' | |
$locations | ForEach-Object { | |
$k = Get-Item $_ | |
$k.GetValueNames() | ForEach-Object { | |
$name = $_ | |
$value = $k.GetValue($_) | |
Set-Item -Path Env:\$name -Value $value | |
} | |
} | |
} | |
# Unenhanced security | |
$AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" | |
$UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" | |
Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0 | |
Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0 | |
Stop-Process -Name Explorer | |
Write-Host "IE Enhanced Security Configuration (ESC) has been disabled." -ForegroundColor Green | |
# Get Choco | |
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) | |
# Erlang | |
choco install erlang | |
# Rabbit (ignore errors) | |
choco install rabbitmq | |
Update-Environment | |
Write-Host "Updated Environment." -ForegroundColor Green | |
Write-Host "ERLANG_HOME is $env:ERLANG_HOME" -ForegroundColor Yellow | |
& 'C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.3.0\sbin\rabbitmq-plugins.bat' enable rabbitmq_management | |
& 'C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.3.0\sbin\rabbitmq-service.bat' stop | |
& 'C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.3.0\sbin\rabbitmq-service.bat' install | |
& 'C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.3.0\sbin\rabbitmq-service.bat' start | |
# Show rabbit | |
start http://localhost:15672/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment